Skip to Content
OpenInfer Docs
Inference APIsOpenAI Compatibility

Responses

POST /v1/responses

POST https://api.openinfer.ai/v1/responses

Request

curl https://api.openinfer.ai/v1/responses \
  -H "Authorization: Bearer $OPENINFER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "@oi/Qwen3.5-9B",
    "instructions": "You are concise.",
    "input": "What is a KV cache?"
  }'
FieldNotes
modelRequired. A slug from GET /v1/models.
inputRequired. A string, or a list of input items.
instructionsA system prompt for this turn. It replaces any system or developer messages in input.
streamtrue returns text/event-stream with one event: line per event type. There is no [DONE] frame.
temperature, top_pSampling. top_p must be in (0, 1].
max_output_tokensCap on generated tokens, including reasoning.
tools, tool_choiceFunction tool calling.
storeDefaults to true. Keeps the response so it can be retrieved, deleted or continued.
previous_response_idContinue a stored response.

Multi-turn

Pass the previous response's id to continue the conversation without resending it:

first = client.responses.create(model="@oi/Qwen3.5-9B", input="My name is Sam.")
second = client.responses.create(
    model="@oi/Qwen3.5-9B",
    previous_response_id=first.id,
    input="What is my name?",
)
print(second.output_text)

The response id names the node that holds the stored response, so follow-up requests are routed back to it. An unknown or expired id is rejected with 400. Set store: false to opt out; such a response cannot be retrieved or continued.

Retrieve and delete

curl https://api.openinfer.ai/v1/responses/$RESPONSE_ID \
  -H "Authorization: Bearer $OPENINFER_API_KEY"

curl -X DELETE https://api.openinfer.ai/v1/responses/$RESPONSE_ID \
  -H "Authorization: Bearer $OPENINFER_API_KEY"

On this page