Skip to main content
The Grounded Responses API brings Retrieval-Augmented Generation (RAG) to the Responses API. Use it when answers should come from your own content. Send a standard Responses API request to the grounded endpoint; Gloo finds relevant passages in your uploaded content, adds them to the model’s context, and tells you whether the answer was grounded. The request and response keep the OpenAI-compatible Responses shape.
If your integration is built on the chat-completions format, or you need auto-routing, tradition (values-aligned) responses, or citation metadata, use Grounded Completions on Completions V2.

Endpoint

URL: https://platform.ai.gloo.com/ai/v1/grounded/responses Operation: POST
Send your API key as a Bearer token, as on the rest of the platform. See Generate API Keys.
Upload your content before grounding against your own publisher.

Request format

The request body is the Responses API request, unchanged, plus three grounding parameters: Everything else works as on the base Responses API: direct model selection via model, string or typed-array input, instructions, max_output_tokens, tools, streaming, and the rest of the request parameters. On a reasoning model, max_output_tokens holds the thinking as well as the answer; see Set your output limit for reasoning models. For every parameter, see the Grounded Responses API reference.

When no sources are found

Grounding never fails the request. If retrieval returns nothing (the publisher has no matching content, or no passage clears certainty_threshold), the model is given an explicit note that no publisher sources were retrieved, generation proceeds, and the response reports sources_returned: false. Check that flag (or the streaming header) when your product needs to tell grounded answers from ungrounded ones.
Checking sources_returned tells you whether sources reached the model, not whether the answer reflects them. Pair it with a verification step that confirms quotations and titles appear in the retrieved text. See Building Trustworthy Grounded Applications.

Response format

The response is standard Responses API output (a typed output[] array plus usage) with one addition: a top-level sources_returned boolean saying whether retrieved sources grounded the generation.

Streaming

Set "stream": true to receive the same Server-Sent Events as the base Responses API (response.created, response.output_text.delta, response.completed, …); see Responses API streaming for the event reference. With reasoning.summary set, the reasoning streams before the answer; see Reasoning summaries. The grounding outcome is known before the stream starts, so it arrives as an HTTP response header instead of a body field:

Reasoning summaries

As on Responses, set reasoning.effort and reasoning.summary to get a summary of the model’s reasoning as a reasoning item in output[]. On a stream, the reasoning arrives as a reasoning item with OpenAI’s events before the answer: response.reasoning_summary_text.delta, or response.reasoning_text.delta for models outside the Anthropic, Google and OpenAI families (details).

Reasoning across turns

Grounded Responses handles reasoning the same way as Responses. Reasoning items come back with a summary and never encrypted_content. Every reasoning item you send back in input is removed before the model is called, including one sent back exactly as it was returned, and the request still succeeds. Gloo does not carry a model’s reasoning from one request to the next, so send the full conversation in input each turn. A response to a request whose input contains reasoning items, or that asks for include: ["reasoning.encrypted_content"], also carries a top-level reasoning_carryover object that lists every removed reasoning item in dropped. On a stream, the counts are in an X-Gloo-Reasoning-Carryover header and the object is on the final response.completed or response.incomplete event, as on Responses. See Direct Responses: Reasoning across turns for the fields.

Code examples

Point the official OpenAI SDKs’ base URL at the grounded prefix, and responses.create posts to /ai/v1/grounded/responses. The SDKs forward the grounding parameters even though they aren’t in the SDK types: in Python pass them via extra_body; in TypeScript include them top-level with a cast (the Node SDK has no extra_body; it would be sent as a literal field):

Grounded Responses vs. Grounded Completions

Both endpoints run the same retrieval over the same publisher content. Choose by the API shape and features you need:

Pricing

Grounded Responses is billed per token at the selected model’s published rate, with nothing added for retrieval, the same as Direct Responses. Injected sources count as input tokens, so grounded requests carry larger prompts than ungrounded ones; sources_limit is your main lever over that cost. See Billing & Plans.

Next steps

For the base request/response format, streaming events and multimodal, see the Responses API. For grounding on the chat-completions shape, with routing, tradition, and citations, see Grounded Completions. For standalone RAG queries without generation, see the Search API. To measure answer quality, see Metrics and Evaluation.

Step-by-step tutorial

Build a grounded assistant over your own content.

Upload Content

Get your publisher content into the platform.

Building Trustworthy Grounded Applications

Verifying answers against sources, prompt contracts, multi-turn handling, and evaluation.

Grounded Responses API reference

Every request and response field, with a live playground.