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:
| Dialect | Endpoint | Header | Example |
|---|---|---|---|
| Anthropic Messages API | https://api.runars.ca (root) | x-api-key | x-api-key: sk-runars-... |
| OpenAI Chat Completions | https://api.runars.ca/v1 | Authorization: Bearer | Authorization: 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-keyfor Anthropic,Authorization: Bearerfor 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
- Get Started — API Keys — How to create and manage keys
- Endpoints — Overview — Detailed reference for both dialects
- Errors — Full error reference including auth errors