For the complete documentation index, see llms.txt. This page is also available as Markdown.

Oauth

Exchange Token

post

Exchange an identity token for an access token (the RFC 7523 jwt-bearer grant).

The identity token must match the federation rule federation_rule_id names and verify against its issuer: one on federation_issuers for an operator's rule, the one the rule names for a member's. organization_id, where set, must be the UUID of the rule's key's organization. workspace_id and service_account_id are accepted and ignored, so a client configured for Anthropic needs only its rule and organization changed. The access token authenticates as that key until expires_in runs out, the rule is deleted or the key stops passing its checks.

Every refusal of the identity token answers 401 invalid_grant with the same description.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

An RFC 7523 jwt-bearer token request, as the Anthropic SDKs and Claude Code send it.

Every field is optional here so that a missing one is answered in the RFC 6749 error shape rather than as a validation error. Fields the request does not use are ignored.

assertionstring · nullableOptional

The identity token.

federation_rule_idstring · nullableOptional

The id of the federation rule the identity token must match.

grant_typestring · nullableOptional

urn:ietf:params:oauth:grant-type:jwt-bearer

organization_idstring · nullableOptional

When set, the UUID of the organization of the rule's key.

service_account_idstring · nullableOptional

Ignored. Accepted so that a client configured for Anthropic's service account id is not refused.

workspace_idstring · nullableOptional

Ignored. Accepted so that a client configured for Anthropic's workspace id is not refused.

Responses
200

Successful Response

application/json

An access token, as RFC 6749 section 5.1 shapes it. Present it as a bearer token in place of the key.

access_tokenstringRequired
expires_inintegerRequired

Seconds until the access token expires.

token_typestringOptionalDefault: Bearer
post/api/v1/oauth/token
POST /api/v1/oauth/token HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 208

{
  "assertion": "<identity token>",
  "federation_rule_id": "7d0c7a52-9a2e-4b55-8f3a-2f1f6c0d2a11",
  "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
  "organization_id": "5b3f8e0e-1c2d-4e7f-9a8b-0c1d2e3f4a5b"
}
{
  "access_token": "text",
  "expires_in": 1,
  "token_type": "Bearer"
}

Last updated

Was this helpful?