API reference
Responses
Models on this endpoint (5)
/v1/responsesOpenAI’s Responses API shape — single input field, structured output items, and reasoning summaries for models that expose them.
#Request parameters
modelstringrequiredModel ID from /v1/models. The gateway resolves the upstream vendor from this value.
inputstring | arrayrequiredThe prompt: a plain string or an array of input items.
instructionsstringoptionalSystem-level guidance, equivalent to a system message.
streambooleanoptionalStreams response.* SSE events instead of one JSON body.
max_output_tokensintegeroptionalUpper bound on generated tokens; also caps the pre-reserved quota estimate.
toolsarrayoptionalFunction declarations the model may call — see the tool-calling guide.
previous_response_idstringoptionalChain a follow-up turn onto a prior response without resending history.
#Compacting a long conversation
/v1/responses/compactCompaction condenses a conversation that has outgrown what you want to keep resending, and returns the shortened form to carry forward. It is the call coding agents make when a session approaches the context limit.
modelstringrequiredA model that supports compaction. Others reject this path with unsupported_endpoint.
inputarray | stringoptionalThe conversation to compact, in Responses input form.
instructionsstring | arrayoptionalWhat to preserve while compacting — for example "keep every file path and decision".
previous_response_idstringoptionalContinue from a stored response instead of resending the whole history.
{
"id": "resp_…",
"object": "response",
"created_at": 1789000000,
"output": [ /* the compacted conversation */ ],
"usage": {"input_tokens": 8120, "output_tokens": 240, "total_tokens": 8360}
}Never streams, always billed by tokens
#Related errors
- 400 invalid_request_errorMalformed body or unsupported parameter for this model.
- 401Invalid or missing bearer token. No error.code on this path — match the status.
- 402 insufficient_user_quotaWallet balance cannot cover the pre-reserved estimate.
- 429Per-key throttle. Empty body; wait for Retry-After. A 429 that does carry insufficient_user_quota is a daily spend cap instead.
- 503 model_not_foundUnknown model, or no healthy channel serves it right now.
#Request example
curl https://www.aisplice.store/v1/responses \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-luna",
"input": "Say hello."
}'#Response
{
"id": "resp_…",
"object": "response",
"model": "gpt-5.6-luna",
"output": [{
"type": "message",
"role": "assistant",
"content": [{"type": "output_text", "text": "Hello!"}]
}],
"usage": {"input_tokens": 9, "output_tokens": 3, "total_tokens": 12}
}Still stuck?
Send us the request ID or the error message and we will look into it.