Skip to main content
The Gloo Completions V2 API is built on a layered, production-ready AI architecture that embeds values, safety, and care directly into today’s best models before, during, and after use.
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

Let Gloo AI analyze your query and choose the best model automatically:
This is ideal when you want Gloo’s optimized choice across speed, utility, and reasoning without manual comparison.

2. AI Core Select (Model Provider Selection)

Specify a model provider (model_family):
This is ideal if you prefer a specific provider but want Gloo AI to optimize your output by choosing the model from within that group.

3. AI Select (Direct Model Choice)

Specify the exact model for your output:
Choose a specific model directly for benchmarking, specialized workflows, or strict reproducibility. You can view supported model ids for this endpoint on the Supported Models page.

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:
Supported: "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:
Streams can fail after the response has started — see Handling Streaming Failures for retry, continuation, and partial-output guidance.

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:
For comprehensive tool calling documentation including:
  • Multiple SDK examples (Python, TypeScript, AgentKit)
  • Model compatibility and streaming support
  • Multi-step tool workflows
  • Best practices and patterns
See our Tool Use Guide.

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-TTL header 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_key to improve cache hit rates.
For detailed documentation including billing rates, best practices, and provider-specific behavior, see the Prompt Caching Guide.

Prerequisites

Before starting, ensure you have: URL: 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:
If you’re specifying a model in V1, you can continue using the model parameter in V2: V1 Request:
V2 Request (equivalent):

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

  1. Update the endpoint URL from /ai/v1/ to /ai/v2/
  2. Add a routing mechanism to your request:
    • Set auto_routing: true to use smart routing (recommended)
    • Or keep using model with auto_routing: false for direct model selection
    • Or use model_family to let Gloo select the best model from a provider
  3. Update model IDs to V2-supported models
  4. (Optional) Add tradition parameter for theology-aware responses
  5. Update response handling to accommodate new metadata fields