rag_publisher to your publisher name and the API handles retrieval, grounding, and attribution.
As on Completions V2, you get three model-selection options (direct model choice, model family selection, or opt-in auto-routing) plus tradition-based personalization and input guardrails, with responses informed by sources retrieved from your content.
Grounded completions (RAG) and model-family and auto-routing selection are Completions V2 features. For general, OpenAI-compatible model access, use Direct Responses with nothing added, or the guarded Responses API for Gloo’s guardrails and
tradition; RAG grounding in the Responses format is available via Grounded Responses.Prerequisites
You need:- A Gloo AI Studio account
- Your API key from the API Keys page
- Authentication setup - Complete the Authentication Tutorial first
- Content uploaded to your publisher: upload your content before using grounded completions with your publisher
- For the Python example: the
requestslibrary (pip install requests). The TypeScript example uses the built-infetch(Node 18+).
Quick start
The grounded endpoint has its own base URL,
https://platform.ai.gloo.com/ai/v2/grounded. Because OpenAI-compatible SDKs append /chat/completions, you can point an SDK client at that base URL when specifying a model. For requests that use auto_routing or model_family without a model, use a direct HTTP request instead because the SDK requires model client-side.Why Grounded Completions?
Grounded completions keep answers tied to your content:Grounding reduces fabrication; it does not verify that a given sentence appears in the retrieved sources. If your application serves quotations, titles, or attributions, check the answer against its sources before display. See Building Trustworthy Grounded Applications.
Request Parameters
The request takes the Completions V2 fields plus the RAG fields below:
For every parameter, see the Grounded Completions API reference.
RAG Configuration
Using Your Own Content
Set therag_publisher parameter to your publisher name to ground responses in your uploaded content:
rag_publisher parameter, the API falls back to GlooGrounded, a shared dataset assembled by Gloo. For best results, always specify your own publisher.
Source Limits
Control how many sources are retrieved and considered with thesources_limit parameter (1-10, default is 3):
Include Citations
Include citation metadata for sources used by RAG (defaults to false)Tradition-Based Personalization
Customize responses to align with specific theological perspectives using thetradition parameter:
"evangelical"- Evangelical Protestant perspective"catholic"- Roman Catholic perspective"mainline"- Mainline Protestant perspective"not_faith_specific"- Neutral, non-faith-specific perspective (uses Gloo’s non-faith-specific prompt rather than a Christian tradition). Requires an explicitmodeland cannot be combined withauto_routingormodel_family.
Response Format
Non-Streaming Response
The response is a Completions V2chat.completion object with grounding metadata added. An excerpt:
sources_returned tells you whether retrieved content grounded the answer. citations appears only when you set include_citations: true. With a reasoning_effort, message can also carry reasoning_content; see Reasoning.
Streaming Response
Whenstream: true, responses are sent as Server-Sent Events. Routing and RAG metadata is provided in HTTP headers:
When
include_citations: true is set and sources are found, a citations event is the first SSE chunk, before any model content (see Include Citations). With a reasoning_effort other than none, delta.reasoning_content chunks arrive before the answer.
For every response field, see the Grounded Completions API reference. For streaming implementation guidance, see Completions V2.
Next steps
Step-by-step tutorial
Build a grounded chatbot with working code.
Building Trustworthy Grounded Applications
Verifying answers against sources, prompt contracts, multi-turn handling, and evaluation.
Grounded Responses
The same RAG grounding in the Responses API format.
API Reference
Every request and response field, with a live playground.

