Operations
Codex Responses Compact
POST
/v1/responses/compact
const url = 'https://coder.api.visioncoder.cn/v1/responses/compact';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"model":"gpt-5.3-codex-spark","messages":[{"role":"system","content":"example"}],"temperature":1,"max_tokens":1,"stream":false,"tools":[{}],"tool_choice":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://coder.api.visioncoder.cn/v1/responses/compact \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "gpt-5.3-codex-spark", "messages": [ { "role": "system", "content": "example" } ], "temperature": 1, "max_tokens": 1, "stream": false, "tools": [ {} ], "tool_choice": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
OpenaiCreateChatCompletionReq
Compact request body used by Codex CLI when wire_api=“responses” is enabled. Same structure as Chat Completions.
object
model
required
Model ID. Recommended for Codex: gpt-5.3-codex-spark (Codex-specialized) or gpt-5.5 (general strongest). Other GPT-5 variants also work.
string
Example
gpt-5.3-codex-sparkmessages
required
Array<object>
object
role
required
string
content
required
string
temperature
number format: float
max_tokens
integer
stream
boolean
tools
Array<object>
object
tool_choice
Responses
Section titled “Responses”A successful response.
Media typeapplication/json
OpenaiCreateChatCompletionResp
Codex Compact response body. Same structure as Chat Completions.
object
id
string
object
string
created
integer
model
string
choices
Array<object>
object
index
integer
message
object
role
string
content
string
finish_reason
string
usage
object
prompt_tokens
integer
completion_tokens
integer
total_tokens
integer
Example
{ "object": "chat.completion", "choices": [ { "message": { "role": "assistant" } } ]}