OpusGate forwards Anthropic Messages and OpenAI-compatible requests. Configure the base URL, key and model ID for your client. Supported parameters and response features depend on the chosen model and upstream service.
https://api.opusgate.dev for Anthropic-style clients (they add /v1/... themselves); https://api.opusgate.dev/v1 for OpenAI-style clients.Every request needs your sk-og-... key from the Keys page. Both standard header conventions are accepted — use whichever your SDK sends:
Authorization: Bearer sk-og-... # — or — x-api-key: sk-og-...
A missing key returns 401 {"error": "missing_api_key"}, an unknown or revoked one 401 {"error": "invalid_api_key"} — see error codes.
| Endpoint | Protocol | Purpose |
|---|---|---|
POST /v1/messages | Anthropic Messages | Chat / agent requests with Claude-native features (system, tools, thinking). Streaming via "stream": true. |
POST /v1/chat/completions | OpenAI Chat Completions | Same models through the OpenAI wire format — for OpenAI-SDK tools. Streaming supported. |
POST /v1/messages/count_tokens | Anthropic | Count request tokens when supported by the selected model. |
POST /v1/responses | OpenAI Responses | Responses-format requests. Keep conversation history in your client; upstream stored-response continuation is not supported. |
GET /v1/models | OpenAI-style | List of model IDs available to your key. Human-readable catalog with prices: models page. |
curl https://api.opusgate.dev/v1/messages \
-H "x-api-key: sk-og-..." \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 100,
"messages": [{"role": "user", "content": "Say hi"}]
}'curl https://api.opusgate.dev/v1/chat/completions \
-H "Authorization: Bearer sk-og-..." \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [{"role": "user", "content": "Say hi"}]
}'from anthropic import Anthropic
client = Anthropic(
base_url="https://api.opusgate.dev", # no /v1 — the SDK adds it
api_key="sk-og-...",
)import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
baseURL: 'https://api.opusgate.dev', // no /v1 — the SDK adds it
apiKey: 'sk-og-...',
});from openai import OpenAI
client = OpenAI(
base_url="https://api.opusgate.dev/v1", # /v1 required
api_key="sk-og-...",
)Set "stream": true in the body (or use your SDK's streaming call) — responses arrive as server-sent events for supported models. Handle interrupted streams as incomplete requests, and check their outcome before retrying. Gateway and upstream timeouts still apply (see rate limits).