> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gloo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference Overview

> How to authenticate, call, and handle errors from the Gloo AI REST API.

Use this reference to build on Gloo AI's core capabilities, from conversational AI to content management. Start with the service map below to find the base URL for what you're building, then open an endpoint from the sidebar.

The API follows REST conventions, uses predictable resource-oriented URLs, and returns JSON.

## Gloo AI Service Map & Routing Table

| Service Category | Primary Base URL Path | Current Version | Authentication | Description / Use Case |
| :- | :- | :- | :- | :- |
| **Responses** | `https://platform.ai.gloo.com/ai/v2/guarded/` | **v2** | Required (Bearer) | OpenAI-compatible Responses API — text, vision, image generation, and [tool use](https://docs.gloo.com/ai-learning-center/gloo-ai-104/tools-and-mcp.md), with Gloo's [guardrails](https://docs.gloo.com/ai-learning-center/gloo-ai-101/application-patterns.md#guardrails), output moderation and `tradition`. Same request as Direct Responses. |
| **Completions** | `https://platform.ai.gloo.com/ai/v2/guarded/` | **v2** | Required (Bearer) | Fully supported and backwards-compatible. Choose a model, a [model family](https://docs.gloo.com/getting-started/glossary.md#model-family), or [auto-routing](https://docs.gloo.com/getting-started/glossary.md#auto-routing), with values-aligned (`tradition`) responses. |
| **Direct** (Responses and Completions) | `https://platform.ai.gloo.com/ai/v2/direct/` | **v2** | Required (Bearer) | Sends your request straight to the model you name, with no guardrails, moderation, or routing added. Your application owns its own safety. |
| **Grounded** (Responses and Completions) | `https://platform.ai.gloo.com/ai/v1/grounded/responses`, `https://platform.ai.gloo.com/ai/v2/grounded/chat/completions` | **v1** (Responses), **v2** (Completions) | Required (Bearer) | Retrieval over your own [uploaded content](https://docs.gloo.com/api-guides/upload-content.md) ([RAG](https://docs.gloo.com/ai-learning-center/gloo-ai-101/data-and-memory.md#retrieval-augmented-generation-rag)). |
| **Embeddings** | `https://platform.ai.gloo.com/ai/v2/direct/embeddings` | **v2** | Required (Bearer) | Create [embedding](https://docs.gloo.com/ai-learning-center/gloo-ai-103/embeddings.md) vectors for applications that manage their own vector store. |
| **Search & Recs** | `https://platform.ai.gloo.com/ai/v1/data/` | **v1** | Required (Bearer) | [Semantic search](https://docs.gloo.com/ai-learning-center/gloo-ai-101/data-and-memory.md#semantic-search) and [item/affiliate recommendations](https://docs.gloo.com/api-guides/item-recommendations.md). |
| **Model Catalog** | `https://platform.ai.gloo.com/platform/v2/` | **v2** | **None** | Public endpoint to list available models, pricing, and [context windows](https://docs.gloo.com/ai-learning-center/gloo-ai-101/prompting-and-generation.md#context-window). |
| **Content Controls** | `https://platform.ai.gloo.com/engine/v2/` | **v2** | Required (Bearer) | [Data Engine](https://docs.gloo.com/api-guides/content.md#what-is-data-engine) operations: patch, delete, and metadata management. |
| **Ingestion** | `https://platform.ai.gloo.com/ingestion/v2/` | **v2** | Required (Bearer) | High-volume file and real-time data uploads. |
| **OAuth2 Auth** (legacy, deprecated) | `https://platform.ai.gloo.com/oauth2/token` | N/A | Client Credentials | Legacy token exchange for existing integrations. Deprecated; migrate to API keys. |

Not sure which generation endpoint to use? See [Endpoint types](https://docs.gloo.com/api-guides/endpoint-types.md#which-endpoint-should-i-use) for how guarded, direct, and grounded endpoints differ.

## Authentication

Most endpoints require an **API key**; endpoints that don't are labeled in the reference. Send your key in the `Authorization` header.

```bash theme={null}
curl "https://platform.ai.gloo.com/..." \
  -H "Authorization: Bearer YOUR_API_KEY"
```

API keys are the default and recommended way to authenticate. Follow the [Authentication Tutorial](https://docs.gloo.com/tutorials/authentication.md) to learn how to create and use your API key, or generate one from the [API Keys page](https://docs.gloo.com/studio/manage-api-credentials.md) in Studio.

> [!WARNING]
>
> **Legacy: OAuth2 client credentials.** The `/oauth2/token` exchange (Client ID and Secret for a one-hour access token) is deprecated but still works for existing integrations. Create an API key and send it directly as the Bearer value to migrate. See [Legacy: client credentials and OAuth](https://docs.gloo.com/tutorials/authentication.md#legacy-client-credentials-and-oauth).

## Error Handling

The API uses conventional HTTP status codes:

* Codes in the `2xx` range indicate success.
* Codes in the `4xx` range indicate a client-side error (e.g., a missing parameter, bad authentication).
* Codes in the `5xx` range indicate a server-side error on our end.

For every error code and its meaning, see the [**API Errors Guide**](https://docs.gloo.com/api-reference/general/errors.md).

## Download OpenAPI Specs

> [card] [Active Endpoints](https://docs.gloo.com/openapi/openapi.json)
>
> Recommended for integrations. Includes active endpoints only.

> [card] [All Endpoints](https://docs.gloo.com/openapi/openapi.full.json)
>
> Includes active and deprecated endpoints used by the docs.

## Next steps

> [card] [Developer quickstart](https://docs.gloo.com/getting-started/quickstart-developers.md)
>
> Get an API key and make your first request.

> [card] [Endpoint types](https://docs.gloo.com/api-guides/endpoint-types.md)
>
> Compare guarded, direct, and grounded endpoints and choose the right one.

> [card] [Supported models](https://docs.gloo.com/api-guides/supported-models.md)
>
> See every available model and its capabilities, such as tool use and streaming.

> [card] [Errors](https://docs.gloo.com/api-reference/general/errors.md)
>
> Look up the error codes the API returns and what they mean.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.