---
title: "Netlify | Models | Mastra"
description: "Use AI models through Netlify."
---

{/* This file is auto-generated by generate-model-docs.ts - DO NOT EDIT MANUALLY */}

import { NetlifyLogo } from '@site/src/components/logos/NetlifyLogo';


# <NetlifyLogo className="inline w-8 h-8 mr-2 align-middle" />Netlify

Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 53 models through Mastra's model router.

Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).

## Usage

```typescript
import { Agent } from "@mastra/core/agent";

const agent = new Agent({
  id: "my-agent",
  name: "My Agent",
  instructions: "You are a helpful assistant",
  model: "netlify/anthropic/claude-3-5-haiku-20241022"
});
```

:::info

Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/) for details.

:::

## Configuration

```bash
# Use gateway API key
NETLIFY_API_KEY=your-gateway-key

# Or use provider API keys directly
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=ant-...
```


## Available Models

| Model |
|-------|
| `anthropic/claude-3-5-haiku-20241022` |
| `anthropic/claude-3-7-sonnet-20250219` |
| `anthropic/claude-3-haiku-20240307` |
| `anthropic/claude-haiku-4-5` |
| `anthropic/claude-haiku-4-5-20251001` |
| `anthropic/claude-opus-4-1-20250805` |
| `anthropic/claude-opus-4-20250514` |
| `anthropic/claude-opus-4-5` |
| `anthropic/claude-opus-4-5-20251101` |
| `anthropic/claude-sonnet-4-0` |
| `anthropic/claude-sonnet-4-20250514` |
| `anthropic/claude-sonnet-4-5` |
| `anthropic/claude-sonnet-4-5-20250929` |
| `gemini/gemini-2.0-flash` |
| `gemini/gemini-2.0-flash-lite` |
| `gemini/gemini-2.5-flash` |
| `gemini/gemini-2.5-flash-image` |
| `gemini/gemini-2.5-flash-image-preview` |
| `gemini/gemini-2.5-flash-lite` |
| `gemini/gemini-2.5-flash-lite-preview-09-2025` |
| `gemini/gemini-2.5-flash-preview-09-2025` |
| `gemini/gemini-2.5-pro` |
| `gemini/gemini-3-flash-preview` |
| `gemini/gemini-3-pro-image-preview` |
| `gemini/gemini-3-pro-preview` |
| `gemini/gemini-flash-latest` |
| `gemini/gemini-flash-lite-latest` |
| `openai/codex-mini-latest` |
| `openai/gpt-4.1` |
| `openai/gpt-4.1-mini` |
| `openai/gpt-4.1-nano` |
| `openai/gpt-4o` |
| `openai/gpt-4o-mini` |
| `openai/gpt-5` |
| `openai/gpt-5-2025-08-07` |
| `openai/gpt-5-codex` |
| `openai/gpt-5-mini` |
| `openai/gpt-5-mini-2025-08-07` |
| `openai/gpt-5-nano` |
| `openai/gpt-5-pro` |
| `openai/gpt-5.1` |
| `openai/gpt-5.1-2025-11-13` |
| `openai/gpt-5.1-codex` |
| `openai/gpt-5.1-codex-max` |
| `openai/gpt-5.1-codex-mini` |
| `openai/gpt-5.2` |
| `openai/gpt-5.2-2025-12-11` |
| `openai/gpt-5.2-codex` |
| `openai/gpt-5.2-pro` |
| `openai/gpt-5.2-pro-2025-12-11` |
| `openai/o3` |
| `openai/o3-mini` |
| `openai/o4-mini` |

