Documentation
Osiris API Reference
Getting Started
Osiris is a unified AI API gateway. One API key gives you access to models from Anthropic, OpenAI, Google, DeepSeek, and more. Compatible with the OpenAI SDK — just change the base URL.
Create an account
Sign up at osiris-code.com with email or Google. Gmail accounts get a free trial.
Get your API key
Go to your Dashboard and create a key. Keys start with sk-osiris-.
Make your first request
Use any OpenAI-compatible client. Just change the base URL and API key:
curl https://ai.osiris-code.com/v1/chat/completions \
-H "Authorization: Bearer sk-osiris-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4.6",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 1024
}'API Keys
All API requests require an API key. You can send it in either format:
Authorization: Bearer sk-osiris-YOUR_KEYOr using the Anthropic-style header (used by Claude Code and the Anthropic SDK):
x-api-key: sk-osiris-YOUR_KEYKey format: sk-osiris-{32 hex chars}
Generate keys from your Dashboard — up to 10 keys per account.
Keys are shown only once at creation. Copy immediately.
Each key has its own balance, usage tracking, and rate limit.
Key Types
| Type | Description |
|---|---|
| Credit | Pay-per-use. Balance in USD, charged per request based on token usage. |
| Time | Duration-based. Unlimited usage within the time window, with optional quota. |
| Trial | 3-day expiry, 15 req/min. Gmail accounts only, one per account. |
Every response includes an X-Request-ID header (auto-generated UUID, or send your own for tracing).
Models
Available models and pricing. Use GET /v1/models for the live list with your API key.
| Model | Input $/1M | Output $/1M |
|---|---|---|
Model aliases are supported — dashes and dots are interchangeable. For example, claude-opus-4-6 resolves to claude-opus-4.6. Models may be added or removed at any time.
OpenAI Format
Compatible with the OpenAI Chat Completions API. Works with the OpenAI SDK, LangChain, and most AI tools.
Request
curl https://ai.osiris-code.com/v1/chat/completions \
-H "Authorization: Bearer sk-osiris-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4.6",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 1024
}'Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1712678400,
"model": "claude-opus-4.6",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 9,
"total_tokens": 21
}
}Anthropic Format
Compatible with the Anthropic Messages API. Used by Claude Code, the Anthropic SDK, and tools that target Claude directly.
anthropic-version: 2023-06-01 header is recommended. max_tokens is required (unlike OpenAI format). Both x-api-key and Authorization: Bearer are accepted.Request
curl https://ai.osiris-code.com/v1/messages \
-H "x-api-key: sk-osiris-YOUR_KEY" \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-opus-4.6",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'Response
{
"id": "msg_abc123",
"type": "message",
"role": "assistant",
"model": "claude-opus-4.6",
"content": [{
"type": "text",
"text": "Hello! How can I help you today?"
}],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 12,
"output_tokens": 9
}
}Responses API
OpenAI's newer agent-oriented format. Used by the OpenAI Agents SDK and Codex CLI. Input can be a plain string or a multi-turn conversation array.
Request
curl https://ai.osiris-code.com/v1/responses \
-H "Authorization: Bearer sk-osiris-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4.6",
"input": "What is the capital of France?"
}'Response
{
"id": "resp_abc123",
"object": "response",
"status": "completed",
"model": "claude-opus-4.6",
"output": [{
"type": "message",
"role": "assistant",
"content": [{
"type": "output_text",
"text": "The capital of France is Paris."
}]
}],
"usage": {
"input_tokens": 12,
"output_tokens": 8,
"total_tokens": 20
}
}SSE Event Types
| Event | Description |
|---|---|
| response.created | Response object created |
| response.output_text.delta | Text chunk generated |
| response.output_text.done | Full text assembled |
| response.completed | Response complete with usage data |
Streaming
Set "stream": true to receive Server-Sent Events (SSE). Supported on all three API formats.
OpenAI SSE Format
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]Stream ends with data: [DONE].
Anthropic SSE Format
event: message_start
data: {"type":"message_start","message":{"id":"msg_abc","type":"message","role":"assistant","model":"claude-opus-4.6","content":[],"stop_reason":null,"usage":{"input_tokens":12,"output_tokens":0}}}
event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello!"}}
event: content_block_stop
data: {"type":"content_block_stop","index":0}
event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":2}}
event: message_stop
data: {"type":"message_stop"}Events: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop.
Streaming Example
from openai import OpenAI
client = OpenAI(
api_key="sk-osiris-YOUR_KEY",
base_url="https://ai.osiris-code.com/v1"
)
stream = client.chat.completions.create(
model="claude-opus-4.6",
messages=[{"role": "user", "content": "Hello!"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")Claude Code
Anthropic's AI coding CLI. Add the following to your settings file:
{
"env": {
"ANTHROPIC_API_KEY": "sk-osiris-YOUR_KEY",
"ANTHROPIC_BASE_URL": "https://ai.osiris-code.com",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}Replace sk-osiris-YOUR_KEY with your API key. Then run claude to start.
x-api-key and Authorization: Bearerheaders. Claude Code works out of the box — no proxy or header rewriting needed.OpenCode
Open-source AI coding assistant. Add Osiris as a custom provider:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"osiris": {
"npm": "@ai-sdk/openai-compatible",
"name": "Osiris",
"options": {
"baseURL": "https://ai.osiris-code.com/v1",
"apiKey": "sk-osiris-YOUR_KEY"
},
"models": {
"claude-opus-4.6": {
"name": "Claude Opus 4.6",
"limit": { "context": 200000, "output": 64000 }
}
}
}
},
"model": "osiris/claude-opus-4.6"
}Add more models to the models object as needed.
OpenClaw
AI coding agent with multi-provider support:
{
"agents": {
"defaults": {
"model": { "primary": "osiris/claude-opus-4.6" }
}
},
"models": {
"providers": {
"osiris": {
"api": "openai-completions",
"apiKey": "sk-osiris-YOUR_KEY",
"baseUrl": "https://ai.osiris-code.com/v1",
"models": [
{
"id": "claude-opus-4.6",
"name": "Claude Opus 4.6",
"contextWindow": 200000,
"maxTokens": 64000,
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
}
]
}
}
}
}Kilo Code (VSCode)
AI coding assistant for Visual Studio Code.
- Install Kilo Code from the VSCode Extensions Marketplace
- Open Kilo Code settings (gear icon in the Kilo Code panel)
- Click Add Custom Provider
- Enter Base URL:
https://ai.osiris-code.com/v1 - Enter API Key:
sk-osiris-YOUR_KEY - Select a model and start coding
Zed
High-performance code editor with built-in AI assistant.
- Open Agent Panel settings:
Cmd+Shift+C(Mac) orAlt+Shift+C(Linux) - Click Add Provider next to "LLM Providers"
- Select OpenAI API Compatible
- Enter Provider Name:
Osiris - Enter Base URL:
https://ai.osiris-code.com/v1 - Enter API Key:
sk-osiris-YOUR_KEY - Add a model (e.g.
claude-opus-4.6) and select it from the dropdown
API key is stored in your OS keychain, not in the settings file.
Hermes Agent
Self-improving AI agent by Nous Research. Set up via the interactive wizard:
hermes model
# Select "Custom endpoint (self-hosted / VLLM / etc.)"
# Enter URL: https://ai.osiris-code.com/v1
# Enter API key: sk-osiris-YOUR_KEY
# Enter model: claude-opus-4.6Or add directly to your config file:
# ~/.hermes/config.yaml
model:
default: claude-opus-4.6
provider: custom
base_url: https://ai.osiris-code.com/v1
api_key: sk-osiris-YOUR_KEYBilling
Osiris uses post-charge billing: balance is checked before each request, actual cost is deducted after the response completes.
cost = (input_tokens / 1M × input_price) + (output_tokens / 1M × output_price)Minimum charge: $0.001 per request. Failed requests are not charged.
# Example: claude-opus-4.6
# Input: $5.00/1M tokens, Output: $25.00/1M tokens
Input tokens: 10,000
Output tokens: 2,000
Cost = (10,000 / 1,000,000 x $5.00) + (2,000 / 1,000,000 x $25.00)
= $0.050 + $0.050
= $0.100Payment Methods
| Method | Details |
|---|---|
| QRIS | GoPay, OVO, Dana, ShopeePay — scan QR code, valid 30 minutes |
| Crypto | BTC, USDT, ETH, 350+ coins — minimum $20 USD |
Credit Expiry
Each purchase extends your balance expiry by 1 month (max 3 months from today). Expired credits are forfeited. Top up before expiry to keep your balance active.
Free Trial
3-day expiry, @gmail.com only, one per account. Claim from your Dashboard after signing in.
Limits & Errors
Rate Limits
| Limit | Value | Scope |
|---|---|---|
| API requests | 40 req/min | Per API key |
| Concurrent requests | 20 | Per API key |
| Max request body | 10 MB | All endpoints |
| Request timeout | 120 seconds | Non-streaming |
Default limits shown above. Paid packages may have different RPM and concurrency limits. Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Error Codes
| Code | Meaning | What to do |
|---|---|---|
400 | Bad Request | Invalid JSON, missing fields, or unknown model. |
401 | Unauthorized | Missing or invalid API key. |
402 | Payment Required | Balance is $0 or expired. Top up. |
403 | Forbidden | Model not allowed for this key. |
429 | Rate Limited | Wait and retry. Check Retry-After header. |
502 | Bad Gateway | Upstream provider error. Retry or try a different model. |
Error response format: {"error":{"type":"...","message":"..."}}