Docs

Responses API

Updated 2026-08-29

/v1/responses is one of OpenAI’s primary native endpoints. OpenAI recommends evaluating Responses for new projects; if your client or framework defaults to Chat Completions, use OpenAI-compatible calls.

The Base URL remains https://api.rokoapi.com/v1.

Endpoint

POST /v1/responses

Quick Start

curl https://api.rokoapi.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4o",
    "input": "Introduce yourself in one sentence",
    "instructions": "You are a concise assistant"
  }'
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.rokoapi.com/v1",
)

response = client.responses.create(
    model="gpt-4o",
    input="Introduce yourself in one sentence",
    instructions="You are a concise assistant",
)
print(response.output_text)

For text extraction, prefer the SDK’s output_text; when manually iterating over output , note that the first item may be reasoning rather than message.

Common Parameters

ParameterDescription
modelModel ID of an available model that supports Responses
inputString or array of messages
instructionsSystem instructions (similar to a system prompt)
max_output_tokensMaximum output tokens
streamSemantic event stream
tools / tool_choiceFunctions and built-in tools (subject to upstream support)

Model capability labels

Model pages display the Responses capabilities configured in the admin console. Check these labels before sending a request:

LabelMeaning
responses-nativeThe upstream provider supports the Responses protocol natively
responses-compatibleThe gateway converts the request to another upstream protocol; only declared capabilities are guaranteed
structured-outputsJSON Schema structured outputs are supported
previous-response-idprevious_response_id can continue a response
conversation-stateUpstream-managed conversation state is supported
responses-compactPOST /v1/responses/compact is supported
stored-responsesThe store option is supported
parallel-tool-callsParallel tool calls are supported
max-tool-callsThe max_tool_calls limit is supported

Clients must not assume capabilities that are not shown. Compatibility-converted models do not advertise features that depend on an upstream resource lifecycle, such as conversation state, stored responses, or compaction.

Current compatibility-converted models

ModelConversionSupported behavior
deepseek-v4-flashResponses to and from DeepSeek Chat CompletionsText, function tools, tool results, and streaming events
deepseek-v4-proResponses to and from DeepSeek Chat CompletionsText, function tools, tool results, and streaming events
glm-5.3Responses to and from Zhipu V4 Chat CompletionsText, function tools, tool results, and streaming events
glm-5.3-flashResponses to and from Zhipu V4 Chat CompletionsText, function tools, tool results, and streaming events

These models use stateless compatibility conversion. Keep the full conversation and tool-call history on the client and send it again in the next input. They do not support previous_response_id, conversation, compact, or stored responses.

Multi-turn Conversations

By default, maintain conversation history on the client side and include the full context in the input array. Use stateful parameters only when the model page explicitly shows previous-response-id or conversation-state.

Streaming Output

Responses streaming uses semantic events (e.g., response.output_text.delta), unlike Chat Completions’ choices[0].delta . Set stream: true and handle events by type.

Comparison with Chat Completions

Chat CompletionsResponses
messagesinput
System messageinstructions
max_tokensmax_output_tokens
choices[0].message.contentoutput_text

Notes

  • First, check the Models page or the available models documentation to confirm whether the target model supports Responses.
  • Built-in tools, background tasks, and similar capabilities depend on upstream support; capabilities that are not declared on the model page are not part of the compatibility contract.