How to call Claude Opus 5.5 with the OpenAI SDK
Use Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5 from code that already speaks the OpenAI API — or switch to the native Anthropic Messages API with one line.
12 de out. de 2026 · API ManyMost teams already have code written against the OpenAI chat completions API. Moving a feature to Claude usually means a second SDK, a second key and a second bill. With API Many you keep the OpenAI client, change the base URL once and call Claude by its model id.
1. Point the OpenAI client at API Many
from openai import OpenAI
client = OpenAI(base_url="https://apimany.com/v1", api_key="YOUR_API_KEY")
reply = client.chat.completions.create(
model="claude-opus-5-5",
messages=[
{"role": "system", "content": "You are a precise code reviewer."},
{"role": "user", "content": "Review this function for race conditions: ..."},
],
)
print(reply.choices[0].message.content)Streaming, tool calls and image inputs use the same request shapes you already know. When you stream, the final chunk carries a usage object, which is also what we bill.
2. Or use the native Messages API
Features such as extended thinking, prompt caching breakpoints and Anthropic-style tool use are easiest through the Messages API. API Many serves it at /v1/messages, so the official Anthropic SDK works with only a base URL change:
import Anthropic from '@anthropic-ai/sdk'
const client = new Anthropic({ baseURL: 'https://apimany.com', apiKey: process.env.APIMANY_API_KEY })
const message = await client.messages.create({
model: 'claude-sonnet-5-5',
max_tokens: 2048,
messages: [{ role: 'user', content: 'Draft a migration plan from REST to gRPC.' }],
})
console.log(message.content)3. Pick the right Claude for the job
- Opus 5.5 for hard reasoning, long agentic runs and code review where quality matters more than latency.
- Sonnet 5.5 as the default for product features: strong quality at a fraction of the Opus price.
- Haiku 5.5 for classification, extraction, routing and anything that runs thousands of times a minute.
What you pay
Claude Opus 5.5 costs $3.52 entrada · $17.60 saída on API Many, and cached input tokens are billed at the lower cached rate. You top up once and the same balance pays for every other model, so trying Gemini or GPT for the same prompt is a one-string change.
Todos os modelos deste post estão na API Many. Pague pelo uso a partir de US$ 10.