# API Gateway

## One key for every model and tool your agents call.

An OpenRouter-style gateway built for agents: [models](/content/gateway/models/index.html) and [tools](/content/gateway/tools/index.html) behind one key, with the price in every response.

## One key for every model and tool

Text and media models plus agent tools behind a single AgentSky key, paid from one balance. No vendor accounts to open, no keys to rotate.

## Change the base URL, keep the SDK

Every wire is served as it is, paths included. Point the client you already use at the gateway and nothing else changes.

## Automatic failover

When a model can be served more than one way, the gateway moves on from whatever is unreachable or rate-limited before a byte of the reply is sent.

## The price in every response

Model calls carry usage.cost; media model and tool calls carry price.amount. You never reconcile a bill against a log to find out what a call cost.

## Featured models

Current per-token prices, using your plan when signed in.

### Claude Fable 5.1  
by Anthropic  
In / out per 1M  
Price: $10.00 / Price: $50.00  
Context 1M

### GPT-6 Luna  
by OpenAI  
In / out per 1M  
From Price: $0.1 / from Price: $0.5  
Context 1.1M

### Gemini 3.8 Flash  
by Google  
In / out per 1M  
Price: $0.75 / Price: $3.75  
Context 1M

## Featured tools

Search, maps, email, and SEO data, all through one run call.

### A  
List inboxes  
by AgentMail  
List the email inboxes on the account, newest first.  
Per call Price: —  
Provider AgentMail

### D  
Ai Keywords Search Volume  
by DataForSEO  
Run a ai keywords search volume report.  
Per call Price: —  
Provider DataForSEO

### E  
Text embeddings  
by Embedding  
Create vectors from text.  
Per token Price: —  
Provider Embedding

## Three steps to your first call.

1. **Get an API key**  
Sign in and create an ast_key under Settings. It works on every wire, model, and tool here.

2. **Add credits**  
One balance pays for models and tools alike, with per-call records you can read back.

3. **Point your SDK at the gateway**  
Change the base URL, keep the client, and read the price out of the response.

## Code Snippets

### Example code for Anthropic SDK
```javascript
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 response
```

### Example code for Claude Code
```
export ANTHROPIC_BASE_URL=https://gateway.agentsky.dev
export ANTHROPIC_AUTH_TOKEN=ast_…
claude
```

### Example code for Codex CLI
```
export OPENAI_BASE_URL=https://gateway.agentsky.dev/v1
export OPENAI_API_KEY=ast_…
codex
```

## Questions

### Which clients work?
### How is a call priced?
### What happens when an upstream is down?
### Is this the same as the AgentSky agent platform?

## Start with one key.
[Get an API key](/content/auth/sign-in?returnTo=%2Fsettings%3Ftab%3Dtokens/index.html)
