Inference APIsOpenAI Compatibility
Responses
POST /v1/responses
POST https://api.openinfer.ai/v1/responsesRequest
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?"
}'| Field | Notes |
|---|---|
model | Required. A slug from GET /v1/models. |
input | Required. A string, or a list of input items. |
instructions | A system prompt for this turn. It replaces any system or developer messages in input. |
stream | true returns text/event-stream with one event: line per event type. There is no [DONE] frame. |
temperature, top_p | Sampling. top_p must be in (0, 1]. |
max_output_tokens | Cap on generated tokens, including reasoning. |
tools, tool_choice | Function tool calling. |
store | Defaults to true. Keeps the response so it can be retrieved, deleted or continued. |
previous_response_id | Continue 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"