Skip to main content

Authentication

All API requests require a bearer token in the Authorization header.

API Key Types

Never share API keys in conversation, chat logs, or client-side code. Always use environment variables or a secrets manager.

Getting a Key

  1. Sign up at developers.zebratruth.ai
  2. Navigate to Dashboard → API Keys
  3. Click Create Key and choose a name and environment (live or test)
  4. Copy the key immediately — it is shown only once

Validating Your Key

200 — Valid Key
401 — Invalid Key

Test Mode

Test keys (zt_test_...) return deterministic sandbox responses:
  • No cost engine — no credits deducted
  • No real LLM calls — responses are pre-built canned scenarios
  • Deterministic — same input always produces the same output
  • Responses include _meta.mode: "test" so you can detect sandbox mode
Test Mode Response

Idempotency

All mutating endpoints (POST, DELETE) require an Idempotency-Key header:
  • Generate a new UUID for each distinct request
  • Reuse the same key to safely retry a failed request
  • Prevents duplicate execution and double-charging
  • Keys expire after 24 hours

Rate Limits

When rate-limited, the API returns 429 with a Retry-After header indicating seconds to wait.