For new integrations, the Responses API (
POST /ai/v2/responses) is Gloo’s recommended, OpenAI-compatible surface — it runs this same guarded pipeline, including tradition, on the Responses shape. Completions V2 remains fully supported and is the home of the routing, model_family, and grounded features described below — reach for it when you need them.System Capabilities
- Curated Foundational Models: Access the best foundational models available without decision fatigue or unsafe defaults.
- Safe & Values-Aligned: Values alignment and AI safety is evaluted at every layer of the input and output, considering six dimensions of AI safety (Physical, Ethical, Emotional, Factual, Theological, and Security)
- Intelligent Routing: Optional automatic model routing optimizes your outputs for quality, cost, and intent.
Why Completions V2?
Completions V2 builds on the standard chat completions format you already know, but adds three powerful routing mechanisms to help you get the best performance for every query.Choose your Routing Strategy
1. AI Core (Auto-Routing) [Recommended]
Let Gloo AI analyze your query and choose the best model automatically:2. AI Core Select (Model Provider Selection)
Specify a model provider (model_family):
3. AI Select (Direct Model Choice)
Specify the exact model for your output:Additional Features
Completions V2 isn’t just about routing—it’s designed to support the broader goal of values-aligned AI that is safe, intelligent, and production-ready.Tradition-Aware
Customize responses based on theological perspectives:"evangelical", "catholic", "mainline", "not_faith_specific", or omit for a general Christian perspective. "not_faith_specific" requires an explicit model and cannot be combined with auto_routing or model_family.
Streaming Support
Get real-time responses for better UX:Tool Calling
Function calling works seamlessly with all routing modes. You can define tools in your request and the selected model will invoke them as needed:- Multiple SDK examples (Python, TypeScript, AgentKit)
- Model compatibility and streaming support
- Multi-step tool workflows
- Best practices and patterns
Prompt Caching
Reduce costs and latency by caching prompt prefixes across requests. Two types of caching are available depending on your model provider:- Explicit caching (Anthropic): Add the
X-Cache-TTLheader to your request to opt in. System messages are automatically cached. - Implicit caching (OpenAI, DeepSeek): Caching is automatic for prompts with 1,024+ tokens. For OpenAI, you can optionally add
prompt_cache_keyto improve cache hit rates.
Prerequisites
Before starting, ensure you have:- A Gloo AI Studio account
- Your API key from the API Credentials page
- Authentication setup - Complete the Authentication Tutorial first
https://platform.ai.gloo.com/ai/v2/chat/completions
Operation: POST
Example CURL Request:
Request Parameters
Exactly one routing mechanism must be specified:
auto_routing, model, or model_family
Response Metadata
The response includes routing metadata that varies based on your model selection mode. Common fields (all modes):
Additional fields for auto-routing and model family modes:
Optional fields (included if specified in request):
Example: Auto-Routing Response
Example: Model Family Response
Example: Direct Model Selection Response
routing_tier and routing_confidence are not included when using direct model selection since no routing decision is made.Migrating from Completions V1
If you’re currently using the V1 completions endpoint (/ai/v1/chat/completions), here’s what you need to know to migrate to V2.
Endpoint Change
Request Parameter Changes
The main difference is how you specify model selection:
If you’re not specifying a model in V1, the simplest migration path is to use V2’s auto-routing, which intelligently selects the best model for each request:
model parameter in V2:
V1 Request:
New V2-Only Parameters
Response Changes
V2 responses include additional routing metadata. The exact fields vary by routing mode—see Response Metadata for full details. Example (auto-routing with tradition):routing_tier and routing_confidence are only included for auto-routing and model family modes. The tradition field is only included if specified in the request.Migration Checklist
- Update the endpoint URL from
/ai/v1/to/ai/v2/ - Add a routing mechanism to your request:
- Set
auto_routing: trueto use smart routing (recommended) - Or keep using
modelwithauto_routing: falsefor direct model selection - Or use
model_familyto let Gloo select the best model from a provider
- Set
- Update model IDs to V2-supported models
- (Optional) Add
traditionparameter for theology-aware responses - Update response handling to accommodate new metadata fields

