Documentation

Make your first API call in the NexoRouter documentation.

Make your first API call

This guide sends one OpenAI-compatible Chat Completions request to NexoRouter using the production base URL and an exact catalog model ID.

What you need

  • A NexoRouter account with prepaid balance.
  • An API key from Dashboard -> API Keys, stored as NEXOROUTER_API_KEY.
  • A current model ID copied from Models or GET /v1/models.

Never paste a live key into Git, screenshots, tickets, or chat.

Endpoint

Base URL: https://api.nexorouter.com/v1
Header: Authorization: Bearer $NEXOROUTER_API_KEY
Method: POST /chat/completions

Most SDKs want the base URL only up to /v1. Do not append /chat/completions unless the tool asks for the full endpoint.

Copy an exact model ID

Model IDs are case-sensitive catalog strings. Do not send a marketing name.

Catalog IDNotes
kimi-k2.6Docs starter for a first Chat Completions check.
gpt-5.5Use gpt-5.5, not a display label.
gpt-5.6-lunaUse gpt-5.6-luna, not “GPT-5.6 LUNA”.
grok-4.3Live Available in the public catalog when listed.

If an ID is missing from Models, do not use it. Confirm the current list before copying examples from old notes.

curl

export NEXOROUTER_API_KEY="your_nexorouter_key"

curl https://api.nexorouter.com/v1/chat/completions \
  -H "Authorization: Bearer $NEXOROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k2.6",
    "messages": [
      { "role": "system", "content": "You are a concise assistant." },
      { "role": "user", "content": "Reply with one sentence: NexoRouter is connected." }
    ],
    "temperature": 0.7,
    "max_tokens": 128
  }'

A successful response contains text at choices[0].message.content.

OpenAI SDK (Python)

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["NEXOROUTER_API_KEY"],
    base_url="https://api.nexorouter.com/v1",
)

response = client.chat.completions.create(
    model="kimi-k2.6",
    messages=[
        {"role": "user", "content": "Reply with one sentence: NexoRouter is connected."}
    ],
)

print(response.choices[0].message.content)

Verify

  1. Confirm the HTTP status is 200.
  2. Open Usage Logs and find the request ID, model ID, tokens, cost, and latency.
  3. If the call returns insufficient_quota, add prepaid balance and retry.
  4. If it returns model_not_found, copy the ID again from Models and check the key's model scope.