Responses
The responses format: input and instructions in, typed output items out, with conversations continued by id.
Every response on this page was returned by the API when the page was built.
POST /v1/responses
Create a response.
The responses format: input and instructions in, output items out. previous_response_id continues a conversation for an hour. Streaming sends typed events from response.created to response.completed.
Request body
| Field | Type | Notes |
|---|---|---|
model Required | string | |
input Required | string or array | A string, or a list of messages and items. |
instructions | string | |
max_output_tokens | integer | At least 16. |
temperature | number | 0 to 2. |
top_p | number | |
stream | boolean | |
previous_response_id | string | Continue an earlier response; kept for an hour. |
text | object | |
memory_scope | string |
curl -X POST https://api.znsi.ai/v1/responses \
-H "Authorization: Bearer $ZNSI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mugen-5-swift",
"input": "What is a Shōgi pod?"
}'HTTP/1.1 200 OK
content-type: application/json
request-id: req_afe4e96d64d029ad042f3a0a
x-ratelimit-remaining-requests: 17
x-znsi-neurons: 1567000000
{
"created_at": 1792991712,
"error": null,
"id": "resp_mNnhDsYJRaslDCl55E3D2sPd",
"incomplete_details": null,
"instructions": null,
"max_output_tokens": null,
"metadata": {},
"model": "mugen-5-swift",
"object": "response",
"output": [
{
"content": [
{
"annotations": [],
"text": "KIRIN wafers are wafer-scale chips whose transistors are arranged as spiking neurons and whose synapses are memristors that change as they conduct. The weights are the hardware, and the hardware learns. KIRIN-9 has 7.2 billion neurons and 1.1 quadrillion synapses per wafer.",
"type": "output_text"
}
],
"id": "msg_LZMnvv8rJPVCde80esWEjXJU",
"role": "assistant",
"status": "completed",
"type": "message"
}
],
"parallel_tool_calls": true,
"previous_response_id": null,
"status": "completed",
"store": true,
"temperature": 1,
"text": {
"format": {
"type": "text"
}
},
"tool_choice": "auto",
"tools": [],
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 14,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 80,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 94
}
}HTTP/1.1 200 OK
content-type: text/event-stream; charset=utf-8
request-id: req_e64e2c1e17f3660f79ba267d
x-ratelimit-remaining-requests: 16
x-znsi-neurons: 1395000000
event: response.created
data: {"response":{"created_at":1792991712,"error":null,"id":"resp_Qw81NjZVnpaxIUni82jyomJd","incomplete_details":null,"instructions":null,"max_output_tokens":null,"metadata":{},"model":"mugen-5-swift","object":"response","output":[],"parallel_tool_calls":true,"previous_response_id":null,"status":"in_progress","store":true,"temperature":1,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1,"truncation":"disabled","usage":null},"sequence_number":0,"type":"response.created"}
event: response.in_progress
data: {"response":{"created_at":1792991712,"error":null,"id":"resp_Qw81NjZVnpaxIUni82jyomJd","incomplete_details":null,"instructions":null,"max_output_tokens":null,"metadata":{},"model":"mugen-5-swift","object":"response","output":[],"parallel_tool_calls":true,"previous_response_id":null,"status":"in_progress","store":true,"temperature":1,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1,"truncation":"disabled","usage":null},"sequence_number":1,"type":"response.in_progress"}
event: response.output_item.added
data: {"item":{"content":[],"id":"msg_f3uETNyOHbaPxCsdjXNb35Jh","role":"assistant","status":"in_progress","type":"message"},"output_index":0,"sequence_number":2,"type":"response.output_item.added"}
event: response.content_part.added
data: {"content_index":0,"item_id":"msg_f3uETNyOHbaPxCsdjXNb35Jh","output_index":0,"part":{"annotations":[],"text":"","type":"output_text"},"sequence_number":3,"type":"response.content_part.added"}
… 29 more events …
event: response.output_item.done
data: {"item":{"content":[{"annotations":[],"text":"KIRIN tolerates defects by rerouting synapses around dead dies while it runs, so a wafer with flaws still serves. That matters when the chip is the size of a dinner plate and is never switched off.","type":"output_text"}],"id":"msg_f3uETNyOHbaPxCsdjXNb35Jh","role":"assistant","status":"completed","type":"message"},"output_index":0,"sequence_number":33,"type":"response.output_item.done"}
event: response.completed
data: {"response":{"created_at":1792991712,"error":null,"id":"resp_Qw81NjZVnpaxIUni82jyomJd","incomplete_details":null,"instructions":null,"max_output_tokens":null,"metadata":{},"model":"mugen-5-swift","object":"response","output":[{"content":[{"annotations":[],"text":"KIRIN tolerates defects by rerouting synapses around dead dies while it runs, so a wafer with flaws still serves. That matters when the chip is the size of a dinner plate and is never switched off.","type":"output_text"}],"id":"msg_f3uETNyOHbaPxCsdjXNb35Jh","role":"assistant","status":"completed","type":"message"}],"parallel_tool_calls":true,"previous_response_id":null,"status":"completed","store":true,"temperature":1,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1,"truncation":"disabled","usage":{"input_tokens":14,"input_tokens_details":{"cached_tokens":0},"output_tokens":56,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":70}},"sequence_number":34,"type":"response.completed"}Try it
Errors
400Invalid request: a missing or invalid parameter, named inparam.401No key, or a key that is malformed, expired or revoked.404Unknown route or model.413Request body larger than 10 MB.429Rate limited, or MUGEN is declining this caller for a while. Seeretry-after.