Skip to main content

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.
The raw token value is returned exactly once, in the mint response. KnoxCall stores only a hash — list responses never contain plaintext. Save the minted token to your secrets manager immediately.

Token format and environment

Tokens are formatted kp_<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 prefix changed on 2026-09-01, with no compatibility window. Phantom tokens used to be kc_-prefixed — the same family as OAuth 2.1 access tokens — and are now kp_. A token issued before that date no longer parses. Re-mint. See the changelog.
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

Returns the agent’s tokens, paginated (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.
Response

Mint a token

Mints a new phantom token for the agent and returns the plaintext once. Requires the 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.
Response
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

Immediately revokes the token. In-flight requests that have already passed auth complete; no new requests are accepted. Requires the write capability. Returns 404 not_found if the token does not exist or is already revoked.
Response