Developer integration
OpenAI Responses API
Responses API is OpenAI's interface for agent applications, adding tool calling and other agent capabilities to conversational generation. Yomi API supports /v1/responses and its associated context-compaction endpoint.
Endpoint address
POST https://api.yomiapi.com/v1/responses
POST https://api.yomiapi.com/v1/responses/compact
Quick call
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.yomiapi.com/v1"
)
response = client.responses.create(
model="gpt-5.6-sol",
input="Summarize the main differences between Responses API and Chat Completions"
)
print(response.output_text)
For multi-turn conversations, accumulate the complete history on the client and send it in full with each request (stateless mode). Merge each turn's response.output into the history, then append the next input:
history = [{"role": "user", "content": "Summarize the main differences between Responses API and Chat Completions"}]
response = client.responses.create(model="gpt-5.6-sol", input=history)
history += response.output # Merge this turn's output into the history
history.append({"role": "user", "content": "Organize those conclusions into three points"})
follow_up = client.responses.create(model="gpt-5.6-sol", input=history)
print(follow_up.output_text)
previous_response_id: the current HTTP endpoint does not support this field (and returns 400 previous_response_id is only supported on Responses WebSocket v2). Use stateless calls with the full conversation history maintained by your client. See Frequently asked questions.Comparison with Chat Completions
| Feature | Chat Completions | Responses API |
|---|---|---|
| Positioning | Basic conversational generation | Building agent applications |
| Multi-turn state | Client maintains messages | Client maintains input history |
| Tool calling | Define tools and manually send back results | Define tools, including built-in tool types |
| Suitable for | Ordinary chat and individual tasks | Multi-step reasoning and tool-assisted tasks |
Request parameters
model(required): Model ID, such asgpt-5.6-sol.- input: User input, as a string or a structured content list.
- instructions: System instructions.
- tools: Available tools.
previous_response_id(do not use): Unsupported by the current HTTP endpoint. Supplying it returns a 400 error.stream: Set to true to enable streaming.max_output_tokens/temperature/top_p: Generation controls with the same meaning as in Chat Completions.- reasoning: Reasoning controls for reasoning models such as
claude-opus-4-8,gpt-5.5.
Context compaction
/v1/responses/compact compacts long conversations: it compresses accumulated conversation input into a smaller context to reduce subsequent token usage. Parameters are model, input and instructions (input contains the full conversation to compact. As with /v1/responses, do not send previous_response_id). This endpoint does not support streaming.
