GRGlobalRouter Docs
Console

GlobalRouter API quick start

Choose the right API surface first, then make your first call. New integrations should start with the GlobalRouter API, while migrations can keep using the compatible protocol that matches their current client.

Quick start

Choose the right API surface first, then make your first call. New integrations should start with the GlobalRouter API, while migrations can keep using the compatible protocol that matches their current client.

API Surface matrix

The four entry points match different integration paths. Use the GlobalRouter API for new features, and reserve compatible protocols for migrations or provider-style calls.

EntryBase PathRoleBest for
GlobalRouter APIRecommended primary API/api/v1Primary long-term public APINew projects, a unified model catalog, audio, providers, credits, assets, and key managementView docs
OpenAI-compatible APISDK migration/v1OpenAI-style compatible entry pointProjects already using OpenAI SDKs, APIs, or OpenAI-style toolingView docs
OpenRouter-compatible APIOverseas aggregation/api/v1OpenRouter-style compatible entry pointOverseas sites, OpenRouter provider routing, usage.cost settlement, and model/provider displayView docs
Seedance-compatible APIProvider-native protocol/doubao/api/v3Seedance and Doubao compatible entry pointMigrations from Seedance, Doubao, or Volcengine video generation protocolsView docs

Auth

All public HTTP APIs read the Bearer token from the Authorization header. Create an API key first, then send it with every request.

Authorization: Bearer $GR_API_KEY

View Auth docs

First call

Calling `POST /api/v1/chat/completions` only requires a Bearer token, model ID, and messages. Set `stream` to true for SSE streaming responses.

Parameters

ParameterType / LocationRequiredDescription
AuthorizationheaderYesBearer <GlobalRouter API Key>.
modelstringYesGlobalRouter model ID, e.g. qwen3-32b.
messagesarrayYesOpenAI-style message array with role and content.
streambooleanNoSet to true for SSE streaming responses.

Request example

Request example
curl "https://api.globalrouter.com/api/v1/chat/completions" \
  -H "Authorization: Bearer $GR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3-32b",
    "messages": [
      { "role": "user", "content": "Introduce GlobalRouter in three sentences." }
    ],
    "stream": false
  }'

Response

Text models return OpenAI-compatible choices, message, finish_reason, and usage.

Response
{
  "id": "chatcmpl_01HV...",
  "object": "chat.completion",
  "created": 1716283200,
  "model": "qwen3-32b",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "GlobalRouter 提供统一模型 API..." },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 18, "completion_tokens": 42, "total_tokens": 60 }
}