OpenAI Compatibility
Use Claude models with the OpenAI SDK — drop-in compatible API. Works with any tool that supports OpenAI format.
Base URL: https://api2.claudestore.store/v1. Endpoint: POST /chat/completions. API key: sk-cs2-*. Models: claude-opus-4.6, claude-sonnet-4.6, claude-haiku-4.5. Best for: Existing OpenAI SDKs and OpenAI-compatible tools.
When to Use This Route
- Use the OpenAI-compatible route if your app already uses the OpenAI SDK or Chat Completions payloads.
- Use the native
/v1/messagesroute if you want the most Claude-native behavior, cleaner troubleshooting, or direct Anthropic-style SDK integration. - For Cursor, Cline, Roo Code, Kilo Code, and similar OpenAI-style tools, this route is usually the right default.
Endpoint
POST https://api2.claudestore.store/v1/chat/completions
Authentication
Use the standard Authorization: Bearer header with your ClaudeStore API key:
curl https://api2.claudestore.store/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4.6",
"messages": [{"role": "user", "content": "Hello!"}]
}'Python (OpenAI SDK)
OpenAI SDK for Pythonpython
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api2.claudestore.store/v1"
)
response = client.chat.completions.create(
model="claude-sonnet-4.6",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is machine learning?"}
]
)
print(response.choices[0].message.content)When using the OpenAI SDK, set
base_url to https://api2.claudestore.store/v1 (with /v1).TypeScript (OpenAI SDK)
OpenAI SDK for TypeScripttypescript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_API_KEY",
baseURL: "https://api2.claudestore.store/v1",
});
const response = await client.chat.completions.create({
model: "claude-sonnet-4.6",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);Important Compatibility Notes
- Use
Authorization: Bearer YOUR_API_KEYand the/v1suffix. This route is not the same as the native Anthropic-format endpoint. - System and developer instructions may be treated as one combined top-level instruction rather than as fully independent turns.
- OpenAI-specific fields that are not part of Claude's native behavior may be ignored. Do not assume every OpenAI-only knob changes model behavior.
- For tool calling, you should not rely on strict schema guarantees just because your OpenAI client exposes a strict mode toggle.
- If a feature feels awkward to express through Chat Completions, switch to the native
/v1/messagesAPI instead of fighting the compatibility layer.
A practical rule: use OpenAI compatibility for migration and tooling convenience, and use the native Messages API when you want the cleanest Claude-specific integration path.