Direct answer
This page explains how India-based teams use NextModel's OpenAI-compatible gateway. Connect an existing OpenAI SDK to NextModel in minutes, then compare providers and keep Indian AI API spend visible before production rollout. It adds the practical steps, configuration notes, and common questions.
Three edits to migrate
Switch any OpenAI SDK to NextModel with three edits: (1) set NEXTMODEL_API_KEY to a NextModel key, (2) point base_url at the NextModel API base, (3) use a catalog model ID. Everything else in your chat-completions code stays as-is. Using a coding agent? See the Agent Setup guides at /agents.
curl https://api.nextmodel.app/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NEXTMODEL_API_KEY" \
-d '{"model":"qwen/qwen3.7-max","messages":[{"role":"user","content":"Reply with OK."}]}'# pip install openai
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["NEXTMODEL_API_KEY"],
base_url="https://api.nextmodel.app/v1",
)
resp = client.chat.completions.create(
model="qwen/qwen3.7-max",
messages=[{"role": "user", "content":"Reply with OK."}],
)
print(resp.choices[0].message.content)// npm install openai
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NEXTMODEL_API_KEY,
baseURL: "https://api.nextmodel.app/v1",
});
const resp = await client.chat.completions.create({
model: "qwen/qwen3.7-max",
messages: [{ role: "user", "content":"Reply with OK." }],
});
console.log(resp.choices[0].message.content);| base_url | https://api.nextmodel.app/v1 |
| endpoint | /v1/chat/completions |
| auth | Authorization: Bearer $NEXTMODEL_API_KEY |
| model | Use a NextModel catalog ID such as qwen/qwen3.7-max |
First call doubles as the key test
Run the snippet; a 200 response means the key works. GET /v1/models is the cheapest authenticated check, and the dashboard shows the same one-click test right after you create a key.
curl -s https://api.nextmodel.app/v1/models -H "Authorization: Bearer $NEXTMODEL_API_KEY" | head -c 300Switching models
Changing models means changing only the model field. Browse the catalog for IDs, prices, context windows and live routing status before you commit.