API Gateway
One key for every model and tool your agents call.
The Anthropic and OpenAI wires, plus search, maps, email, speech, transcription, SEO data and image generation, behind gateway.agentsky.dev. Provider routing with failover, the price in every response, and no separate vendor accounts: an OpenRouter-style gateway built for agents.
- 41
- 32
- 18
- 2
Drop-in
Change the base URL. Keep the SDK.
The Anthropic SDK and Claude Code take the gateway host as their base URL; OpenAI clients take the host plus /v1. Model ids are vendor/model or the bare id you already use.
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://gateway.agentsky.dev",
apiKey: process.env.AGENTSKY_API_KEY, // ast_…
});
const message = await client.messages.create({
model: "anthropic/claude-sonnet-5",
max_tokens: 256,
messages: [{ role: "user", content: "Summarise this ticket." }],
});
console.log(message.usage.cost); // USD, in the responseOne key
Replace a drawer of vendor keys with one.
Every vendor behind the gateway is paid from your AgentSky balance. Rotate one key, budget one account, read one usage record.
# before
ANTHROPIC_API_KEY=sk-ant-…
OPENAI_API_KEY=sk-…
DEEPSEEK_API_KEY=…
EXA_API_KEY=…
ELEVENLABS_API_KEY=…
# after
AGENTSKY_API_KEY=ast_…Routing
Pick the provider, or let the gateway fail over.
A model can come from more than one provider. By default the gateway tries them in its preferred order and moves on when one is unreachable, rate-limited or failing, before a single byte of the reply has been sent. Prefer or restrict providers per request; the response always says who served it.
# any wire: a request header
x-agentsky-provider: socheap
# OpenAI wire: OpenRouter's body field also works
{ "model": "anthropic/claude-sonnet-5",
"provider": { "order": ["socheap"], "only": ["socheap"] },
... }
# every response
x-agentsky-provider: socheap
x-agentsky-provider-attempts: vertex:503,socheap:200Pricing
The price is in the response.
Model calls carry usage.cost; runs carry price.amount. Per-token and per-call prices below are the default plan, in USD; balances and per-call records come from /v1/credits and /v1/generation. Running agents on the AgentSky platform is priced separately on the pricing page.
| Model | Providers | Input / 1M tokens | Output / 1M tokens |
|---|---|---|---|
| anthropic/claude-fable-5 | socheap | $10.00 | $50.00 |
| anthropic/claude-haiku-4-5 | socheap | $2.00 | $10.00 |
| anthropic/claude-opus-4-8 | socheap | $10.00 | $50.00 |
| anthropic/claude-opus-5 | socheap | $5.00 | $25.00 |
| anthropic/claude-sonnet-4-6 | socheap | $6.00 | $30.00 |
| anthropic/claude-sonnet-5 | socheap | $4.00 | $20.00 |
| deepseek/deepseek-chat | deepseek | $0.2968 | $0.5936 |
| deepseek/deepseek-reasoner | deepseek | $0.2968 | $0.5936 |
| deepseek/deepseek-v4-flash | deepseek | $0.88 | $2.64 |
| deepseek/deepseek-v4-pro | deepseek | $2.64 | $7.92 |
| google/gemini-3-flash-preview | $1.00 | $6.00 | |
| google/gemini-3.5-flash | $1.00 | $6.00 | |
| moonshotai/kimi-k2.6 | moonshot | $1.90 | $8.00 |
| moonshotai/kimi-k2.7-code | moonshot | $1.90 | $8.00 |
| moonshotai/kimi-k2.7-code-highspeed | moonshot | $3.80 | $16.00 |
| moonshotai/kimi-k3 | moonshot | $6.00 | $30.00 |
| openai/gpt-4.1 | socheap | $4.00 | $16.00 |
| openai/gpt-5.4 | socheap | $5.00 | $30.00 |
| openai/gpt-5.5 | socheap | $5.00 | $30.00 |
| openai/gpt-5.6-luna | socheap | $0.2 | $1.20 |
| openai/gpt-5.6-sol | socheap | $5.00 | $30.00 |
| openai/gpt-5.6-terra | socheap | $2.00 | $12.00 |
| qwen/qwen-coder-plus | dashscope | $1.00 | $2.01 |
| qwen/qwen-flash | dashscope | $0.264 | $2.12 |
| qwen/qwen-max | dashscope | $6.34 | $31.60 |
| qwen/qwen-plus | dashscope | $2.12 | $6.34 |
| qwen/qwen-vl-max | dashscope | $1.60 | $6.40 |
| qwen/qwen-vl-plus | dashscope | $0.42 | $1.26 |
| qwen/qwen3-coder-flash | dashscope | $0.6 | $3.00 |
| qwen/qwen3-coder-plus | dashscope | $2.00 | $10.00 |
| qwen/qwen3.5-flash | dashscope | $0.2 | $0.8 |
| qwen/qwen3.7-max | dashscope | $5.00 | $15.00 |
| xai/grok-4.6 | xai | $2.00 | $6.00 |
| zai/glm-4.5-air | zai | $0.4 | $2.20 |
| zai/glm-4.5v | zai | $1.20 | $3.60 |
| zai/glm-4.7 | zai | $1.20 | $4.40 |
| zai/glm-5 | zai | $2.00 | $6.40 |
| zai/glm-5-turbo | zai | $2.40 | $8.00 |
| zai/glm-5.1 | zai | $2.80 | $8.80 |
| zai/glm-5.2 | zai | $2.80 | $8.80 |
| zai/glm-5.3 | zai | $1.40 | $4.40 |
Agents
Works with the agents you already run.
Any agent that accepts an Anthropic-compatible or OpenAI-compatible base URL runs through the gateway. These two are verified end to end.
export ANTHROPIC_BASE_URL=https://gateway.agentsky.dev
export ANTHROPIC_AUTH_TOKEN=ast_…
claudeexport OPENAI_BASE_URL=https://gateway.agentsky.dev/v1
export OPENAI_API_KEY=ast_…
codexQuickstart
Three steps.
- Create a key
Sign in and create an API key with write scope. Top up your balance; the same balance pays for agents and gateway calls.
- Point a client at the gateway
Set the base URL and key in your SDK or agent. Nothing else in your code changes.
- Read the price
Each response carries its cost. Use /v1/generation for a per-call record and /v1/credits for your balance.
Common questions
