Quickstart
Move from an existing OpenAI SDK to NextModel in three edits: base_url, API key, and model ID.
Code first
Python, Node, and curl examples use the same OpenAI-compatible endpoint.
What does the quickstart change?
A NextModel migration usually changes three values: the SDK base URL, the API key, and the model ID. The request shape stays OpenAI-compatible so UK teams can compare model cost, quality, and provider fit before changing application code more deeply.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.nextmodel.app/v1"
)
resp = client.chat.completions.create(
model="doubao-seed-2-0-mini",
messages=[{"role": "user", "content": "Hello from NextModel"}]
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NEXTMODEL_API_KEY,
baseURL: "https://api.nextmodel.app/v1",
});
const response = await client.chat.completions.create({
model: "doubao-seed-2-0-mini",
messages: [{ role: "user", content: "Hello from NextModel" }],
});
console.log(response.choices[0].message.content);curl https://api.nextmodel.app/v1/chat/completions \
-H "Authorization: Bearer $NEXTMODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seed-2-0-mini",
"messages": [{"role": "user", "content": "Hello from NextModel"}]
}'Docs index
Every core integration page in one place.
Quickstart
Connect an existing OpenAI SDK to NextModel in minutes, then compare providers and keep AI spend visible before UK production traffic grows.
Authentication
Use Bearer tokens, project-scoped keys, and budget-aware key management for AI API calls.
Chat completions
Call chat models through one OpenAI-compatible request shape.
Streaming
Understand streaming capability labels before using a model in production.
Models
Fetch model prices, capabilities, source labels, context length, and recommended use cases.
Errors
Common HTTP error categories for gateway and provider troubleshooting.
Billing
Estimate model cost and reconcile usage across projects and keys with UK-ready spend visibility.
OpenAI migration
Move an existing OpenAI SDK integration to NextModel with minimal application changes.
CacheSafety Bench
Understand how to benchmark safe LLM response reuse before enabling production caching.