Overview
The entry point for OpenAI Responses, currently only supports non-streaming calls.
API details
Constraints
- The caller must have an API Key. For more information, see Manage AI API Key.
Request path
POST {BASE_URL}/api/v1/responses
Request header
Name |
Required |
Example value |
Description |
|---|---|---|---|
| Authorization | Yes | Bearer {token} | Authentication information |
| Content-Type | No | application/json | Request body format |
Request parameters
Path
None
Query
None
Body
Name |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| model | string | Yes | gpt-3.5-turbo | Model name |
| input | unknown | Yes | User input content | Input content |
| instructions | string | Yes | You are an assistant. | System instructions |
| stream | boolean | Yes | false | Whether to enable streaming output, currently only false is supported |
| max_output_tokens | integer | No | 1000 | Maximum number of output tokens |
| temperature | number | No | 0.7 | Sampling temperature |
| top_p | number | No | 1.0 | Core sampling parameter |
| user | string | No | user-123 | User identifier |
Response
Response parameters
Name |
Type |
Description |
|---|---|---|
| success | boolean | Whether the request was successful |
| code | string | Return code |
| message | string | Return information |
| data | object | Business return data |
data
Name |
Type |
Description |
|---|---|---|
| response | unknown | The response content generated by the model |
Request example
curl --request POST '{BASE_URL}/api/v1/responses' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-3.5-turbo",
"input": "Hello",
"instructions": "You are an assistant.",
"stream": false,
"max_output_tokens": 1000,
"temperature": 0.7,
"top_p": 1.0,
"user": "user-123"
}'
Response example
{
"success": true,
"code": "200",
"message": "successful",
"data": {
"response": "Hello! How can I assist you?"
}
}
