Skip to main content

API authentication

Every EvalGate API request must include a bearer token. The token identifies the caller, determines which organization the request can access, and enforces the rate limits for your plan.
This bearer token is an EvalGate API key, not a model-provider key. Model-backed workflows use bring your own provider key (BYOK); store that credential in Provider Keys or Model Gateway and never send it in the EvalGate Authorization header.

Add the authorization header

Include your API key in the Authorization header on every request:
Requests without this header, or with an invalid key, receive 401 Unauthorized.

Get your API key

  1. Open the Developer Dashboard.
  2. Go to Settings -> API Keys.
  3. Create a new key.
  4. Copy the API key and the Organization ID shown in the creation dialog.
Treat your API key like a password. Do not commit it to version control. Store it in an environment variable or secret manager and pass it at runtime.

Environment variables

The TypeScript and Python SDKs read these environment variables automatically: Set them in your shell or .env file:
Direct REST API routes usually derive organization scope from the API key. Pass organizationId in the body or query only where an endpoint explicitly documents it.

Authentication errors

UNAUTHORIZED
Your request did not include an Authorization header, or the key is invalid, expired, or revoked.
FORBIDDEN / NO_ORG_MEMBERSHIP
Your key is valid but lacks the required permissions for this resource. This can mean the key does not have the necessary scopes, or the key does not belong to the organization that owns the requested resource.
Both errors follow the standard error envelope:

Tool API authentication

GET /api/mcp/tools and POST /api/mcp/call are authenticated, organization-scoped HTTP Tool API endpoints. Tool discovery requires eval:read; only read-only tools can be executed. These endpoints are not a Model Context Protocol server.