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
string
required
The model ID to use. Retrieve valid IDs from
GET /v1/models. Example: gpt-5.6-luna.string | array
required
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).
string
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.integer
Maximum number of tokens to generate. Equivalent to
max_tokens in Chat Completions.float
default:"0.7"
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.boolean
default:"false"
Set to
true to receive structured SSE events (see Streaming Events below). The event format differs from Chat Completions streaming.array
Tool/function definitions. Same structure as in Chat Completions. Only send to models where
supports_tools: true.string | object
Controls tool selection. Accepts
"auto", "none", "required", or a specific tool object. Behaviour is identical to Chat Completions.string
Thread identifier for automatic context compaction. Include this in multi-turn sessions to keep long conversations within the model’s context window.
string
Alias for
thread_id. The two fields are interchangeable.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.