POST /ai/v2/direct/responses sends your request straight to the model you name. It exposes the entire Gloo AI model catalog (text, vision, reasoning, tool use, and native image generation) through one request and response shape that works the same across every provider.
Direct endpoints bill the model’s published rate (see the Models page and GET /platform/v2/models). Coming from another gateway? Direct endpoints cost what you would pay going straight to the model providers.
It takes the same request body as the guarded Responses endpoint; the difference is what runs around it. Nothing here applies guardrails, output moderation or values alignment (tradition). (model_family and auto-routing are on Guarded Completions.) Choose this when you want the provider’s model as-is and handle safety yourself; choose guarded Responses when you want Gloo’s safety and values alignment built in. See Which endpoint should I use? to compare all three endpoint families.
Already on Completions V2? It remains fully supported and backwards-compatible; see Moving from Completions to Responses.
Quick start
URL:https://platform.ai.gloo.com/ai/v2/direct/responses
Operation: POST
Why the Responses API
The Responses API is a more capable request shape that the broader ecosystem is standardizing on:- One shape for every modality. Text, image input (vision), and image generation all use the same
inputarray and the same typedoutputarray, with no separate endpoints or bespoke payloads per capability. - OpenAI-compatible. The request and response formats mirror the OpenAI Responses API, so existing tooling, SDKs, and mental models carry over. Point your base URL at
https://platform.ai.gloo.com/ai/v2/direct. - Typed, structured output. Responses come back as an
output[]array of typed items (message,image_generation_call, reasoning, tool calls) instead of a single opaquechoices[].message.contentstring, so they’re easier to parse and extensible as new item types arrive. - Built for multimodal. Native image generation and image input are first-class, not bolted on.
Request format
A minimal request:input instead of messages, plus a few renamed fields:
model and input are required. A few parameters need a note:
max_output_tokens: on a reasoning model it holds the reasoning as well as the answer, so leave room for both. With no value, most reasoning models get their full output allowance (up to 65,536); Claude models and the Gemini Flash-Lite models use the model’s default, so set a value for long answers. A response that reached it hasstatus: "incomplete". See Set your output limit for reasoning models.reasoning: see Reasoning summaries.temperatureandtop_p: some models don’t take them. The request still runs, and the response lists the parameter inignored_params; see Sampling parameters.image_generation: a Gloo field with image options (quality,size), mapped onto OpenAI’s image generation tool for image-capable models. Providers without quality controls ignore it. See Images In and Out.
temperature, top_p), tools, stream, structured output (response_format) and prompt_cache_key (Prompt Caching) follow the OpenAI Responses request shape. For every parameter, see the Direct Responses API reference.
Conversation state is managed client-side: send the full conversation in input on every request (Conversations That Remember shows how, including trimming long histories). previous_response_id and conversation (OpenAI’s server-side conversation chaining) are not supported, and a model’s reasoning is not carried from one request to the next. See Reasoning across turns.
Response format
Responses return a typedoutput[] array. Each item has a type; a normal text answer arrives as a message item, a generated image as an image_generation_call item.
Streaming
Set"stream": true to receive the response as Server-Sent Events. Each event has an event: line and a data: line carrying a typed JSON payload:
response.completed (or response.incomplete) carries the response’s top-level fields (id, object, status, usage and the request settings), not nested under a response key and without output[], and text deltas identify their item by output_index rather than item_id. Build the answer from the events before the final one.
Key event types to handle:
response.output_item.added/response.output_item.done: mark the start and end of each typed item inoutput[](includingmessage,image_generation_call, andfunction_call).response.content_part.added/response.content_part.done: mark the start and completion of a content part within an item.response.content_part.doneis the signal that a message’s text is complete, followed byresponse.output_item.done.response.output_text.delta: incremental text tokens for amessageitem.response.function_call_arguments.delta: incremental tool-call argument tokens for afunction_callitem.response.completed: emitted once when the response is finished. For OpenAI models served over OpenAI’s Responses API, itsresponseobject includes the fulloutput[]array andusage; for other models the payload is the response’s top-level fields andusage, withoutoutput[]. An answer cut off atmax_output_tokensends withresponse.incompleteinstead.
message you can show your end users, a developer_message, and an X-Gloo-Error-Code header. A streamed request that fails before any output gets the same HTTP status and body as a non-streamed one (a raised exception in the SDK). A stream that fails after output has started ends with a response.failed event, as in OpenAI’s Responses API: response.error.code is the string error code, and Gloo adds the numeric gloo_code, developer_message and retryable. See Streaming on the direct endpoints.
Reasoning summaries
Setreasoning.effort to choose how much a reasoning model thinks, and reasoning.summary (auto, concise or detailed) to get a summary of its reasoning back as a reasoning item in output[], before the answer. Without summary, OpenAI and Claude models normally return no summary. The request has the same shape on the guarded Responses endpoint:
Multimodal
Image input (vision)
Pass images as input items alongside text (Images In and Out walks through it). Any vision-capable model accepts them: every Claude, Gemini and Grok chat model, and every OpenAI GPT model except the open-weight GPT OSS models, and the other models withsupports_vision: true in the catalog.
data: URI. Base64 is the most predictable: it works with every model that reads images, and nothing has to fetch the image. To send a file from disk or an upload, encode its bytes:
detailis optional ("low","high"or"auto"). GPT models use"low"to read a smaller version of the image for fewer input tokens.- Formats and counts. Send JPEG, PNG, GIF or WebP. Gloo sets no limit of its own on the number of images; the model maker’s limits apply. The whole request body can be up to 10 MB, and base64 makes a file about a third larger. See Request size.
- Cost. An image is billed as input tokens at the model’s input rate, and again on each turn it stays in the conversation you resend.
- Uploads from people you don’t control. On direct endpoints, safety is your application’s responsibility; see Images and moderation.
- Switching models. A conversation that holds an image needs a model that reads images on every turn. See Switching models mid-conversation.
PDF input
Send a PDF as aninput_file part with the file as a base64 data:application/pdf;base64, URI in file_data, and an optional filename:
- Base64 only.
file_idandfile_urlaren’t supported and return400; send the file infile_data. - PDF only.
file_datamust be adata:application/pdf;base64,URI; other file types return400. - Size. The PDF counts toward the 10 MB request body limit, after base64 encoding.
- Models. Some models can’t take a PDF; a request to one returns a
400that names the model. The PDF’s content counts as input tokens.
Image generation
Image-capable models return a generated image as animage_generation_call output item (base64 result). Optional image_generation controls (quality, size) are forwarded to providers that support them.
image_generation_call item’s result field carries the image as a base64-encoded string:
result to get the image bytes.
Image generation tool
OpenAI’s image generation runs as animage_generation tool on an OpenAI GPT model. GPT Image models such as gpt-image-2 are not Gloo model IDs, exactly as on OpenAI’s own API: set model to a GPT model and attach the tool. The model decides when to draw and can combine the image with text in the same response. The tool’s optional model field picks the image model that draws, and quality and size control the image:
image_generation_call output item shown above, alongside any reasoning and message items from the GPT model. Image editing works the same way: include an input_image part in the conversation and it becomes the tool’s edit source.
The tool works the same way here and on the guarded Responses endpoint.
Models that can use the tool
Use an OpenAI GPT-5 or GPT-6 text model from the catalog, such asgloo-openai-gpt-6-luna, gloo-openai-gpt-5.5 or gloo-openai-gpt-6-sol, other than the Pro models listed below. GPT-5.2 Pro, GPT-5.4 Pro and GPT-5.5 Pro run the tool.
These models don’t run the tool, and a request that attaches it gets a 400 error:
- GPT-5.6 Pro (Sol, Terra and Luna), GPT-6 Pro (Astra, Sol and Luna) and GPT-6.1 Sol Pro.
- The GPT-4.1 models.
- Models from other families: Claude, Gemini text models and open-source models.
gloo-google-gemini-3-pro-image, call it directly as shown in Image generation, without tools. These models don’t take tools, so a request to them with any tools gets a 400.
Image models
A request that names
gpt-image-1 keeps working: it runs on gpt-image-2, the newer model in the same family, and is billed as gpt-image-2. The response carries the same headers as any redirected model: X-Gloo-Model-Redirected-From: gpt-image-1, Deprecation: true, and Sunset: Fri, 23 Oct 2026 00:00:00 GMT. Set the tool’s model to gpt-image-2, gpt-image-2.5-flare or gpt-image-2.5-sunburst to stop seeing them.
An image model that doesn’t exist gets a 400 that names the image models you can use. See Image generation errors for every case.
How image generation is billed
Each image is billed at the rates OpenAI publishes for the image model that drew it, from the tokens that image model reports. Those include the prompt text sent to the image model as well as the image it returns. You pay only for images that come back in the response. The GPT model’s own input and output tokens are billed at its catalog rates as usual (see Supported Models orGET /platform/v2/models). Direct endpoints add nothing to these rates.
Pricing and token spend
The Responses API is billed per token at each model’s standard rates, with no separate or premium price for/responses. Cost depends only on the model you select and the tokens you use:
- Per-model rates. Input and output rates vary by model. The live rates are on the Supported Models page and programmatically on
GET /platform/v2/models. - Prompt caching reduces input cost when prompt prefixes repeat: cached tokens are billed at a discounted
cache_readrate. See Prompt Caching. - Image input (images and PDFs you send) counts as input tokens at the model’s input rate, with no separate per-image charge. See Know what each turn costs.
- Image generation is billed at the image model’s published rates, and only for images that are returned. See How image generation is billed.
- Published rate. Direct endpoints and Grounded Responses bill the published per-model rate exactly. Guarded endpoints and Grounded Completions are priced at that rate plus 6.5% for guardrails, moderation and values alignment.
Supported models
The Responses API works across the full Gloo AI catalog (Anthropic, OpenAI, Google, and open-source families), including the multimodal and image-generation models. Use the Model ID as themodel field. The complete, live list (with capabilities and pricing) is on the Supported Models page.
Reasoning across turns
Reasoning models can return areasoning item in output[] with a summary of how they reasoned. Gloo does not carry a model’s reasoning from one request to the next: each request is reasoned from the conversation you send in input.
What comes back
Reasoning items keep theirid and summary. They never include encrypted_content, in a non-streamed response or in any streamed event, and that includes requests that ask for include: ["reasoning.encrypted_content"]. That include value is accepted; it just returns nothing.
What happens to reasoning you send back
You can still send output items back ininput, reasoning items included. Gloo removes the reasoning state before calling any model and answers normally.
- Any
reasoningitem that carriesencrypted_contentis removed, whatever the value is: an OpenAI blob saved from an earlier response, a value from another provider, or anything else. - If the most recent assistant turn loses a reasoning item, every reasoning item in the request is removed, so the model sees a conversation with no reasoning in it rather than reasoning from older turns only.
- Items tied to a removed reasoning item are adjusted so the request stays valid for OpenAI models. In each assistant turn that lost reasoning:
- a
function_callis sent without itsid; itscall_id, and yourfunction_call_outputfor it, are kept; - an assistant
messageis sent without itsid, with its text kept, or removed if it has no text; - hosted and client tool calls OpenAI ties to the reasoning by id (
web_search_call,file_search_call,image_generation_call,code_interpreter_call,computer_call,local_shell_call, the MCP items and similar) are removed, together with your items that answer them; - an
item_referenceto anything removed or sent without its id is removed.
- a
- Requests with no reasoning items are unchanged.
How to tell what was removed
Direct Responses reports removed reasoning inignored_params. input.reasoning=<n> is the number of reasoning items removed because they carried encrypted_content or went with one that did, and input.reasoning_paired=<n> the number of other items removed with them: hosted tool calls, your items answering them, assistant messages with no text and item_reference items (omitted when there were none). input.reasoning does not count the other reasoning items on a request that is converted for the model, those without encrypted_content that did not go with one that did, though those are still not sent to it. Here one reasoning item carrying an OpenAI blob was sent back:
X-Ignored-Params header without counts, for example X-Ignored-Params: input.reasoning, input.reasoning_paired.
A check on a non-streamed response:
response.model_dump(): ignored_params is a Gloo addition, so the SDK keeps it as an extra field rather than a typed attribute.
Direct Responses does not return a reasoning_carryover object or an X-Gloo-Reasoning-Carryover header. Those are how the guarded Responses and Grounded Responses endpoints report removals, described next.
The reasoning_carryover object on Responses and Grounded Responses
It appears only when your input contained at least one reasoning item, or when you asked for include: ["reasoning.encrypted_content"]. Every reasoning item you send back is removed and listed in dropped, including one sent back exactly as it was received, with no encrypted_content. On a non-streamed response the object is a top-level field. Here the first turn’s output was sent back as received, with one reasoning item:
Reasons in
dropped:
On a stream, the counts arrive in the
X-Gloo-Reasoning-Carryover response header (for example received=1, carried=0, dropped=1), and the object arrives as a top-level field of the final response.completed or response.incomplete event. See Responses: Reasoning across turns.
What to do
- Keep sending the full conversation in
inputon every request: your messages, the assistant’s messages, function calls and your function call outputs. You can send output items back as you received them; Gloo removes what it can’t carry and tells you. - Treat reasoning summaries as display text. Show them to your users if they help; sending them back does not give the model its earlier reasoning.
- Restate what the model needs. If a later turn depends on something only a hosted tool call returned, such as web search results, put it in a message: that call can be removed with its turn’s reasoning.
- Don’t build on
encrypted_content. Gloo does not return it, and removes it when you send it.
output back as it was received, reasoning item included, followed by the next user message:
encrypted_content, so for this OpenAI model nothing is removed: there is no input.reasoning entry in ignored_params. The model reasons afresh from the conversation.
Multi-turn behavior
For holding history, trimming and switching models across turns, see Conversations and Context Windows. What changes depends on how the model is served. OpenAI models served over OpenAI’s Responses API, including its reasoning models. Gloo passes your input items to OpenAI’s Responses API, so all of the rules in What happens to reasoning you send back apply. Before this change,encrypted_content you sent back was passed to OpenAI and gave the model its earlier reasoning; now it is removed. A reasoning item without encrypted_content is passed on as sent when neither its own turn nor the most recent assistant turn lost a reasoning item.
All other models. Gloo converts your conversation into the format the model accepts, and reasoning items have never been sent to these models. What the model sees does not change. The difference is that removals are now reported in ignored_params, which counts only the reasoning items that carried encrypted_content, or went with one that did; the others are still not sent to the model. An OpenAI-model request that cannot be passed to OpenAI as sent, for example because the first attempt failed before any output, is served this way too.
Moving off encrypted_content and previous_response_id
- If you sent
encrypted_contentback to keep OpenAI reasoning across turns: the request still succeeds, and the model now reasons from the conversation alone. Code that stores the blob can stay or go; Gloo removes it either way. - If you asked for
include: ["reasoning.encrypted_content"]: it returns nothing and you can remove it. - If you used
previous_response_idorconversation: send the earlier turns ininputinstead. Don’t send these parameters, orbackground: true: for those OpenAI models they are passed to OpenAI as sent and the request can fail, and for other models they have no effect. Gloo setsstoreon requests to OpenAI itself, so astorevalue you send has no effect either. Where they have no effect, they can be listed inignored_params.
Moving from Completions to Responses
Completions V2 (/ai/v2/guarded/chat/completions) is fully supported and backwards-compatible: existing integrations keep working unchanged, and it remains the home of auto-routing and model_family selection. Guardrails, output moderation and tradition have already reached the Responses shape on the guarded Responses endpoint, and RAG grounding on Grounded Responses.
The Responses shape suits new work better: it is the OpenAI-compatible standard and makes multimodal (vision + image generation) first-class. Apart from the URL, the migration is mostly a rename:
tradition, guardrails and output moderation are available now on the guarded Responses endpoint, and grounded (RAG) responses on Grounded Responses. Auto-routing and model_family selection remain on Completions V2, and grounding with citation metadata on Grounded Completions. Choose this page’s direct endpoint when your application owns its own safety and prompting.
Next steps
Direct Responses tutorial
Build it step by step: first request, streaming, multi-turn, tools and error handling.
API reference
Every request and response field, with a live playground.
Tool Use
Let the model call your functions.
Grounded Responses
RAG-grounded answers in the Responses API format.

