input. It is the easiest migration path for existing Responses API integrations — change only the base_url to https://api.piramyd.cloud/v1 and your request and response code continues to work unchanged. Unlike Chat Completions, streaming uses named SSE events rather than generic chat.completion.chunk objects, and multimodal content blocks including input_image are preserved rather than flattened to text.
Discover available models via
GET /v1/models. Check that the model’s endpoints array includes /v1/responses before sending requests to this endpoint.Endpoint
Request Parameters
The input to the model. Two formats are accepted:
- String shorthand — a bare string is treated as a single user message.
- Array of message objects — each object has a
role(userorassistant) and acontentfield, which may itself be a string or an array of typed content blocks (e.g.input_text,input_image).
A system prompt equivalent. Injected as the system turn before the
input messages. Equivalent to adding {"role": "system", "content": "..."} at the start of the messages array in Chat Completions.Sampling temperature between
0 and 2. Lower values produce more focused, deterministic output; higher values produce more varied output. Behaves identically to the temperature parameter in Chat Completions.Set to
true to receive structured SSE events (see Streaming Events below). The event format differs from Chat Completions streaming.Tool/function definitions. Same structure as in Chat Completions. Only send to models where
supports_tools: true.Controls tool selection. Accepts
"auto", "none", "required", or a specific tool object. Behaviour is identical to Chat Completions.Thread identifier for automatic context compaction. Include this in multi-turn sessions to keep long conversations within the model’s context window.
Request Examples
If the selected model does not support image input (
supports_vision: false), the API returns 400 image_input_not_supported before contacting any upstream provider. Check the model’s capabilities via GET /v1/models first.Streaming Events
Whenstream: true, the Responses endpoint emits named SSE events in a fixed sequence. Each line is either event: <name> or data: <json>. Process them in the order they arrive.
Example SSE stream
Manual Context Compaction
You can trigger the same context-compaction pass that runs automatically on long threads by calling:thread_id (or conversation_id) and model fields. This is useful if you want to compact a thread proactively before a large request rather than waiting for an automatic trigger.