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 listRequest parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | GlobalRouter text model ID. |
models | string[] | No | OpenRouter-style model candidates; the first entry is used when model is omitted. |
instructions | string | No | Responses system instructions. |
input | string or array | Yes | Text input or multipart input. |
provider | string | No | Specify provider preferences. |
stream | boolean | No | Whether to use streaming output. |
temperature | number | No | Sampling temperature. |
top_p | number | No | Nucleus sampling probability. |
max_output_tokens | integer | No | Responses output token limit. |
reasoning | object | No | Reasoning configuration, such as effort, summary, or reasoning options supported by the provider. |
tools | object[] | No | Tool call definitions. |
tool_choice | string | object | No | Tool selection strategy. |
text | object | No | Text output configuration; use format to select a structured output format. |
user | string | No | Application-side user identifier. |
routing | object | No | Routing preference. |
_router | object | No | Routing metadata, merged into router metadata. |
metadata | object | No | Application 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
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Response ID. |
object | string | Yes | Returned object type. |
created_at | integer | No | Creation timestamp. |
status | string | Yes | completed or an error status. |
model | string | Yes | Actual model ID used. |
output | object[] | Yes | Output part list. |
usage | object | No | Token usage. |
openrouter_metadata | object | No | Metadata such as provider and generation_id. |
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
}
}