OpenAI Responses API
Use OpenAI Responses API for conversations. Responses API is the latest OpenAI API format with more flexible input.
Endpoint
POST https://your-domain.com/api/ai/v1/responses
Authentication
AuthorizationRequired
Bearer YOUR_API_KEYRequest
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model name, e.g. gpt-4, gpt-4o-mini |
| input | string | Required | Input text or conversation content |
| max_tokens | integer | Optional | Maximum number of output tokens |
| temperature | float | Optional | Sampling temperature, controls randomness (0-2) |
| stream | boolean | Optional | Enable streaming response, set to true for SSE |
Response
| Parameter | Type | Description |
|---|---|---|
| id | string | Unique response identifier |
| model | string | Actual model used |
| output | string | Generated text output |
| usage | object | Token usage statistics including prompt_tokens, completion_tokens, total_tokens |
Examples
curl https://your-domain.com/api/ai/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4",
"input": "Hello, who are you?",
"max_tokens": 1000
}'