文本模型
创建响应
用于创建响应的接口,目前仅 OpenAI 支持,可配置各种参数来控制响应的生成结果。
POST
/
responses
Copy
curl --request POST \
--url https://geekai.co/api/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "auto",
"previous_response_id": "<string>",
"model": "gpt-4o",
"reasoning": {
"effort": "medium",
"summary": "auto",
"generate_summary": "auto"
},
"background": false,
"max_output_tokens": 123,
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "function",
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
}
],
"tool_choice": "none",
"prompt": {
"id": "<string>",
"version": "<string>",
"variables": {}
},
"truncation": "disabled",
"input": "<string>",
"include": [
"file_search_call.results"
],
"parallel_tool_calls": true,
"store": true,
"instructions": "<string>",
"stream": false
}'
Copy
{
"id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
"object": "response",
"created_at": 1741476777,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "gpt-4o-2024-08-06",
"output": [
{
"type": "message",
"id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.",
"annotations": []
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"store": true,
"temperature": 1,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 328,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 52,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 380
},
"user": null,
"metadata": {}
}
Response 是 OpenAI 最先进的模型响应生成接口,支持文本和图像输入,输出文本内容。
Authorizations
JWT认证token
Body
application/json
Response
200
application/json
OK
The response is of type object
.
Copy
curl --request POST \
--url https://geekai.co/api/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"metadata": {},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "auto",
"previous_response_id": "<string>",
"model": "gpt-4o",
"reasoning": {
"effort": "medium",
"summary": "auto",
"generate_summary": "auto"
},
"background": false,
"max_output_tokens": 123,
"text": {
"format": {
"type": "text"
}
},
"tools": [
{
"type": "function",
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": true
}
],
"tool_choice": "none",
"prompt": {
"id": "<string>",
"version": "<string>",
"variables": {}
},
"truncation": "disabled",
"input": "<string>",
"include": [
"file_search_call.results"
],
"parallel_tool_calls": true,
"store": true,
"instructions": "<string>",
"stream": false
}'
Copy
{
"id": "resp_67ccd3a9da748190baa7f1570fe91ac604becb25c45c1d41",
"object": "response",
"created_at": 1741476777,
"status": "completed",
"error": null,
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"model": "gpt-4o-2024-08-06",
"output": [
{
"type": "message",
"id": "msg_67ccd3acc8d48190a77525dc6de64b4104becb25c45c1d41",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The image depicts a scenic landscape with a wooden boardwalk or pathway leading through lush, green grass under a blue sky with some clouds. The setting suggests a peaceful natural area, possibly a park or nature reserve. There are trees and shrubs in the background.",
"annotations": []
}
]
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"reasoning": {
"effort": null,
"summary": null
},
"store": true,
"temperature": 1,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 328,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 52,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 380
},
"user": null,
"metadata": {}
}
助手
Responses are generated using AI and may contain mistakes.