Skip to main content

Manage API tokens

Every application that calls your gateway sends a Verdictan API token. Give each application its own token, so you can limit what it can reach and revoke it without affecting anything else.

Your first gateway's credentials come from the quickstart. This page covers every token after that.

Before you start​

  • tokens:create to create a token, and tokens:rotate or tokens:revoke to replace or remove one.
  • An agent with a connected gateway, so that you can test the token. See the quickstart.
  • A role for the token. You can give only the permissions that you have.

Create an API token​

Sign in to the EU Console or US Console with permission to manage API tokens.

  1. Open Administration → Credentials → API tokens and select Create token.
  2. Name it after the application, for example support-app-test.
  3. Choose durable for a token you'll keep using, and set an expiry.
  4. Pick a role with the permissions the application needs.
  5. Add gateway, provider, model, team, and spend limits.
  6. Create the token and copy its value right away. The Console shows it only once.

Store the value in the application's secret manager or environment. For a throwaway token, set an expiry and at least one spend or request-count limit.

Verify the API token​

With your agent's central URL (without /v1) and the new token:

export VERDICTAN_BASE_URL="https://<your-published-hostname>"
export VERDICTAN_CLIENT_TOKEN="replace-with-your-api-token"

curl --fail-with-body --silent --show-error \
  --header "Authorization: Bearer $VERDICTAN_CLIENT_TOKEN" \
  "$VERDICTAN_BASE_URL/v1/models"

The response lists the models this token can use. Listing models doesn't call a provider, so also send one small model request and check its response and recorded usage.

Don't confuse this with the gateway token, which starts the gateway and never goes in an application.

Edit a token​

Open the token in Administration → Credentials → API tokens and select Edit. You can change these settings:

  • Name.
  • Expires at. Select a later date to extend the token, or an earlier date to make it expire sooner. You cannot remove an expiry. You cannot set a new expiry on an expired token. Rotate it or create a new token.
  • Roles. Add or remove roles. You can add only a role whose permissions you have. If you do not have all of its permissions, the save fails with tokens.delegation_ceiling_exceeded. The token keeps the system role of its purpose.
  • Model access rules.

The token value does not change, so clients continue to work. Trail records the old and the new values. From the API, send name, expires_at, role_ids, or policy_ids to PATCH /v1/tokens/{id}. A field that you do not send does not change.

Rotate a token without an interruption​

  1. Create a replacement with the same role and bindings.
  2. Put it in the application's secret configuration and send a test request.
  3. Check that the recorded usage belongs to the replacement.
  4. Revoke the old token once every consumer has switched.

This gives you an overlap. verdictan token rotate <token-id> instead replaces the value in place, immediately; use it only when you can update every consumer at once.

Narrow, revoke, or delete a token​

Clone narrower creates a new token with the same or fewer permissions and limits, for example keeping only one model of a two-model filter. It can never widen access. From the CLI:

verdictan token clone "$TOKEN_ID" --reason "support app: gpt-4o-mini only" --model-filter gpt-4o-mini

To delete a token, revoke it. The Console calls this Revoke and the CLI calls it verdictan token delete. No request can use a revoked token again. To revoke a token, open it in Administration → Credentials → API tokens, select More → Revoke, check the name, and confirm.

From the CLI, take the ID from verdictan token list:

TOKEN_ID="replace-with-the-token-id-to-revoke"
verdictan token delete "$TOKEN_ID" --yes

--yes skips the confirmation. New requests with the old value are rejected; a request already in progress can finish.

If you think a token was exposed, use Emergency revoke in the Console, or verdictan token emergency-revoke "$TOKEN_ID" --reason "<why>". It records your reason with the revocation. Investigate before you issue a replacement.

Examine tokens​

In the Console, Administration → Credentials → API tokens lists each token with its prefix, status, key class, expiry, and last use.

API tokens list with an example token, its prefix, status, key class, and expiry, and the Create token button.

From the CLI:

verdictan token list
verdictan token get "$TOKEN_ID"

get shows the token's role, bindings, expiry, and usage. A missing last_used_at means the token is new or unused; find its owner before you revoke it.

Set the scope with bindings​

Add bindings before a token's first use. They limit the damage if it leaks.

BindingEffect
gateway_idOnly that hosted gateway runtime can use the token
team_idThe team owns or limits the token
user_idThe user owns the token, and is the default spend owner when no gateway attribution exists
providerOnly that upstream provider
model_filterOnly the listed models
budget_id, max_budgetSpending stops at the budget
max_requestsThe token stops after this many requests

A request the token's bindings or permissions don't allow is denied, however valid the token itself is. The Usage explorer can filter to one token; when the gateway forwards only key_id, it attributes spend to the token's owner fields.

Select a key class​

Key classForRequired limits
durableLong-lived gateway or client workloadsExpiry optional
virtualWorkloads narrowed to a provider, model, or gatewayExpiry optional
disposableShort jobs and limited-use automationAn expiry, plus max_budget or max_requests

All classes appear in the /v1/tokens inventory. Create and clone responses include token_value once; after that you only see metadata: key_class, resource_id, resource_vrn, attached policies, limits, and depletion state.

Token profiles​

Different workloads need different kinds of token:

WorkloadProfileWhere the credential goes
Application, SDK, IDE, or curl calling the gatewaypurpose=general, principal_type=api_tokenAuthorization: Bearer on each gateway request
Gateway runtimepurpose=gateway_runtime, bindings.gateway_id, bindings.team_idVERDICTAN_API_TOKEN on the gateway host
Long-term machine integrationpurpose=integration, bindings.team_idAuthorization: Bearer on each control-plane request
Upstream model providerNot a Verdictan tokenThe provider credential on the gateway host or in Secrets

The Console form creates purpose=general tokens. Gateway credentials come from the gateway setup flow. For integration or gateway tokens, use the CLI or the API.

Troubleshooting​

ProblemWhat to check
Create token is disabledPick at least one role and fill in the required fields.
401The application has the right value, and the token hasn't expired or been revoked.
403The error code, then the role's permissions, gateway and model limits, and request quota.
The token stops before it expiresIts remaining budget and request count. Expiry is not the only limit.
Clone failsThe clone's limits and bindings must be equal or narrower.

Next steps​