Phantom tokens
A phantom token is the short-lived capability token your application presents on the data plane to call an agent — your app never holds a raw provider API key. These endpoints manage the tokens for one agent over the/v1 control plane. See the control-plane overview for authentication and the response envelope — the examples below authenticate with $TOKEN, a short-lived OAuth 2.1 access token minted there.
Token format and environment
Tokens are formattedkp_<env>_<kind>_<random>_<crc>, e.g. kp_live_a_1a2b3c…. The prefix field is the first 12 characters (kp_live_a_ plus two characters), safe to display and store for identification.
The environment segment is derived from the key you mint with — a test key mints a kp_test_… token, a live key mints a kp_live_… token. There is no environment parameter on the request.
List tokens
page, per_page), newest first. Requires the read capability. Never returns plaintext. Returns 404 not_found if the agent does not belong to your tenant or is a system agent.
Mint a token
mint capability on ai_gateway.
Request body — all fields optional.
The token’s capability scope (providers and models) is derived automatically from the agent’s
default_model. It is not accepted from the request body.expires_at is always set: omitting expires_in_seconds gives the 30 days default rather than a permanent token. (Tokens minted before this default existed can still carry a null expires_at.) If dpop_required is true but dpop_jkt is missing, the request returns 400 validation — a DPoP-bound token is unusable without the key thumbprint. See Tokens & DPoP for generating the thumbprint and sending DPoP proofs.
Revoke a token
write capability. Returns 404 not_found if the token does not exist or is already revoked.