API Keys

Generate, configure, and revoke API keys for programmatic access to AskVerdict.

7 min read
Share

API keys authenticate your requests to the AskVerdict REST API. You can generate multiple keys, each with its own name and optional configuration (model preset, routing overrides, provider restrictions, and rate limits).

Base URL

All endpoints below are relative to https://api.askverdict.ai. Managing API keys requires an active session (cookie-based auth via the dashboard) or an existing API key.

Keys are shown once

The full API key value is returned only at creation time and is never retrievable again. Store it securely immediately after generation. If a key is lost, revoke it and generate a new one.


Endpoints

MethodPathDescription
POST/api/keysGenerate a new API key
GET/api/keysList your active API keys
PATCH/api/keys/:idUpdate a key's name or configuration
DELETE/api/keys/:idRevoke an API key

POST /api/keys

POST/api/keys

Generate a new API key. Returns the full key value (prefixed with vrd_) exactly once — store it immediately as it cannot be retrieved after this response.

Request Body

NameTypeRequiredDescription
namestringRequiredA human-readable label for this key. 1–100 characters. Used to identify keys in the dashboard and list endpoint.
configobjectOptionalOptional key-level configuration that overrides account defaults for requests made with this key. See Config Object below.

Config Object

NameTypeRequiredDescription
config.preset"balanced" | "economy" | "hackathon" | "local" | "custom"OptionalNamed model configuration preset applied to debates run with this key.
config.routingOverridesRecord<TaskType, Tier | null>OptionalPer-task model tier overrides. Provide a map of task name → tier or null (disabled). See task types below.
config.allowedProvidersstring[]OptionalRestrict which AI providers this key is permitted to use. Valid values: anthropic, openai, google, ollama, openrouter. Minimum 1 if provided.
config.rateLimitinteger | nullOptionalPer-minute request rate limit for this key. Null for no key-level limit (account limits still apply).
config.descriptionstringOptionalInternal notes about this key's purpose. Maximum 500 characters.

Task Types (for routingOverrides)

TaskDescription
orchestratorCoordinates the overall debate flow
synthesizerProduces the final verdict and summary
debaterIndividual AI agent debate participants
classifierClassifies argument types and fallacies
search_plannerPlans and executes web searches
mid_debate_analystAnalyses debate progress between rounds
fact_checkerVerifies factual claims
controversy_scorerScores argument controversy

Model Tiers

TierDescription
opusLargest, most capable models
sonnetBalanced performance and cost
haikuFast and economical
localSelf-hosted models via Ollama

Example Requests

bash
# Basic key with a name
curl -X POST https://api.askverdict.ai/api/keys \
  -H "Authorization: Bearer vrd_existing_key" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Production App" }'
 
# Key with configuration — economy preset, restricted to Anthropic only
curl -X POST https://api.askverdict.ai/api/keys \
  -H "Authorization: Bearer vrd_existing_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cost-Optimised Worker",
    "config": {
      "preset": "economy",
      "allowedProviders": ["anthropic"],
      "rateLimit": 10,
      "description": "Worker process key — cost-capped for batch jobs"
    }
  }'
 
# Key with routing overrides — use haiku for debaters, sonnet for synthesizer
curl -X POST https://api.askverdict.ai/api/keys \
  -H "Authorization: Bearer vrd_existing_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Fast Debater Config",
    "config": {
      "routingOverrides": {
        "debater": "haiku",
        "synthesizer": "sonnet",
        "orchestrator": "sonnet"
      }
    }
  }'

Response

Key prefix

The keyPrefix (e.g. vrd_live_a1b2) is always available — use it to identify which key a request was made with in your logs without ever logging the full key value.


GET /api/keys

GET/api/keys

List all active API keys for your account. Key hashes and full values are never returned — only the prefix and configuration.

Example Requests

bash
curl "https://api.askverdict.ai/api/keys" \
  -H "Authorization: Bearer vrd_your_api_key"

Response


PATCH /api/keys/:id

PATCH/api/keys/:id

Update a key's name or configuration. The key value itself cannot be changed — to rotate a key, revoke the old one and generate a new one.

Key rotation

AskVerdict does not support in-place key rotation (changing the key value). To rotate a key: generate a new key first with the same configuration, update your application to use the new key, then revoke the old one. This approach ensures zero-downtime rotation.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe API key ID (not the key value — use the id from the list endpoint).

Request Body

NameTypeRequiredDescription
namestringOptionalNew display name for the key. 1–100 characters.
configobjectOptionalReplacement config object. The entire config is replaced, not merged — supply all config fields you want to keep.

Example Requests

bash
# Rename a key
curl -X PATCH "https://api.askverdict.ai/api/keys/key_7f3e2a1b" \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Production App v2" }'
 
# Update config — add rate limit
curl -X PATCH "https://api.askverdict.ai/api/keys/key_7f3e2a1b" \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "config": {
      "preset": "economy",
      "allowedProviders": ["anthropic", "openai"],
      "rateLimit": 5,
      "description": "Tightened rate limit for cost control"
    }
  }'

Response

Error Responses

StatusCodeDescription
400VALIDATION_ERRORName is empty, config is invalid, or allowedProviders has zero entries
403FORBIDDENKey belongs to a different account
404NOT_FOUNDKey not found or already revoked

DELETE /api/keys/:id

DELETE/api/keys/:id

Revoke an API key permanently. Any requests using the revoked key will immediately receive 401 Unauthorized. This action cannot be undone.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe API key ID to revoke.

Example Requests

bash
curl -X DELETE "https://api.askverdict.ai/api/keys/key_7f3e2a1b" \
  -H "Authorization: Bearer vrd_your_api_key"

Response


Security Best Practices

Never expose keys client-side

API keys grant full account access. Never embed them in frontend JavaScript, mobile app binaries, or public source code. Use environment variables or a secrets manager.

Key Naming Strategy

Use descriptive names that identify the service or environment:

Good nameWhy
Production API — web appIdentifies service and environment
CI/CD pipelineEasy to revoke if a workflow is compromised
Developer: Alice ChenPer-person keys allow targeted revocation

Least-Privilege Configuration

Use the config object to restrict what each key can do:

json
{
  "allowedProviders": ["anthropic"],
  "rateLimit": 10,
  "preset": "economy"
}

This key can only use Anthropic models, is capped at 10 requests per minute, and always uses the economy model preset — limiting blast radius if the key is ever compromised.

Rotation Schedule

Rotate keys at least every 90 days for production environments. The zero-downtime rotation process:

  1. Generate a new key with POST /api/keys
  2. Deploy the new key to your application
  3. Verify requests are succeeding with the new key
  4. Revoke the old key with DELETE /api/keys/:id

Key Leak Response

If a key is leaked (committed to git, logged in plaintext, exposed in error messages):

  1. Immediately revoke the compromised key via DELETE /api/keys/:id
  2. Generate a replacement key and deploy it
  3. Audit recent usage in the developer portal for any unauthorised activity
  4. Check your account's debate history for unexpected usage

API Key Object Reference

FieldTypeDescription
idstringInternal key identifier (not the key value)
namestringHuman-readable label
keyPrefixstringFirst ~16 characters of the key — safe to log and display
configApiKeyConfig | nullOptional key-level configuration
createdAtstring (ISO 8601)When the key was generated

ApiKeyConfig Object

FieldTypeDescription
presetstring | nullNamed model preset
routingOverridesRecord<string, string | null> | nullPer-task tier overrides
allowedProvidersstring[] | nullPermitted AI providers
rateLimitinteger | nullPer-minute request cap for this key
descriptionstring | nullInternal notes

Was this page helpful?