Skip to main content
The gateway speaks the protocols you already use: the OpenAI, Anthropic, and Google AI APIs, with messages, tools, and multi-turn conversation working exactly as they do natively. If you already use one of those SDKs, keep it. Point it at Opper and swap the API key for an Opper one, and every call now flows through the gateway. You get 300+ models, fallback routing, traces, and organization Rules without rewriting anything. The TypeSafe SDKs also work with the gateway for classification and scoring. See TypeSafe SDKs below for setup, or Classification & scoring for question types and HTTP examples.

Setup

For the OpenAI, Anthropic, and Google AI SDKs the change is the same:
  1. Set the base URL to https://api.opper.ai/v3/compat
  2. Pass your Opper API key as the SDK’s normal api_key
Opper reads the key from Authorization: Bearer, which is what the OpenAI SDK sends. On the routes that serve a vendor’s own protocol it reads that protocol’s header too — x-api-key on the Anthropic Messages endpoints, x-goog-api-key on the Google ones. So all three SDKs authenticate with nothing but their normal api_key.

SDK examples

Works with chat.completions.create, embeddings.create, and responses.create.

TypeSafe SDKs

Keep the TypeSafe SDK, set its base URL to https://api.opper.ai/v3/compat, and use your Opper API key. The SDK sends its native state and questions format to /v1/systemone and returns typed answers with probabilities and confidence. Install typesafe-sdk for Python or @typesafe-ai/sdk for TypeScript:
A paid plan is required. TypeSafe evaluation models use the System One protocol; use the TypeSafe SDK for these models. See Classification & scoring for noul, choice, and score, supported model aliases, and gateway limits.

Cross-vendor models

For generation models, the model field is provider-prefixed: openai/gpt-5.5, anthropic/claude-sonnet-4-6, gemini/gemini-2.5-pro. You can call these generation models from the OpenAI, Anthropic, or Google AI SDK. Your code calling client.messages.create(...) with the Anthropic SDK can still talk to a Google model.
Browse the full catalog on the Models page.

Opper extras

For generation requests, the OpenAI, Anthropic, and Google AI SDKs let you send Opper-specific options through an extras field. Use them to attach tags for filtering traces, link a call to a parent span, or skip automatic scoring. TypeSafe System One requests accept only model, state, and questions; the extras below are unsupported on that endpoint.
Python with extras
Per-request fallbacks: models, on chat completions only. The Chat Completions endpoint reads the same models array OpenRouter does: the primary in model, the rest in models, tried in order when the one before fails for any reason. Omit model and the first entry is the primary. A compliance rule that blocks an entry removes it from the chain without an error. Which model answered is in meta.routing.served and the X-Opper-Served-Model header; the response model echoes what you sent.
The other endpoints on this page do not read models or fallback_models. For a chain you manage in one place, with ranking, versions and rollback, build a dynamic route for generation models and call its name as model from the OpenAI, Anthropic, or Google AI SDK on supported generation endpoints.
To attribute usage and cost per customer or team — not just label traces — send tags with the X-Opper-Tags header instead, then group spend by tag in analytics. See Tags & usage attribution.

All the URLs

You usually don’t need this. Your SDK appends the right path. For reference:

Hostnames: global and EU

The same gateway is reachable on three hostnames. All of them take the same auth and serve the same models. The gw hosts also serve the vendor paths at cleaner base URLs, so SDK config gets shorter:
POST https://gw.opper.ai/chat/completions and POST https://gw.opper.ai/v1/messages also work at the bare root, for tools that take only a hostname and no path.

Frameworks

Vercel AI SDK

Use Opper’s native provider for streamText and generateObject. No compat layer needed.

LangChain / LlamaIndex

Point them at the /v3/compat base URL.

What’s next

Tool calling

Let the model invoke your tools.

Vision & PDFs

Send images and documents in messages.

Streaming

Stream the response token-by-token.

Structured output

Get JSON back, validated against a schema.