RunarsRunars Docs
Endpoints

Authentication

Authenticate requests to the Runars API

Every request to the Runars API must include an API key. The format of that key depends on which dialect you're using.

The two dialects

Runars exposes the same models through two industry-standard API shapes:

DialectEndpointHeaderExample
Anthropic Messages APIhttps://api.runars.ca (root)x-api-keyx-api-key: sk-runars-...
OpenAI Chat Completionshttps://api.runars.ca/v1Authorization: BearerAuthorization: Bearer sk-runars-...

Both dialects use the same API key format. The difference is how you pass the key in the request header.

Anthropic dialect example

curl https://api.runars.ca/v1/messages \
  -H "x-api-key: sk-runars-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-3-5-sonnet-20241022",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Say hello!"}
    ]
  }'

OpenAI dialect example

curl https://api.runars.ca/v1/chat/completions \
  -H "Authorization: Bearer sk-runars-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-3-5-sonnet-20241022",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Say hello!"}
    ]
  }'

API key format & management

All Runars API keys follow the same format: sk-runars- followed by 32 bytes of random data. See Manage API Keys for how to create, view, and revoke keys.

Authentication errors

401 Unauthorized — The API key is missing, invalid, or revoked. Check that:

  • You're including the key in the correct header (x-api-key for Anthropic, Authorization: Bearer for OpenAI).
  • The key hasn't expired or been revoked.
  • You haven't accidentally modified the key's format.

Key revocation is effective within a few seconds on Runars. If you just revoked a key, wait ~5 seconds before expecting the old key to stop working.

See also

On this page