Skip to content
English

Responses API

POST /v1/responses is HiAPI’s recommended endpoint for newly integrated text models that support the Responses protocol. It uses the same HiAPI API key as other enabled models, but its request and response shapes differ from Chat Completions and the asynchronous media API.

Terminal window
curl -X POST "https://api.hiapi.ai/v1/responses" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_RESPONSES_MODEL_ID",
"input": [{
"type": "message",
"role": "user",
"content": [{"type": "input_text", "text": "Explain sparse attention."}]
}],
"reasoning": {"effort": "medium"},
"stream": false
}'

Required fields are model and input. input can be a string or an array of typed conversation items. Common optional fields include instructions, stream, max_output_tokens, reasoning, text, and tools; exact support is model-specific.

Do not copy a parameter from one model to another without checking that model’s page. Reasoning levels, storage, conversation state, tools, and streaming requirements can differ.

For non-streaming calls, read text from output items whose content type is output_text. Read Token usage from usage.

For streaming calls, dispatch each SSE frame by its type. Append response.output_text.delta; stop on response.completed, and handle response.incomplete or response.failed. A Responses provider may not emit the Chat Completions data: [DONE] marker.

Use Responses only for models whose page lists /v1/responses. DeepSeek V4 Flash uses POST /v1/chat/completions. Image, video, and audio generation continue to use POST /v1/tasks.

See each model page for its exact reasoning, state, structured-output, and tool contract.