/v1 API. Every authenticated call uses the Authorization: Bearer ... header, and each key belongs to one BabySea account.
What you see in API keys
The workspace page at API keys shows:- The page title API keys.
- The button Create API key.
- A search field.
- A table with the columns
API name,Prefix,Last used,Created,Status, andIP allowlist. - A row action menu with
Rotate,Revoke, andDeletewhen those actions are available for that key.
Key format
BabySea generates keys with thebye_ prefix. The stored record also keeps a short prefix for dashboard display and lookup.
How authentication works
Pass your API key in theAuthorization header with the Bearer scheme:
Terminal
TypeScript
Verify the secret
BabySea compares the presented key against a stored bcrypt hash. The raw key is never stored in the database.
/v1 route handler.
Key prefix
The first 9 characters of each key are stored as the key prefix and displayed in the dashboard. This lets you identify a key without exposing the full secret.One time display
For security, the full API key is displayed exactly once when you create or rotate the key. After you dismiss that dialog, the raw value cannot be retrieved again. If you lose your key, you need to either:- Rotate the key and replace the old secret in your applications.
- Delete the key and create a new one.
Scopes and account binding
Each API key is bound to one account. Requests made with that key run inside that account’s data boundary. When you create a key in the dashboard, you choose one of these permission presets:| Preset | Dashboard description |
|---|---|
Full Access | All permissions - read, write, delete |
Generate Only | Create & read generations + browse models |
Read Only | Read generations, account info, health - no spending |
Monitor Only | Health checks & model catalog - no account data |
Status column
TheStatus column can show these values:
| Status | Meaning |
|---|---|
Active | The key can authenticate requests. |
Rotated | The key was rotated and is still inside the current 24 hour replacement window. |
Expired | The key can no longer authenticate. |
Revoked | The key was manually disabled and can no longer authenticate. |
Common authentication errors
The API key system is directly connected to the route permission checks. These are the main errors users will see when a key cannot be used:| Code | Meaning |
|---|---|
BSE1001 | Missing API key. Provide a valid key via the Authorization header. |
BSE1002 | Invalid or expired API key. |
BSE1003 | API key does not have permission for this resource. |
BSE1007 | This IP address is not in the allowlist for this API key. |
Next steps
- Create - Step by step guide to creating your first API key
- Scopes - Understand permissions and choose the right preset
- IP allowlist - Restrict key usage to trusted IP addresses
- Rotation - Rotate, revoke, and delete keys from the dashboard