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

# VoltAgent

> Use TokenLab models in VoltAgent agents

## Overview

VoltAgent accepts AI SDK language models directly. Configure an OpenAI-compatible AI SDK provider with TokenLab's `/v1` base URL and pass the selected model into your agent.

<Note>
  **Type**: TypeScript agent framework

  **Primary Path**: OpenAI-compatible Chat Completions through AI SDK

  **Support Confidence**: Supported OpenAI-compatible path
</Note>

## Environment

```bash theme={null}
export TOKENLAB_API_KEY="sk-your-tokenlab-key"
```

## Direct AI SDK Provider

```ts theme={null}
import { Agent } from "@voltagent/core";
import { createOpenAI } from "@ai-sdk/openai";

const tokenlab = createOpenAI({
  apiKey: process.env.TOKENLAB_API_KEY,
  baseURL: "https://api.tokenlab.sh/v1",
});

const agent = new Agent({
  name: "tokenlab-agent",
  instructions: "Answer concisely.",
  model: tokenlab("claude-sonnet-5"),
});
```

## Model Router Path

If your VoltAgent registry snapshot includes a TokenLab provider entry from `models.dev`, configure:

```bash theme={null}
export TOKENLAB_API_KEY="sk-your-tokenlab-key"
export TOKENLAB_BASE_URL="https://api.tokenlab.sh/v1"
```

Then use the registry model string, for example `tokenlab/claude-sonnet-5`.

## Endpoint Notes

The direct AI SDK path is the most explicit setup. Use TokenLab native Responses, Anthropic Messages, or Gemini endpoints only when your selected AI SDK provider/client is configured for that protocol.
