Call Claude Opus, Sonnet and Haiku with the OpenAI SDK
Use Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5 from the OpenAI SDKs in Python and Node.js. One prepaid key, images, tool calls, streaming and thinking.

Claude is usually called through Anthropic's own API and SDK. Through API Store you can call it the same way you call DeepSeek, GPT or Gemini: with an OpenAI Chat Completions request and the official OpenAI SDK. You change two settings, the base URL and the API key, and send a Claude model name. If your code already works with OpenAI, it works with Claude.
Before you start
- Create an account and add credit on the Billing page. Billing is prepaid: there is no subscription and no monthly minimum.
- Create a key on the API keys page. It starts with
sk-, and it works for every model on the site, Claude included.
Python
pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://api.apistore.cloud/v1",
api_key="sk-...",
)
reply = client.chat.completions.create(
model="claude-sonnet-5-5",
messages=[
{"role": "system", "content": "You answer in two sentences."},
{"role": "user", "content": "What does a reverse proxy do?"},
],
)
print(reply.choices[0].message.content)Node.js
npm install openai
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.apistore.cloud/v1',
apiKey: process.env.APISTORE_KEY,
});
const reply = await client.chat.completions.create({
model: 'claude-sonnet-5-5',
messages: [{ role: 'user', content: 'What does a reverse proxy do?' }],
});
console.log(reply.choices[0].message.content);Which Claude model name
| Model | Send as | Input / output per 1M tokens |
|---|---|---|
| Claude Opus 5.5 | claude-opus-5-5 | $2.8 / $14 |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | $1.4 / $7 |
| Claude Haiku 5.5 | claude-haiku-5-5 | $0.07 / $0.35 |
| Claude Fable 5.1 | claude-fable-5-1 | $7 / $35 |
Older versions, such as claude-opus-4-8 and claude-sonnet-4-6, are still on sale for code that was tested against them. Every Claude model here has a 200,000-token context window. Choosing a Claude model compares them.
What works as you expect
The request is OpenAI's, and the answer comes back in OpenAI's shape, so the parts of the SDK you already use keep working:
- Streaming. Pass
stream=True(Python) orstream: true(Node.js) and read the chunks as usual. - Images. Send an
image_urlpart in a user message, as a link or adata:URL, and Claude reads it. - Tool calls. Define
toolsas OpenAI functions. Claude's calls come back inmessage.tool_calls, and you answer them withrole: "tool"messages. - Thinking. Set
reasoning_efforttolow,mediumorhighto let Claude think longer before it answers. Its thinking comes back inreasoning_content, and thinking tokens are billed as output.
reply = client.chat.completions.create(
model="claude-opus-5-5",
reasoning_effort="high",
messages=[{"role": "user", "content": "Find the bug: def avg(xs): return sum(xs) / len(xs) - 1"}],
)
print(reply.choices[0].message.content)What a request costs
You pay per token, at the prices on the model's page and the pricing page. The response's usage field says how many tokens were read and written, and the Usage page shows the cost of every request.
Haiku 5.5 has one rule to know: a request whose prompt is longer than 100,000 tokens is billed at its long-prompt prices, for the whole request. The model page lists them. Keep long documents under that size, or split them, if the cost matters.
Common errors
- 401 invalid_api_key: the key was mistyped or revoked.
- 404 model_not_found: check the model name. Claude names here use dashes, as in
claude-sonnet-5-5. - 402 insufficient_balance: add credit on the Billing page. The error says how much the request needed.
- 429: you are sending faster than the key's limit. See when to retry.
The same key also calls GPT, Gemini and DeepSeek. To change model, you change one string.
Also in Tiếng Việt, Español, Português, Bahasa Indonesia


