POST
/
v1
/
responses
OpenAI
curl --request POST \
  --url https://coder.api.visioncoder.cn/v1/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-5.4",
  "input": "Introduce VisionCoder in one sentence",
  "instructions": "<string>",
  "reasoning": {
    "effort": "high"
  },
  "max_output_tokens": 4096,
  "temperature": 1,
  "top_p": 123,
  "stream": false,
  "previous_response_id": "<string>",
  "store": true,
  "tools": [
    {}
  ],
  "tool_choice": "<unknown>",
  "metadata": {}
}
'
{
  "id": "resp_abc123",
  "object": "response",
  "created_at": 1730000000,
  "status": "completed",
  "model": "gpt-5.4",
  "output": [
    {}
  ],
  "output_text": "<string>",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 28,
    "total_tokens": 40
  }
}

调用示例

curl https://coder.api.visioncoder.cn/v1/responses \
  -H "Authorization: Bearer $VISIONCODER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "input": "Hello",
    "stream": false
  }'

响应示例

{
  "id": "resp_01HG7K2P5N6Q3T8XY",
  "object": "response",
  "created_at": 1779438767,
  "status": "completed",
  "model": "gpt-5.5",
  "output": [
    {
      "id": "msg_01HG7K2P5N6Q3T8XZ",
      "type": "message",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Hi! How can I help you today?"
        }
      ]
    }
  ],
  "output_text": "Hi! How can I help you today?",
  "usage": {
    "input_tokens": 8,
    "output_tokens": 9,
    "total_tokens": 17
  }
}
GPT-5 与 o 系列推理模型推荐使用此端点。Codex CLI 的压缩变体见 Responses Compact

加群 & 客服

AI 技术交流群二维码
专属客服二维码

Authorizations

Authorization
string
header
required

Use the API key created at https://coder.visioncoder.cn/key as the Bearer token. Anthropic clients can pass the same key via the x-api-key header.

Body

application/json

OpenAI Responses API request body (recommended for the GPT-5 series). Fields follow the official OpenAI protocol.

model
string
required

OpenAI GPT-5 series model ID, e.g. gpt-5.2, gpt-5.4, gpt-5.4-mini, gpt-5.5, gpt-5.3-codex. Call GET /v1/models for the live list.

Example:

"gpt-5.4"

input
any
required

User input. Either a string or a structured input array

Example:

"Introduce VisionCoder in one sentence"

instructions
string

System-level instructions, equivalent to the system message in Chat Completions

reasoning
object
max_output_tokens
integer
Example:

4096

temperature
number<float>
Required range: 0 <= x <= 2
top_p
number<float>
stream
boolean
default:false
previous_response_id
string

ID of the previous response, used for multi-turn conversations

store
boolean

Whether to store the response server-side (mutually exclusive with disable_response_storage)

tools
object[]
tool_choice
any

Tool choice strategy

metadata
object

Response

200 - application/json

A successful response.

OpenAI Responses API response body.

id
string
Example:

"resp_abc123"

object
string
Example:

"response"

created_at
integer
Example:

1730000000

status
enum<string>
Available options:
completed,
in_progress,
failed,
cancelled
Example:

"completed"

model
string
Example:

"gpt-5.4"

output
object[]

Structured output containing items such as reasoning / message / tool_call

output_text
string

Concatenated plain-text output (used by some clients)

usage
object