Skip to content

Quickstart

This guide takes you from a fresh account to your first billed request.

  1. Create an account at oxyrouter.in/register.
  2. Open API keys in the dashboard and create a key.
  3. Copy the secret immediately. It starts with oxy_sk_ and is shown only once.

The key inherits all three scopes by default: inference:read, inference:write, and usage:read. See Authentication for scope details and least-privilege guidance.

Terminal window
export OXYROUTER_API_KEY="oxy_sk_..."

All inference requests use this header:

Authorization: Bearer oxy_sk_...
Terminal window
curl https://api.oxyrouter.in/v1/models \
-H "Authorization: Bearer $OXYROUTER_API_KEY"
{
"object": "list",
"data": [
{
"id": "gpt-4o-mini",
"object": "model",
"created": 1735689600,
"owned_by": "oxyrouter"
}
]
}

The model IDs returned here are the only IDs you should send. OxyRouter keeps upstream provider routing private and resolves it internally.

Terminal window
curl https://api.oxyrouter.in/v1/chat/completions \
-H "Authorization: Bearer $OXYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "user", "content": "Say hello in one short sentence."}
]
}'

A successful response looks like this:

{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1735689600,
"model": "gpt-4o-mini",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 8,
"total_tokens": 22
}
}

The model field always echoes the public OxyRouter model ID you requested.

Set stream to true to receive server-sent events:

Terminal window
curl https://api.oxyrouter.in/v1/chat/completions \
-H "Authorization: Bearer $OXYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Count to five."}],
"stream": true
}'
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"One"}}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":", two"}}]}
data: [DONE]

Every request is metered from provider-reported token usage and charged to your prepaid INR wallet. Open Usage and Billing & wallet in the dashboard to review spend, top up, and set daily or monthly caps.