Backend SDK keys allow your server-side application to log events to Brain on behalf of agents. Each key is scoped to a single project and carries an expiry. The raw key is returned only once in the creation response; after that only the prefix and metadata are stored. Treat the key like a password and store it in a secrets manager or environment variable. Only project Admins (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Vedant-Jayesh-Oza/otas/llms.txt
Use this file to discover all available pages before exploring further.
privilege=1) can create SDK keys.
Request
Method:POSTURL:
http://localhost:8000/api/project/v1/sdk/backend/key/create/Authentication:
X-OTAS-USER-TOKEN + X-OTAS-PROJECT-ID headers
Headers
Signed JWT for the authenticated user.
UUID of the project to create the SDK key for.
Body parameters
Number of days until the key expires. Must be between
1 and 300.Response
1 on success, 0 on failure.backend_sdk_key_created on success.Example
Listing keys
To retrieve a list of all SDK keys for a project (without the raw secret), send:cURL
id, prefix, name, created_at, expires_at, active, and revoked_at for each key. Requires Admin privilege.
Revoking a key
To revoke an SDK key immediately, send:cURL
active flag is set to false and revoked_at is recorded. Requires Admin privilege.
Error responses
status_description | HTTP status | Cause |
|---|---|---|
missing_token | 400 | The X-OTAS-USER-TOKEN header was absent. |
invalid_token | 401 | Token is invalid or expired. |
missing_headers | 400 | X-OTAS-PROJECT-ID was absent or the user is not a member of the project. |
sdk_key_creation_failed | 400 | validity field missing, out of range, or non-integer. |
sdk_key_creation_failed | 500 | Unexpected server-side error during key generation. |
forbidden | 403 | The authenticated user is not an Admin of the project. |