Skip to main content

CLI

Spend, Budgets, and API Tokens

Use verdictan spend to examine recorded spending. Use verdictan token to limit an application credential by provider, model, spend, request count, or expiry.

All commands use API authentication. Set VERDICTAN_API_TOKEN, or sign in with verdictan auth login before you run them. Each command accepts --json. The verdictan spend commands accept the standard overrides --config <path>, --api-url <url>, --profile <name>, and --region <region>. The verdictan token commands accept --config <path>, --api-url <url>, and --profile <name> only. The tables below list only the command-specific flags.

Examine recorded cost​

verdictan spend summary --since 7d --group-by region --json

Read these values as estimated costs from recorded usage. They are not your provider invoice. If usage or pricing is missing, the total does not include all costs.

Before you create a limit, select the control that applies to your request path:

ControlUse it for
Governed token limitsLimit requests made with a specified application token.
Provider budgetLimit provider headroom when targets have pricing metadata.
Scope budgetStore an organization, team, user, or key budget. Connected gateways do not load these records for routing.

For a procedure to configure and verify a token limit, see Usage costs and budgets.

verdictan spend summary​

verdictan spend summary returns the spend report for the organization.

Usage​

verdictan spend summary [--since <duration|rfc3339>] [--group-by <dimension>] [--json]

Options​

FlagDescription
--since <duration|rfc3339>Start of the report window. Accepts an RFC3339 UTC timestamp or a relative duration such as 30d.
--group-by <dimension>Group the totals by one dimension, such as region.

Examples​

verdictan spend summary
verdictan spend summary --since 30d --group-by region --json

verdictan spend budget​

verdictan spend budget manages scope budgets at /v1/budgets. A scope budget applies to an organization, a team, a user, or a key.

Usage​

verdictan spend budget list [--json]
verdictan spend budget get --budget-id <id> [--json]
verdictan spend budget create --name <name> --max-budget <amount> --target-type <type> [OPTIONS]
verdictan spend budget update --budget-id <id> [OPTIONS]
verdictan spend budget delete --budget-id <id> --yes

Options​

FlagApplies toDescription
--budget-id <id>get, update, deleteMandatory budget ID.
--name <name>create, updateBudget name. Mandatory for create.
--max-budget <amount>create, updateMaximum amount. Mandatory for create.
--target-type <key|user|team|organization>createMandatory scope of the budget.
--target-id <id>createID of the key, user, or team. Mandatory for those target types.
--currency <code>create, updateCurrency code. The default for create is usd.
--reset-schedule <schedule>create, updateReset schedule: never, daily, weekly, or monthly. The API rejects any other value with 422. A budget without a schedule does not reset.
--alert-threshold-pct <n>create, updateAlert threshold as a percentage. The default for create is 80.
--yesdeleteMandatory confirmation. Without it, the command stops with an error and makes no changes.

Examples​

# Store an organization-level monthly budget
verdictan spend budget create \
  --name "Monthly planning budget" \
  --max-budget 100 \
  --target-type organization \
  --reset-schedule monthly

# Team budget with an earlier alert
verdictan spend budget create \
  --name "Support Team" \
  --max-budget 25 \
  --target-type team \
  --target-id team_abc123 \
  --alert-threshold-pct 70

# Raise a limit, then confirm the stored value
verdictan spend budget update --budget-id budget_abc123 --max-budget 150
verdictan spend budget get --budget-id budget_abc123 --json

Reset periods are in UTC. A daily period starts at 00:00 UTC, a weekly period on Monday, and a monthly period on the first day of the month. When a period ends, the budget shows zero spend.

A standalone gateway with an event sink can use the remaining scope budget when it selects a priced target. A connected gateway does not load scope budgets for routing. For the connected request path, use provider budgets, governed token limits, and usage authorization. Usage Costs and Budgets gives details about the difference.

verdictan spend provider-budget​

verdictan spend provider-budget manages spend limits for one provider. The gateway uses provider budgets in its provider-headroom check.

Usage​

verdictan spend provider-budget list [--json]
verdictan spend provider-budget get --budget-id <id> [--json]
verdictan spend provider-budget create --provider <name> --limit-usd <amount> [--reset-schedule <schedule>] [--reset-at <time>] [--json]
verdictan spend provider-budget delete --budget-id <id> --yes

Options​

FlagApplies toDescription
--budget-id <id>get, deleteMandatory provider budget ID.
--provider <name>createMandatory provider name, such as openai or anthropic.
--limit-usd <amount>createMandatory limit in USD.
--reset-schedule <schedule>createReset schedule: daily, weekly, monthly, or lifetime (no reset). The default is monthly. --period is an alias.
--reset-at <time>createNext reset time as an RFC 3339 timestamp. It also sets the start of later periods.
--yesdeleteMandatory confirmation. Without it, the command stops with an error and makes no changes.

Examples​

verdictan spend provider-budget create --provider openai --limit-usd 25 --reset-schedule monthly
verdictan spend provider-budget list --json

To remove a provider budget that is not in use, copy its ID from list. Then run verdictan spend provider-budget delete --budget-id "$BUDGET_ID" --yes. Removal changes provider headroom.

Before you use a provider budget, make sure that the target has pricing metadata. Send one allowed request through the gateway. Then verify that the gateway blocks a request when the budget is exhausted.

verdictan token​

verdictan token governs the API tokens that applications, IDEs, gateways, and integrations use. The token ID is a positional argument for each subcommand that acts on one token.

Usage​

verdictan token list [--purpose <purpose>] [--alerts-only] [--json]
verdictan token get <id> [--json]
verdictan token create --name <name> [OPTIONS]
verdictan token update <id> [OPTIONS]
verdictan token clone <id> --reason <text> [OPTIONS]
verdictan token rotate <id> [--json]
verdictan token validate [--force-tty] [--json]
verdictan token delete <id> --yes [--json]
verdictan token emergency-revoke <id> --reason <text> --yes [--revoke-active-sessions] [--json]
verdictan token exchange-code [OPTIONS]

verdictan auth documents verdictan token exchange-code, which changes a PKCE authorization code into one API token.

Options​

FlagApplies toDescription
<id>get, update, clone, rotate, delete, emergency-revokeMandatory positional token ID.
--purpose <general|gateway-runtime|integration>list, createToken purpose. For list, return only one purpose. For create, the default is general.
--alerts-onlylistReturn only tokens with a budget, request, expiry, or terminal alert.
--name <name>create, update, cloneDisplay name. Mandatory for create.
--key-class <durable|virtual|disposable>createGoverned key class. The default is durable.
--provider <name>create, update, cloneProvider binding. update and clone can only narrow it.
--model-filter <model>create, update, cloneModel filter. Supply the flag for each value, or pass values with commas between them.
--gateway-id <id>create, update, cloneGateway binding.
--team-id <id>create, update, cloneTeam binding.
--budget-id <id>update, cloneBudget binding.
--rate-limit-rpm <n>create, update, cloneRequests for each minute. update and clone can only lower it.
--rate-limit-tpm <n>create, update, cloneTokens for each minute. update and clone can only lower it.
--max-budget <amount>create, update, cloneMaximum spend for the token. update and clone can only lower it.
--max-requests <n>create, update, cloneMaximum request count. update and clone can only lower it.
--currency <code>create, update, cloneBudget currency, such as USD.
--metadata-json <json>update, cloneReplace the public token metadata with one JSON object.
--policy-id <id>update, cloneReplace the attached policy IDs. Supply the flag for each value, or pass values with commas between them.
--expires-in <duration>createExpiry duration, such as 30d or 24h.
--expires-in-seconds <n>cloneExpiry duration in seconds.
--expires-at <timestamp>cloneExpiry timestamp in the format that the API accepts.
--reason <text>clone, emergency-revokeMandatory lifecycle reason.
--revoke-active-sessionsemergency-revokeAlso revoke the active sessions of the token subject when applicable.
--force-ttyvalidateAccept the token value from an interactive terminal as an alternative to a pipe.
--yesdelete, emergency-revokeMandatory confirmation. Without it, the command stops with an error and makes no changes.

Create a bounded application token​

This example creates a short-lived token with a small spending limit and at most three requests:

verdictan token create \
  --name docs-request-test \
  --purpose general \
  --key-class disposable \
  --max-budget 1 \
  --max-requests 3 \
  --expires-in 1h

Save the returned token value immediately. It shows one time. Keep the token ID for subsequent management. Before use, apply the necessary gateway, provider, and model bindings.

The limits apply to requests made with this token. They do not limit traffic that uses other credentials.

Update or copy a configured token​

Set TOKEN_ID to an ID from verdictan token list. An update can narrow its limits:

verdictan token update "$TOKEN_ID" --max-requests 2
verdictan token get "$TOKEN_ID" --json

To make a narrower copy for a different task:

verdictan token clone "$TOKEN_ID" \
  --reason "Isolated documentation test" \
  --model-filter "replace-with-an-allowed-model-id"

Rotate a token​

Rotation replaces the raw credential. Prepare to update its consumers before you run this command:

verdictan token rotate "$TOKEN_ID"

Save the new value. Update the application. Send a request with the replacement to verify it.

Validate or revoke a token​

Validation reads the candidate value from standard input:

printf '%s' "$CANDIDATE_TOKEN" | verdictan token validate

To revoke a token that is no longer necessary:

verdictan token delete "$TOKEN_ID" --yes

If you think that the credential was exposed, record the reason with an emergency revocation:

verdictan token emergency-revoke "$TOKEN_ID" \
  --reason "Suspected credential exposure" --yes
TaskSubcommand
Create a new bounded tokencreate
Narrow metadata, bindings, limits, or policies of one tokenupdate
Create a narrower copy of one token recordclone
Replace the raw value and keep the recordrotate
Verify a raw value against the APIvalidate
Revoke with proof metadataemergency-revoke

Limits and failure behavior​

  • All commands stop with an authentication error when no API token or session is available.
  • verdictan token commands do not accept --api-token or --region. Use VERDICTAN_API_TOKEN or a stored profile.
  • spend budget delete, spend provider-budget delete, token delete, and token emergency-revoke do not prompt. They stop with an error unless you pass --yes.
  • token create, token clone, and token rotate show the raw token value one time. Store the value immediately and keep JSON output out of logs.
  • token validate reads the raw token from standard input. When standard input is a terminal, the command stops unless you pass --force-tty. Do not put a token value in shell history or process arguments.
  • token rotate returns a replacement value. Update each consumer immediately, and do not give the previous value to consumers.
  • token update and token clone narrow a token. They do not widen a binding or increase a limit.
  • A scope budget is a stored record. It does not enforce spend on a connected gateway.
  • A provider budget uses pricing metadata on the target. Verify one allowed request. Then verify that the gateway blocks a request when the budget is exhausted.

Next steps​