---
title: Apertis
description: Apertis AI Provider for the AI SDK
url: "https://ai-sdk.dev/providers/community-providers/apertis"
docs_index: /llms.txt
---

> For an index of all documentation, see [/llms.txt](/llms.txt).

[Apertis](https://apertis.ai) is a unified AI gateway providing access to 470+ models from leading providers including OpenAI, Anthropic, Google, and more through a single API.

## Key Features

- **One API Key**: Access 470+ models from multiple providers with a single API key
- **Pay-as-you-go**: Transparent pricing with no monthly fees
- **Enterprise Ready**: High availability infrastructure with automatic failover
- **OpenAI Compatible**: Drop-in replacement for OpenAI API
- **Latest Models**: Immediate access to newly released models

## Setup

```bash
pnpm add @apertis/ai-sdk-provider
```

## Provider Instance

You can import the default `apertis` provider instance or create a custom one:

```ts
import { apertis } from '@apertis/ai-sdk-provider';
```

Or create a custom instance with your API key:

```ts
import { createApertis } from '@apertis/ai-sdk-provider';

const apertis = createApertis({
  apiKey: process.env.APERTIS_API_KEY,
});
```

Get your API key from the [Apertis Dashboard](https://apertis.ai/token).

## Language Models

Access chat models using `apertis()` or `apertis.chat()`:

```ts
const model = apertis('gpt-5.2');
// or
const model = apertis.chat('claude-sonnet-4.5');
```

### Supported Models

- **OpenAI**: `gpt-5.2`, `gpt-5.2-chat`, `gpt-5.2-pro`
- **Anthropic**: `claude-opus-4-5-20251101`, `claude-sonnet-4.5`, `claude-haiku-4.5`
- **Google**: `gemini-3.1-pro-preview`, `gemini-3-flash-preview`, `gemini-2.5-pro`
- **Other**: `glm-4.7`, `minimax-m2.1`, and 470+ more

## Embedding Models

Create text embeddings using `apertis.textEmbeddingModel()`:

```ts
const embeddingModel = apertis.textEmbeddingModel('text-embedding-3-small');
```

### Supported Embedding Models

- `text-embedding-3-small`
- `text-embedding-3-large`
- `text-embedding-ada-002`

## Examples

### Generate Text

```ts
import { apertis } from '@apertis/ai-sdk-provider';
import { generateText } from 'ai';

const { text } = await generateText({
  model: apertis('gpt-5.2'),
  prompt: 'Explain quantum computing in simple terms.',
});
```

### Stream Text

```ts
import { apertis } from '@apertis/ai-sdk-provider';
import { streamText } from 'ai';

const { textStream } = await streamText({
  model: apertis('claude-sonnet-4.5'),
  prompt: 'Write a haiku about programming.',
});

for await (const chunk of textStream) {
  process.stdout.write(chunk);
}
```

### Generate Embeddings

```ts
import { apertis } from '@apertis/ai-sdk-provider';
import { embed } from 'ai';

const { embedding } = await embed({
  model: apertis.textEmbeddingModel('text-embedding-3-small'),
  value: 'Hello world',
});
```

## Additional Resources

- [GitHub Repository](https://github.com/apertis-ai/apertis-sdk)
- [Apertis Documentation](https://docs.apertis.ai)
- [Apertis Dashboard](https://apertis.ai/token)

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)