Skip to navigation

Exchange API key

Send the raw API key in Authorization: Bearer. No request body is needed. The resulting JWT lasts 300–900 seconds depending on client configuration (default 900). Keys must be active, unexpired and bound to an active local M2M client. Limited to 60 requests/minute independently per trusted client IP and valid API key. For delegated AI-agent connections, use Agent Auth discovery and the AI-agents guide; that protocol uses signed Agent Auth JWTs and does not exchange API keys.

Authentication

AuthorizationBearer

Long-lived sk_live_* or sk_test_* key. Use for token exchange only.

Response

Success
access_tokenstring

Short-lived JWT. Treat as a secret.

token_typeenum
Allowed values:
expires_ininteger300-900
Seconds until expiry. Use this returned value rather than a fixed refresh interval.
scopestring

Space-separated granted scopes.

organization_idstring
client_idstring
planstring

The organization’s current plan. Current values are community, pro and scale. More may be added, so do not fail on an unrecognized value, and do not treat an unrecognized or missing value as entitled. It names the plan only; it does not say whether the account is in good standing.

Errors

401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error