Popular SDKs
Use the official SDKs and point their base URLs at KushRouter. Your API key is the same across providers.
Base URL:
https://api.kushrouter.com
- OpenAI-compatible routes live under
/api/openai- Anthropic-compatible routes live under
/api/anthropic
OpenAI (Node.js / TypeScript)
Install:
npm install openaiClient setup and basic chat:
import OpenAI from 'openai'
const client = new OpenAI({
apiKey: process.env.KUSHROUTER_API_KEY!,
baseURL: 'https://api.kushrouter.com/api/openai'
})
const result = await client.chat.completions.create({
model: 'gpt-5-mini-2025-08-07',
messages: [{ role: 'user', content: 'Hello from KushRouter!' }]
})Anthropic (JavaScript)
Install:
npm install @anthropic-ai/sdkClient setup and basic message:
import Anthropic from '@anthropic-ai/sdk'
const client = new Anthropic({
apiKey: process.env.KUSHROUTER_API_KEY!,
baseURL: 'https://api.kushrouter.com/api/anthropic'
})
const result = await client.messages.create({
model: 'claude-sonnet-4-5-20250929',
max_tokens: 300,
messages: [{ role: 'user', content: 'Summarise KushRouter benefits.' }]
})Vercel AI SDK (React/TypeScript)
Install:
npm install ai react@latestClient configuration:
import { createOpenAI } from 'ai'
export const openai = createOpenAI({
apiKey: process.env.KUSHROUTER_API_KEY!,
baseURL: 'https://api.kushrouter.com/api/openai'
})Python openai package
Install:
pip install openaiClient and basic chat:
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ['KUSHROUTER_API_KEY'],
base_url='https://api.kushrouter.com/api/openai'
)
response = client.chat.completions.create(
model='gpt-5-mini-2025-08-07',
messages=[{'role': 'user', 'content': 'Generate a product description.'}]
)Looking for more? See the full SDK Examples page.
- See: SDK Examples