คำตอบตรง ๆ

หน้านี้อธิบายว่าทีมใช้งานจุดเชื่อมต่อของ 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);