Responses
POST /v1/responses
Use the Responses API format for models like GPT-5 Pro and Codex that require it, or let Chuizi.AI auto-translate from Chat Completions.
Request
POST https://api.chuizi.ai/v1/responses
Authentication
Authorization: Bearer ck-your-api-key
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | Model name, e.g. openai/gpt-5-pro, openai/codex-mini |
input | string/array | Yes | — | Input text or array of input items |
instructions | string | No | — | System-level instructions (equivalent to system message) |
stream | boolean | No | false | Enable SSE streaming output |
max_output_tokens | integer | No | Model default | Maximum tokens in the response |
temperature | number | No | Model default | Sampling temperature, 0-2 |
tools | array | No | — | Tool/function definitions |
text | object | No | — | Text generation options including format for structured output |
reasoning | object | No | — | Reasoning configuration, e.g. {"effort": "high"} |
Request Example
config.json
json
{ "model": "openai/codex-mini", "input": "Write a Python function that calculates the Fibonacci sequence.", "instructions": "You are an expert Python developer. Write clean, well-documented code.", "max_output_tokens": 2048, "reasoning": { "effort": "high" } }
Response
config.json
json
{ "id": "gen-xxxxxxxxxxxxxxxx", "object": "response", "created_at": 1712000000, "model": "openai/codex-mini", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "def fibonacci(n):\n \"\"\"Calculate the nth Fibonacci number.\"\"\"\n if n <= 1:\n return n\n a, b = 0, 1\n for _ in range(2, n + 1):\n a, b = b, a + b\n return b" } ] } ], "usage": { "input_tokens": 28, "output_tokens": 95, "total_tokens": 123 }, "x_chuizi": { "generation_id": "gen-xxxxxxxxxxxxxxxx", "latency_ms": 3500, "cost": "0.00180000" } }
Code Examples
terminal
bash
curl -X POST https://api.chuizi.ai/v1/responses \ -H "Authorization: Bearer ck-your-key" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/codex-mini", "input": "Write a Python Fibonacci function", "max_output_tokens": 2048 }'
Next Steps
- Chat Completions API — standard chat endpoint (auto-translates for Responses models)
- Responses API Protocol — protocol details and compatibility notes
- Choose a Model — compare Codex, GPT-5 Pro, and other models