---
title: "Exchange agent credentials for JWT"
method: POST
path: "/v1/auth/agent-token"
tags: ["Authentication"]
---

# Exchange agent credentials for JWT

`POST /v1/auth/agent-token`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/auth/agent-token`
- Auth: none required

Returns a short-lived EdDSA-signed JWT (`access_token`). Standard claims include `sub`
(`agent:<uuid>`), `org`, `scopes`, `vault_ids`, optional `intents_api_enabled`, optional
`shroud_enabled`, optional `llm_token_billing` / `stripe_customer_id` when org LLM billing is on.

When **`shroud_enabled`** is true, the JWT payload may include **`shroud_config`**: a JSON object
mirroring the agent row in Vault (same shape as `ShroudConfig` on `GET /v1/agents/{id}`).
**Shroud** (TEE proxy) decodes this on each LLM request and runs **PolicyEngine** after the
global inspection pipeline so per-agent limits and threat **block** actions apply without a
separate policy fetch. Re-exchange the agent token after changing `shroud_config` so the JWT
is fresh.

User JWTs from password, API key, or device flow do **not** include `shroud_config`.

**Router keys.** An `sk-shroud-v1-…` key (minted at
`POST /v1/agents/{agent_id}/router-keys`) is exchanged key-only — send `api_key`
alone, no `agent_id`. The token carries a `router_key` claim
(`{id, max_concurrent_streams?, spend_cap_micro_usd?}`), lives at most **60 s**
(revocation SLA), and is only issued for Shroud-enabled agents. Revoked keys get 401.

## Request body

- AgentTokenRequest: Exactly one credential, decided by the agent's auth_method: api_key for api_key agents, oidc_token for oidc_client_credentials agents. mTLS agents send neither and present a client certificate through the TLS terminator.
  - `agent_id` string, uuid: Optional for api_key agents (ocv_ keys auto-resolve from their prefix). Required for OIDC and mTLS agents, which have no key to look up by.
  - `api_key` string: The ocv_ key, for auth_method api_key.
  - `oidc_token` string: Token minted by the agent's OIDC provider, for auth_method oidc_client_credentials. Verified against the issuer and audience on the agent record, so nothing long-lived is stored where the agent runs.
  - `dpop_jwk` object: Optional DPoP public key (JWK) binding the issued JWT to a client keypair.

## Response `200`

Agent JWT issued

- TokenResponse
  - `access_token` string, required
  - `token_type` string, required
  - `expires_in` integer
  - `refresh_token` string
  - `mfa_required` boolean
  - `mfa_token` string
  - `mfa_method` 'totp' | 'passkey'
  - `agent_id` string, uuid: Agent token exchange only — the resolved agent id.
  - `vault_ids` string[]: Agent token exchange only — vaults the agent is bound to.
  - `entitlements` AgentEntitlements: Returned on agent token exchange. The flags a client needs to decide which tools to offer, as of the moment the token was minted. treasury_signer and has_delegations are derived from the agent's treasury signer rows and active delegations and are not present on the agent profile.
    - `intents_api` boolean, required
    - `execution_intents` boolean, required
    - `execution_require_tee` boolean, required
    - `intents_require_tee` boolean, required
    - `cards` boolean, required
    - `memory` boolean, required
    - `shroud` boolean, required
    - `discoverable` boolean, required
    - `treasury_signer` boolean, required
    - `has_delegations` boolean, required

## Other responses

- `401`: Authentication required or invalid

---

[API](https://skmtc.dev/1claw/apis/1claw-api.md) · [All operations](https://skmtc.dev/1claw/apis/1claw-api/llms.txt) · [OpenAPI document](https://skmtc.dev/1claw/apis/1claw-api/revisions/ae109b496830?raw)
