Authentication
Relay uses bearer API keys, exactly like the OpenAI API. Send your key in the Authorization header on every request.
API keys
- Create and revoke keys in your dashboard.
- Treat keys like passwords. Never commit them to source control or ship them in client-side code.
- Use separate keys per environment (dev / staging / prod) and rotate regularly.
Sending your key
curl https://api.relay.com/v1/chat/completions \
-H "Authorization: Bearer $RELAY_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Hello"}]}'
With the OpenAI SDKs
from openai import OpenAI
client = OpenAI(api_key="YOUR_RELAY_KEY", base_url="https://api.relay.com/v1")
Keep keys server-side. For browser apps, proxy requests through your own backend so the key is never exposed.