# AtmoRouter — SDKs & agents

Source: https://atmorouter.dev/docs/sdks

Install the SDK for your selected protocol, choose an enabled model from the catalog, and keep your AtmoRouter key in `ATMOROUTER_API_KEY`. Do not put a real secret in source control.

```
python -m pip install openai anthropic\n# JavaScript projects:\nnpm install openai @anthropic-ai/sdk
```

## OpenAI Python

```
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["ATMOROUTER_API_KEY"],
    base_url="https://atmorouter.dev/v1",
)
response = client.chat.completions.create(
    model="cbcn/glm-5.3",
    max_tokens=128,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response)
```

## OpenAI JavaScript

```
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.ATMOROUTER_API_KEY,
  baseURL: "https://atmorouter.dev/v1",
});
const response = await client.chat.completions.create({
  "model": "cbcn/glm-5.3",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ],
  "max_tokens": 128
});
console.log(response);
```

## Anthropic Python

```
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["ATMOROUTER_API_KEY"],
    base_url="https://atmorouter.dev",
)
response = client.messages.create(
    model="cbcn/glm-5.3",
    max_tokens=128,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response)
```

## Claude Code

Set the bare host as the Anthropic base URL and select a model suited to the agent’s tool-use requirements. Restart the agent after changing its environment.

```
export ANTHROPIC_BASE_URL="https://atmorouter.dev"
export ANTHROPIC_AUTH_TOKEN="$ATMOROUTER_API_KEY"
export ANTHROPIC_MODEL="YOUR_MODEL_ID"
claude
```

## OpenCode

Use the Chat Completions adapter and an environment reference for the secret:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "atmorouter": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "AtmoRouter",
      "options": {
        "baseURL": "https://atmorouter.dev/v1",
        "apiKey": "{env:ATMOROUTER_API_KEY}"
      },
      "models": {
        "YOUR_MODEL_ID": {
          "name": "YOUR_MODEL_ID"
        }
      }
    }
  },
  "model": "atmorouter/YOUR_MODEL_ID"
}
```

[The setup helper](https://atmorouter.dev/docs/helper) generates these settings with backups. See [Compatibility](https://atmorouter.dev/docs/compatibility) before configuring a Responses-based client. Agent versions and model capabilities can change independently of the gateway.

## Upstream client references

- [OpenAI Chat Completions reference](https://developers.openai.com/api/reference/python/resources/chat/subresources/completions/methods/create)
- [Claude Code gateway documentation](https://code.claude.com/docs/en/llm-gateway)
- [OpenCode custom providers](https://opencode.ai/docs/providers/)
