curl --request POST \
--url 'https://api.elkapi.com/v1/responses' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.5",
"input": "今天天气真好,适合出去散步。",
"temperature": 1,
"stream": false
}'
import requests
url = "https://api.elkapi.com/v1/responses"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-5.5",
"input": "今天天气真好,适合出去散步。",
"temperature": 1,
"stream": False
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/responses";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-5.5",
"input": "今天天气真好,适合出去散步。",
"temperature": 1,
"stream": false
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"object": "response",
"created_at": 1,
"status": "completed",
"model": "gpt-5.5",
"output": [
{
"type": "type",
"id": "id",
"status": "status",
"role": "user",
"content": "你好,请介绍一下你自己"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"text_tokens": 1,
"audio_tokens": 1,
"image_tokens": 1
},
"completion_tokens_details": {
"text_tokens": 1,
"audio_tokens": 1,
"reasoning_tokens": 1
}
}
}
原生 OpenAI 格式
Responses
- OpenAI Responses API,用于创建模型响应。
- 支持多轮对话、工具调用、推理等功能。
POST
/
v1
/
responses
curl --request POST \
--url 'https://api.elkapi.com/v1/responses' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.5",
"input": "今天天气真好,适合出去散步。",
"temperature": 1,
"stream": false
}'
import requests
url = "https://api.elkapi.com/v1/responses"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-5.5",
"input": "今天天气真好,适合出去散步。",
"temperature": 1,
"stream": False
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/responses";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-5.5",
"input": "今天天气真好,适合出去散步。",
"temperature": 1,
"stream": false
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"object": "response",
"created_at": 1,
"status": "completed",
"model": "gpt-5.5",
"output": [
{
"type": "type",
"id": "id",
"status": "status",
"role": "user",
"content": "你好,请介绍一下你自己"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"text_tokens": 1,
"audio_tokens": 1,
"image_tokens": 1
},
"completion_tokens_details": {
"text_tokens": 1,
"audio_tokens": 1,
"reasoning_tokens": 1
}
}
}
curl --request POST \
--url 'https://api.elkapi.com/v1/responses' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.5",
"input": "今天天气真好,适合出去散步。",
"temperature": 1,
"stream": false
}'
import requests
url = "https://api.elkapi.com/v1/responses"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "gpt-5.5",
"input": "今天天气真好,适合出去散步。",
"temperature": 1,
"stream": False
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/responses";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "gpt-5.5",
"input": "今天天气真好,适合出去散步。",
"temperature": 1,
"stream": false
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"id": "id",
"object": "response",
"created_at": 1,
"status": "completed",
"model": "gpt-5.5",
"output": [
{
"type": "type",
"id": "id",
"status": "status",
"role": "user",
"content": "你好,请介绍一下你自己"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1,
"prompt_tokens_details": {
"cached_tokens": 1,
"text_tokens": 1,
"audio_tokens": 1,
"image_tokens": 1
},
"completion_tokens_details": {
"text_tokens": 1,
"audio_tokens": 1,
"reasoning_tokens": 1
}
}
}
Authorizations
string
必填
所有接口均需要使用 Bearer Token 进行认证。在请求头中添加:
Authorization: Bearer YOUR_API_KEY
Body
string
默认值:"gpt-5.5"
必填
示例:
gpt-5.5string or array<object>
输入内容,可以是字符串或消息数组
string
integer
number
number
boolean
array<object>
string or object
string
string
可选值:
auto、disabledResponse
string
string
示例:
responseinteger
string
可选值:
completed、failed、in_progress、incompletestring
默认值:"gpt-5.5"
示例:
gpt-5.5⌘I