सीधा उत्तर

यह पेज बताता है कि टीमें NextModel के OpenAI-संगत गेटवे का उपयोग कैसे करती हैं। The three-edit migration, restated for agents and plain HTTP clients. यहां सेटअप के व्यावहारिक चरण, कॉन्फ़िगरेशन नोट्स, और सामान्य प्रश्न जोड़े गए हैं।

Any OpenAI-compatible client

Set the key env var, point base_url at the NextModel base, use a catalog model id. Changing models means changing only the model field.

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);