Resposta direta
Esta página explica como as equipas usam o gateway compatível com OpenAI do NextModel. The OpenAI-compatible chat surface: same SDK, same shapes, streaming and tools included. Acrescenta os passos práticos, as notas de configuração e as perguntas mais frequentes.
OpenAI-compatible surface
Chat runs on /v1/chat/completions with the request and response shapes you already know: messages, streaming server-sent events, and tool calls. Point any OpenAI SDK at the NextModel base URL and go.
curl
curl https://modelxing.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NEXTMODEL_API_KEY" \
-d '{"model":"qwen3-max","messages":[{"role":"user","content":"Reply with OK."}]}'Python
# pip install openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["NEXTMODEL_API_KEY"],
base_url="https://modelxing.com/v1",
)
resp = client.chat.completions.create(
model="qwen3-max",
messages=[{"role": "user", "content":"Reply with OK."}],
)
print(resp.choices[0].message.content)Node.js
// npm install openai
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NEXTMODEL_API_KEY,
baseURL: "https://modelxing.com/v1",
});
const resp = await client.chat.completions.create({
model: "qwen3-max",
messages: [{ role: "user", "content":"Reply with OK." }],
});
console.log(resp.choices[0].message.content);Pricing
Every model bills per million input/output tokens at the rate shown on its catalog page; the key success panel and dashboard usage views report spend in the same currency.