Osiris Docs

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.

1

Create an account

Sign up at osiris-code.com with email or Google. Gmail accounts get a free trial.

2

Get your API key

Go to your Dashboard and create a key. Keys start with sk-osiris-.

3

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_KEY

Or using the Anthropic-style header (used by Claude Code and the Anthropic SDK):

x-api-key: sk-osiris-YOUR_KEY

Key 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

TypeDescription
CreditPay-per-use. Balance in USD, charged per request based on token usage.
TimeDuration-based. Unlimited usage within the time window, with optional quota.
Trial3-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.

ModelInput $/1MOutput $/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

POST/v1/chat/completions

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

POST/v1/messages

Compatible with the Anthropic Messages API. Used by Claude Code, the Anthropic SDK, and tools that target Claude directly.

Note: The 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

POST/v1/responses

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

EventDescription
response.createdResponse object created
response.output_text.deltaText chunk generated
response.output_text.doneFull text assembled
response.completedResponse complete with usage data

Streaming

Set "stream": true to receive Server-Sent Events (SSE). Supported on all three API formats.

OpenAI SSE Format

Chat Completions stream
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

Messages stream
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

Python (OpenAI SDK)
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:

~/.claude/settings.json
{
  "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.

Osiris supports both 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:

~/.config/opencode/opencode.json
{
  "$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:

~/.openclaw/openclaw.json
{
  "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.

  1. Install Kilo Code from the VSCode Extensions Marketplace
  2. Open Kilo Code settings (gear icon in the Kilo Code panel)
  3. Click Add Custom Provider
  4. Enter Base URL: https://ai.osiris-code.com/v1
  5. Enter API Key: sk-osiris-YOUR_KEY
  6. Select a model and start coding

Zed

High-performance code editor with built-in AI assistant.

  1. Open Agent Panel settings: Cmd+Shift+C (Mac) or Alt+Shift+C (Linux)
  2. Click Add Provider next to "LLM Providers"
  3. Select OpenAI API Compatible
  4. Enter Provider Name: Osiris
  5. Enter Base URL: https://ai.osiris-code.com/v1
  6. Enter API Key: sk-osiris-YOUR_KEY
  7. 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:

Terminal
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.6

Or add directly to your config file:

~/.hermes/config.yaml
# ~/.hermes/config.yaml
model:
  default: claude-opus-4.6
  provider: custom
  base_url: https://ai.osiris-code.com/v1
  api_key: sk-osiris-YOUR_KEY

Billing

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.

Cost calculation example
# 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.100

Payment Methods

MethodDetails
QRISGoPay, OVO, Dana, ShopeePay — scan QR code, valid 30 minutes
CryptoBTC, 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

LimitValueScope
API requests40 req/minPer API key
Concurrent requests20Per API key
Max request body10 MBAll endpoints
Request timeout120 secondsNon-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

CodeMeaningWhat to do
400Bad RequestInvalid JSON, missing fields, or unknown model.
401UnauthorizedMissing or invalid API key.
402Payment RequiredBalance is $0 or expired. Top up.
403ForbiddenModel not allowed for this key.
429Rate LimitedWait and retry. Check Retry-After header.
502Bad GatewayUpstream provider error. Retry or try a different model.

Error response format: {"error":{"type":"...","message":"..."}}

Need higher limits? Contact us on Telegram.