Cross‑surface model compatibility
KushRouter lets you use models across either API surface:
- Use OpenAI models via the Anthropic Messages API
- Use Claude models via the OpenAI‑compatible Chat Completions or Responses API
This is helpful when you prefer a specific event shape (OpenAI or Anthropic), but want to try a model from the other provider. The request body must always follow the target surface’s syntax.
OpenAI model via Anthropic Messages
import Anthropic from '@anthropic-ai/sdk';
const anthropic = new Anthropic({
apiKey: process.env.KUSHROUTER_API_KEY!,
baseURL: 'https://api.kushrouter.com/api/anthropic/v1',
});
const r = await anthropic.messages.create({
model: 'gpt-5-mini-2025-08-07',
max_tokens: 256,
messages: [{ role: 'user', content: 'Summarize queue backpressure in one line.' }],
stream: true,
});
for await (const e of r) {
if (e.type === 'content_block_delta' && e.delta?.type === 'text_delta') {
process.stdout.write(e.delta.text);
}
}Claude model via OpenAI Chat Completions
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: process.env.KUSHROUTER_API_KEY!,
baseURL: 'https://api.kushrouter.com/api/openai/v1',
});
const stream = await openai.chat.completions.create({
model: 'claude-sonnet-4-5-20250929',
messages: [
{ role: 'system', content: 'Be concise.' },
{ role: 'user', content: 'List two ways to reduce API latency.' },
],
stream: true,
});
for await (const chunk of stream) {
const d = chunk.choices?.[0]?.delta?.content;
if (d) process.stdout.write(d);
}Parameter-feature matrix (abridged)
- The surface you call determines accepted parameters; incompatible combinations are rejected with HTTP 400.
- For vision inputs, use OpenAI content parts (
image_url) or Anthropicimageblocks respectively.
JSON schema strict mapping (Anthropic via OpenAI Responses)
When you call an Anthropic model through the OpenAI Responses API with response_format.type = "json_schema", the router can synthesize an Anthropic tool with input_schema equal to your schema and (when strict: true) force selection of that tool.