Create a model response using input, with support for text, multimodal input, and available tools.
Request
| Item | Description |
|---|---|
| Method | POST |
| Path | /v1/responses |
| Gateway URL | https://ailink.nativex.com |
| Authentication | Authorization: Bearer sk-xxxx; replace the placeholder with your API Key |
| Request format | application/json |
Replace MODEL_ID with a model from the Model Marketplace that supports this endpoint. Available models, parameters, and permissions depend on your account.
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
model |
Body | string | Yes | A model that supports Responses |
input |
Body | string / object[] | Yes | Text or an array of input messages |
instructions |
Body | string | No | Instructions for this request |
max_output_tokens |
Body | integer | No | Output token limit |
stream |
Body | boolean | No | Whether to return SSE events |
tools |
Body | object[] | No | Tool definitions |
tool_choice |
Body | string / object | No | Tool selection policy |
reasoning |
Body | object | No | Reasoning settings supported by the model |
previous_response_id |
Body | string | No | Previous response ID; requires upstream support for conversation state |
truncation |
Body | string | No | auto or disabled; requires model support |
The response uses an output array, unlike choices in Chat Completions. Confirm model support before using previous_response_id.
Example
curl -X POST 'https://ailink.nativex.com/v1/responses' \
-H 'Authorization: Bearer sk-xxxx' \
-H 'Content-Type: application/json' \
-d '{
"model": "MODEL_ID",
"input": "Give me three tips for learning English."
}'
Response
The following is a simplified response for readability. IDs, URLs, text, and usage values are illustrative.
{
"id": "resp_example",
"object": "response",
"status": "completed",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Practice listening, speaking, and reading every day."
}
]
}
]
}
| Field or result | Description |
|---|---|
| id | Response ID |
| status | Current response status |
| output[].content[] | Read output by content type. Text items have type output_text. |
Error handling
For unsuccessful responses, check the HTTP status and error body first. Verify the API Key, model name, account balance, and parameters. If rate limited, reduce concurrency and retry later.