Quick facts
- API keys are workspace scoped, not global credentials.
- API key management uses JWT-authenticated workspace APIs.
- Public Agent API calls use the API key itself.
- Plaintext key material is returned only once at creation time.
- Expired keys no longer authorize requests and do not count toward the active-key quota.
- If the key creator is no longer an active workspace member, the key becomes invalid.
Key format and transport
Format:Status model
| Status | Meaning |
|---|---|
active | Not revoked and not expired |
expired | Not revoked, but expiresAt is in the past |
revoked | Revoked; this wins even if the key is also expired |
Role and scope model
Accepted roles
The current create-key flow accepts:viewermember
| Role | Typical use case | Can call write-capable public endpoints? |
|---|---|---|
viewer | Read-only agents and reporting flows | No |
member | Agents that validate, create, finalize, or queue work | Yes |
scopecontrols which API surfaces are availablerolecontrols effective permissions inside the workspace- a
viewerkey can still be rejected on write endpoints even if write scopes were requested
Scopes
| Scope | Purpose | Typical endpoints |
|---|---|---|
workspace_read | Read workspace context and subscription information | GET /public/v1/workspace |
system_strategies_read | Read system strategy templates | GET /public/v1/system-strategies |
strategies_read | Read workspace strategies | GET /public/v1/strategies |
strategies_write | Validate and create strategies, copy templates, finalize versions | POST /public/v1/strategies/validate, POST /public/v1/strategies, POST /public/v1/strategies/:id/versions/finalize |
backtests_read | Read backtests and results | GET /public/v1/backtests, GET /public/v1/backtests/:id |
backtests_write | Queue backtest jobs | POST /public/v1/backtests |
Active-key quota
The current active-key quota is tier based:| Tier | Active key limit |
|---|---|
free | 5 |
plus | 20 |
pro | 50 |
revokedAt = null- and
expiresAtis eithernullor still in the future
- expired keys do not block replacement keys
- revoked keys do not count toward the quota
Management API for API keys
These endpoints are for signed-in workspaceowner or admin users.
Authentication:
List API keys
Create an API key
name: required, 1-100 charsdescription: optional, up to 500 charsrole: optional,memberorviewerscopes: optional, but if provided it must contain at least one scopeexpiresAt: optional, but must be a future datetime
- default
roleismember - default scopes are the full public-agent set used by write-capable workflows
apiKeyis returned once, at creation time only- the database stores a hash, not the plaintext secret
Revoke an API key
- revoke takes effect immediately
- repeated revoke calls are idempotent and still return success
Using an API key with the Public Agent API
Base path:Recommended first request
For both developers and AI agents, the first request should be:- which workspace the key belongs to
- the effective
role - granted
scopes - subscription-tier constraints that may affect behavior
Minimal workflows
Read-only agent
Recommended forviewer keys.
GET /public/v1/workspaceGET /public/v1/system-strategiesGET /public/v1/strategiesGET /public/v1/backtests
Write-capable agent
Recommended formember keys.
GET /public/v1/workspacePOST /public/v1/strategies/validatePOST /public/v1/strategiesPOST /public/v1/strategies/:id/versions/finalizePOST /public/v1/backtestsGET /public/v1/backtests/:idto poll for results
Common failures
401 Unauthorized
Typical causes:- missing
x-api-key - malformed
Authorization: Bearer ... - invalid key format
- revoked key
- expired key
- key creator is no longer a workspace member
403 Forbidden
Typical causes:- insufficient scopes
- insufficient role, such as a
viewerkey calling a write endpoint - active-key quota reached during key creation
404 Not Found
Typical management case:DELETE /workspaces/:workspaceId/api-keys/:apiKeyIdpoints to a missing key
Best practices
For developers
- Store API keys in a secret manager — treat them like passwords.
- Create one key per agent or environment; don’t share keys.
- Use
viewerrole with read scopes for read-only workflows. - Use
memberrole for agents that create strategies or run backtests. - Set an expiration date when possible instead of leaving keys open-ended.
- Revoke keys you’re no longer using.
For AI agents
- Always call
GET /public/v1/workspacefirst to confirm your context. - Validate payloads with
POST /public/v1/strategies/validatebefore writing. - Don’t assume backtests finish synchronously — poll with
GET /public/v1/backtests/:id. - Use only
/public/v1endpoints for agent workflows. - When handling errors, check the HTTP status code first, then the response message.