Theme
Create Model Response (Streaming)
POST
https://www.kkiai.com/v1/responses
https://platform.openai.com/docs/api-reference/responses/create
Some OpenAI models only support Response format, such as o3-pro, codex-mini-latest
Request Parameters
Authorization
Add the Authorization parameter in the Header, with its value being the Token concatenated after Bearer
Example: Authorization: Bearer ********************
Header Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Content-Type | string | Required | application/json | |
Accept | string | Required | application/json | |
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Optional | The ID of the model to use. For detailed information about which models can be used with the Chat API, please refer to the model endpoint compatibility table. |
stream | boolean | Optional | Defaults to false. If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events, which arrive as available and terminate the stream with a data: [DONE] message. Python code example. |
input | array[object] | Optional | |
└ role | string | Required | |
└ content | string | Required |
Request Example
json
{
"model": "gpt-4.1",
"stream": true,
"input": [
{
"role": "user",
"content": "Hello"
}
]
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/v1/responses' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-4.1",
"stream": true,
"input": [
{
"role": "user",
"content": "Hello"
}
]
}'Response
🟢 200 OK
Response Body
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Required | |
object | string | Required | |
created | integer | Required | |
choices | array[object] | Required | |
└ index | integer | Optional | |
└ message | object | Optional | |
└ finish_reason | string | Optional | |
usage | object | Required | |
└ prompt_tokens | integer | Required | |
└ completion_tokens | integer | Required | |
└ total_tokens | integer | Required |
Response Example
json
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nHello there, how may I assist you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}