Authentication models
Pydantic models generated from the OpenAPI document; import them from carmen_cloud_client.auth.models.
Key
| Field | Type | Required | Description |
|---|---|---|---|
kty | str | None | Key type; always RSA. | |
n | str | None | RSA modulus (base64url). | |
e | str | None | RSA public exponent (base64url). | |
kid | str | None | Key id — matches the kid header of minted tokens. | |
alg | str | None | Signature algorithm; always RS256. | |
use | str | None | Key use; always sig. |
JsonWebKeySet
| Field | Type | Required | Description |
|---|---|---|---|
keys | list[Key] | yes | The active signing key(s). Two entries appear briefly during key rotation. |
OAuthErrorResponse
| Field | Type | Required | Description |
|---|---|---|---|
error | str | yes | OAuth-style error code: invalid_client (missing/unknown API key) or access_denied (the key cannot use the bearer surface). |
error_description | str | None | Human-readable explanation. |
TokenResponse
| Field | Type | Required | Description |
|---|---|---|---|
access_token | str | yes | The bearer access token (RS256 JWT). Present it as Authorization: Bearer <token> on the /workspace/{workspaceId}/** routes. |
token_type | str | yes | Always Bearer. |
expires_in | int | yes | Token lifetime in seconds (RFC 6749 §5.1); 3600 today. Tokens cannot be revoked once issued — request a new one after expiry. |
expires_at | int | yes | Absolute expiry as unix epoch seconds (equals the token’s exp claim) — a convenience for wall-clock renewal scheduling. |
workspace_id | str | yes | The workspace the API key belongs to — the {workspaceId} to use on the workspace routes; no separate discovery call needed. |
role | str | yes | The API key’s workspace role, e.g. ADMIN. |
scope | str | yes | The granted scope, cc.workspace.<role>.<workspaceId> — the same format Cloud-Console tokens carry. |