Inference
Responses
BetaA text-only subset of the OpenAI Responses API, with streaming.
Endpoint
Requires an API key with the inference scope. Receipts record the operation as inference.responses.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model ID from GET /v1/models. |
| input | string | array | Required | A non-empty string, or 1–500 input items. See Input formats. |
| instructions | string | Optional | Up to 200,000 characters. Sent to the model as a system message ahead of the input. |
| max_output_tokens | integer | Optional | 1–128,000. Reduced to the model's cap. Determines the balance reservation. |
| temperature | number | Optional | 0–2. Ignored for models that do not support sampling parameters. |
| top_p | number | Optional | 0–1. Ignored for models that do not support sampling parameters. |
| stream | boolean | Optional | Stream typed events. Default false. |
| store | boolean | Optional | Accepted and ignored. Responses are never stored. |
Other fields, including tools and previous_response_id, are ignored.
Input formats
A string input becomes a single user message. An array contains message items with a role and content; type: "message" is optional.
| Field | Accepted values |
|---|---|
| role | system, developer (treated as system), user, assistant |
| content | A string, or up to 64 parts of type input_text, output_text or text. Part texts are concatenated. |
{
"model": "gpt-5-mini",
"input": [
{ "role": "developer", "content": "Be brief." },
{ "role": "user", "content": [{ "type": "input_text", "text": "Name three ledger entry types." }] },
{ "role": "assistant", "content": [{ "type": "output_text", "text": "credit, debit, reserve" }] },
{ "role": "user", "content": "And the other two?" }
]
}Any other part type, including images and files, fails validation with HTTP 400.
Example
curl https://www.hushcompute.xyz/v1/responses \
-H "Authorization: Bearer $HUSH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5-mini",
"instructions": "Reply in plain text.",
"input": "Summarize the difference between a budget and a balance.",
"max_output_tokens": 400
}'Response object
{
"id": "resp_01K58ZQ4W5V8E2R7PKD3N6A0TG",
"object": "response",
"created_at": 1789387200,
"status": "completed",
"model": "gpt-5-mini",
"output": [
{
"type": "message",
"id": "msg_01K58ZQ4W5V8E2R7PKD3N6A0TG",
"status": "completed",
"role": "assistant",
"content": [{ "type": "output_text", "text": "A balance is ...", "annotations": [] }]
}
],
"output_text": "A balance is ...",
"usage": { "input_tokens": 41, "output_tokens": 118, "total_tokens": 159 },
"receipt": {
"id": "rcpt_01K58ZQ4W6N3T2B9XRC7D1M5HJ",
"hash": "0x6f0d…a3c9",
"signature": "0x9b1f…c07e1b",
"signer": "0x3A4c…91De",
"url": "https://www.hushcompute.xyz/proofs/rcpt_01K58ZQ4W6N3T2B9XRC7D1M5HJ"
},
"billing": {
"request_id": "req_01K58ZQ4W5V8E2R7PKD3N6A0TG",
"cost_micro_usd": "272",
"cost_usd": "0.000272",
"usage_estimated": false,
"fingerprint_salt": "0x51c2…7f08"
}
}| Field | Type | Description |
|---|---|---|
| id | string | resp_ followed by the request ID's suffix. The request ID is in billing.request_id and x-request-id. |
| status | string | completed, or incomplete when output stopped at max_output_tokens. |
| output | array | One assistant message with a single output_text part. |
| output_text | string | Convenience copy of the generated text. |
| usage | object | input_tokens, output_tokens, total_tokens as billed. |
| receipt | object | Same shape as Chat Completions: id, hash, signature, signer, url. |
| billing | object | request_id, cost_micro_usd, cost_usd, usage_estimated, fingerprint_salt. |
Streaming
With stream: true the response is a stream of named Server-Sent Events. Each event has an event: line and a JSON data: line whose type matches the event name. There is no [DONE] sentinel; the stream closes after the last event.
| Event | Payload |
|---|---|
| response.created | response with id, status in_progress and model. |
| response.output_text.delta | output_index 0, content_index 0, delta with the next text fragment. |
| response.completed | response: the full response object, including receipt and billing. |
| error | error object in the standard shape. Sent instead of response.completed. |
event: response.created
data: {"type":"response.created","response":{"id":"resp_01K5…","status":"in_progress","model":"gpt-5-mini"}}
event: response.output_text.delta
data: {"type":"response.output_text.delta","output_index":0,"content_index":0,"delta":"A balance is"}
event: response.completed
data: {"type":"response.completed","response":{"id":"resp_01K5…","object":"response","status":"completed", … ,"receipt":{…},"billing":{…}}}Partial-output rules match Chat Completions: if text was delivered before a failure, that portion is billed and receipted with status failed. The error event does not repeat the receipt; its ID is the x-receipt-id header sent when the stream opened. If nothing was delivered, nothing is charged and no receipt exists.
Limitations
- No tools, function calling, web search or file search.
- No stored state: store is ignored and previous_response_id is not supported.
- Text input and output only.
- Reasoning items are not returned.
For tool calling use Chat Completions.