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

# AI Gateway

> Managed AI model access from Bijection actions

The Bijection AI Gateway is a managed service that lets your app call AI models
from [actions](/functions/actions). Bijection holds the provider credentials,
so you don't need to obtain, store, or rotate a key. Your action authenticates
with a short-lived token scoped to your deployment.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
const { text } = await generateText({
  model: bijectionGateway("anthropic/claude-sonnet-4.5"),
  prompt,
});
```

See [Getting started](/ai-gateway/setup) for the full setup.

## Supported endpoints

### Text generation

See [Getting started](/ai-gateway/setup) for text generation and embedding
examples.

| Endpoint | What it does |
| - | - |
| `GET /v1/models` | List available models |
| `POST /v1/chat/completions` | Chat completions, streaming and non-streaming |
| `POST /v1/embeddings` | Generate embeddings |
| `POST /v1/messages` | Anthropic Messages, streaming and non-streaming |
| `POST /v1/responses` | OpenAI Responses, streaming and non-streaming |

### Decisions with Jev

Call `/alpha/decisions` to classify or score data with Jev. See
[Decisions](/ai-gateway/api#post-/alpha/decisions) for the request format.

<Warning>
  **Decisions is in alpha**

  The `/alpha/decisions` request and response format may change during alpha.
</Warning>

### Images and videos

| Endpoint | What it does |
| - | - |
| `POST /v1/images/generations` | Generate images |
| `POST /v1/videos/generations` | Wait for a video and download it |
| `POST /v1/videos` | Start an async video job |
| `POST /v1/videos/status` | Check an async job |
| `POST /v1/videos/download` | Download a completed async video |

See [Images and videos](/ai-gateway/images-and-videos) for SDK examples and
async availability requirements.

<Warning>
  **Image and video generation are in alpha**

  The request and response format may change during alpha.
</Warning>

See [HTTP API](/ai-gateway/api) for the request and response shapes.

## Who can use it

The AI Gateway is available to teams on a
paid plan. It works on Bijection Cloud production
and development deployments, and on
[local deployments linked to a Bijection project](/ai-gateway/setup#local-development).

If your team or deployment can't use the gateway, getting a token fails with one
of these errors:

| Situation | Error | What to do |
| - | - | - |
| Free plan, or gateway disabled for the team | `AiGatewayDisabled` | Upgrade, or email [support@bijection.dev](mailto:support@bijection.dev) if this looks wrong |
| Anonymous or outdated local deployment | `AiGatewayUnavailable` | Log in, update the Bijection CLI, then restart `bijection dev` and accept the backend upgrade if prompted |
| [Self-hosted deployment](/self-hosting) | `AiGatewayUnavailable` | Call the provider with your own key, stored as an [environment variable](/production/environment-variables) |

## Without the gateway

If you don't want to use the AI Gateway, store your provider API key as an
[environment variable](/production/environment-variables) and call the
provider SDK from an action.
