Authentication
API keys, temporary tokens, and how to authenticate with the Scribeberry API.
Scribeberry uses API key authentication for all API access. There are two types of credentials depending on your use case.
π Need an API key? Go to Console β Settings β API Keys to create or manage your project's keys.
API Keys
Every project gets API keys that start with sk_test_ (sandbox) or sk_live_ (production). These are permanent, full-access keys that should only be used server-side.
Using API Keys
Include your API key in the Authorization header:
With the SDK:
Key Prefixes
| Prefix | Environment | Usage |
|---|---|---|
sk_test_ | Sandbox | Development and testing |
sk_live_ | Production | Live production traffic |
sb_rt_ | Both | Temporary realtime token (see below) |
π« Danger: Never expose
sk_test_orsk_live_keys in client-side code, browser JavaScript, mobile apps, or public repositories. These keys have full access to your project.
Temporary Realtime Tokens
For browser-side realtime transcription, you need a short-lived token that's safe to expose to end users. This is the sb_rt_ token.
How it works
- Your server calls
POST /api/v1/realtime/tokenswith your API key - Scribeberry returns a temporary
sb_rt_token (valid for up to 1 hour) - Your server passes the token to the browser
- The browser connects via WebSocket using the temp token
- Transcription events stream back in real-time
Creating a Token (Server-Side)
Using the Token (Browser β Recommended)
The easiest approach: provide a getRealtimeToken callback. The SDK handles token fetching and auto-refresh.
Using the Token (Browser β Manual)
Alternatively, pass a static token directly:
Token Restrictions
Temporary tokens have intentional limitations:
| Capability | API Key (sk_*) | Temp Token (sb_rt_*) |
|---|---|---|
| REST API (templates, notes) | β | β |
| WebSocket realtime transcription | β | β |
| Create other tokens | β | β |
| Maximum lifetime | Permanent | 1 hour |
| Safe for browser | β | β |
Key Management
Rotating Keys
You can rotate API keys from the Scribeberry Console β Settings β API Keys. When you rotate a key:
- A new key is generated immediately
- The old key remains valid for a grace period
- Update your server configuration with the new key
- The old key is automatically revoked after the grace period
Best Practices
- Use environment variables β never hardcode keys in source code
- Separate keys per environment β use
sk_test_for development,sk_live_for production - Use temp tokens for browsers β never send permanent keys to the client
- Monitor usage β check the Console dashboard for unusual activity
- Rotate regularly β rotate production keys every 90 days