Dike logoDocs

All requests to Dike's public API (/v1/*), Remote MCP Server (/mcp), and gRPC mirror require authentication via a secret Bearer API key.

Authorization: Bearer dike_live_xxxxxxxxxxxxxxxxxxxxxxxx

Key Format & Scope

  • Key Prefix: All live API keys begin with dike_live_ followed by 32 cryptographically random alphanumeric characters.
  • Comparison Security: Keys are compared server-side in constant time to prevent timing attacks and are hashed before database storage.
  • Unified Scope: An API key grants access to all permitted endpoints under your account's tier (/v1/search, /v1/reason, /v1/cite, /v1/document/*, /v1/graph/traverse, and /v1/jurisdictions).

Session Tokens vs. API Keys

Dike strictly separates Machine API Keys from Developer Portal Session Tokens:

AttributeAPI Key (/v1/*, /mcp, gRPC)Portal Session Token (/account/*)
Formatdike_live_xxxxxxxx...JWT (eyJhbGciOi...)
IssuerCreated via Dashboard or /account/keysCreated via POST /account/login
Intended ConsumerBackend servers, AI agents, CLI scriptsFrontend browser, dashboard UI
LifetimePermanent until revokedShort-lived (expires after session)
InterchangeabilityCannot call /account/* routesCannot call /v1/* routes

Do not mix credentials

Sending an API key to an /account/* route or sending a JWT session token to /v1/search will return 401 unauthorized.


Key Management

You can generate, name, and revoke multiple keys in the Dike Developer Dashboard under API Credentials.

Store keys in environment variables and never commit them to source control:

# ~/.zshrc or ~/.bashrc
export DIKE_API_KEY="dike_live_xxxxxxxxxxxxxxxxxxxxxxxx"
# .env
DIKE_API_KEY=dike_live_xxxxxxxxxxxxxxxxxxxxxxxx
import os
from dotenv import load_dotenv

load_dotenv()
DIKE_API_KEY = os.getenv("DIKE_API_KEY")
import 'dotenv/config';

const apiKey = process.env.DIKE_API_KEY;

Zero-Downtime Key Rotation

To rotate a production key without service disruption:

  1. Create a new API key in the dashboard with a descriptive label (e.g. prod-backend-v2).
  2. Deploy the new key to your staging and production environments.
  3. Verify through dashboard telemetry that requests are successfully authenticated with the new key.
  4. Revoke the old key in the dashboard. Revocations take effect immediately across all global edge nodes.

Next Steps

On this page