Unified SDK Guide: OpenAI Responses API, Anthropic Messages & Claude Code on One Gateway
Connect the modern OpenAI Responses SDK (/v1/responses), Anthropic SDK (/v1/messages), and CLI agents like Claude Code to Zopyr using a single API key.
1. Native Protocol Endpoints Without Client Wrappers
Modern AI engineering teams use a mix of SDKs: the OpenAI SDK (both Chat Completions and the 2026 Responses API), the official Anthropic SDK, and terminal agents such as Claude Code. Maintaining separate billing accounts and API keys for each tool fragments observability and security.
Zopyr natively implements /v1/chat/completions, /v1/responses, /v1/messages, /v1/embeddings, /v1/files, and /v1/realtime under one unified authentication and billing layer.
// 1. OpenAI Responses API (/v1/responses)
const res = await fetch('https://api.zopyr.com/v1/responses', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ZOPYR_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'openai/gpt-6.1-sol-pro',
instructions: 'Return concise architectural advice.',
input: 'When should we use Redis Streams over BullMQ?',
}),
});
// 2. Anthropic Messages API (/v1/messages) with x-api-key
const claudeRes = await fetch('https://api.zopyr.com/v1/messages', {
method: 'POST',
headers: {
'x-api-key': process.env.ZOPYR_API_KEY!,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'anthropic/claude-sonnet-5.5',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Review this Prisma schema.' }],
}),
});2. Configuring Claude Code & IDE Agents
Because Zopyr accepts both Authorization: Bearer and x-api-key headers on /v1/messages and translates streaming content_block_delta events natively, you can point Claude Code, Cursor, or Windsurf directly at Zopyr’s gateway URL.
Every tool call, token count, and cost is attributed to your organization key and appears immediately in your Zopyr Activity and Logs dashboard.