Authentication
KushRouter authenticates requests using your API key. Provide the key via the appropriate header depending on the provider family.
Headers
- OpenAI-compatible routes:
Authorization: Bearer <API_KEY> - Anthropic-compatible routes:
x-api-key: <API_KEY>orAuthorization: Bearer <API_KEY>
cURL examples
OpenAI-compatible streaming:
curl -N -X POST "https://api.kushrouter.com/api/openai/v1/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5-mini-2025-08-07",
"messages": [{"role":"user","content":"Hello"}],
"stream": true
}'Anthropic-compatible streaming:
curl -N -X POST "https://api.kushrouter.com/api/anthropic/v1/messages" \
-H "x-api-key: $API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"messages": [{"role":"user","content":[{"type":"text","text":"Hello"}]}],
"max_tokens": 256,
"stream": true
}'Notes
- Ensure
streamis a boolean (true/false), not a string. Otherwise the server returns 400. - On validation errors, the response includes a descriptive error message.