GRGlobalRouter Docs
Console

Text / POST

Create a response

Responses-style text endpoint.

POST /api/v1/responses

Useful when organizing text requests with `input` and reading results from the response/output structure.

Back to Text endpoint list

Request parameters

FieldTypeRequiredDescription
modelstringYesGlobalRouter text model ID.
modelsstring[]NoOpenRouter-style model candidates; the first entry is used when model is omitted.
instructionsstringNoResponses system instructions.
inputstring or arrayYesText input or multipart input.
providerstringNoSpecify provider preferences.
streambooleanNoWhether to use streaming output.
temperaturenumberNoSampling temperature.
top_pnumberNoNucleus sampling probability.
max_output_tokensintegerNoResponses output token limit.
reasoningobjectNoReasoning configuration, such as effort, summary, or reasoning options supported by the provider.
toolsobject[]NoTool call definitions.
tool_choicestring | objectNoTool selection strategy.
textobjectNoText output configuration; use format to select a structured output format.
userstringNoApplication-side user identifier.
routingobjectNoRouting preference.
_routerobjectNoRouting metadata, merged into router metadata.
metadataobjectNoApplication or routing metadata.

Request examples

curl "https://api.globalrouter.com/api/v1/responses" \
  -H "Authorization: Bearer $GR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3-32b",
    "instructions": "回答保持简洁。",
    "input": "用一句话说明 GlobalRouter 的价值。",
    "provider": "qwen",
    "temperature": 0.7,
    "top_p": 0.9,
    "max_output_tokens": 256,
    "tools": [
      {
        "type": "function",
        "name": "lookup_model",
        "description": "查询模型信息",
        "parameters": { "type": "object", "properties": { "model": { "type": "string" } } }
      }
    ],
    "tool_choice": "auto",
    "text": { "format": { "type": "json_object" } },
    "user": "user_123",
    "_router": { "route": "balanced" },
    "metadata": { "project": "docs-demo" }
  }'

Response fields

FieldTypeRequiredDescription
idstringYesResponse ID.
objectstringYesReturned object type.
created_atintegerNoCreation timestamp.
statusstringYescompleted or an error status.
modelstringYesActual model ID used.
outputobject[]YesOutput part list.
usageobjectNoToken usage.
openrouter_metadataobjectNoMetadata such as provider and generation_id.

Response example

Response example
{
  "id": "resp_123",
  "object": "response",
  "status": "completed",
  "model": "qwen3-32b",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        { "type": "output_text", "text": "GlobalRouter 用统一接口聚合模型能力。" }
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 16,
    "total_tokens": 28
  }
}