Netlify
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 32 models through Mastra’s model router.
Learn more in the Netlify documentation .
Usage
import { Agent } from "@mastra/core";
const agent = new Agent({
name: "my-agent",
instructions: "You are a helpful assistant",
model: "netlify/anthropic/claude-3-5-haiku-20241022"
});
Mastra uses the OpenAI-compatible /chat/completions
endpoint. Some provider-specific features may not be available. Check the Netlify documentation for details.
Configuration
# 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-5-haiku-latest |
anthropic/claude-3-haiku-20240307 |
anthropic/claude-opus-4-1-20250805 |
anthropic/claude-opus-4-20250514 |
anthropic/claude-sonnet-4-5-20250929 |
anthropic/claude-sonnet-4-20250514 |
anthropic/claude-3-7-sonnet-20250219 |
anthropic/claude-3-7-sonnet-latest |
gemini/gemini-flash-lite-latest |
gemini/gemini-2.5-flash-lite-preview-09-2025 |
gemini/gemini-2.5-flash-lite |
gemini/gemini-2.0-flash |
gemini/gemini-2.5-flash-image-preview |
gemini/gemini-2.5-pro |
gemini/gemini-flash-latest |
gemini/gemini-2.5-flash-preview-09-2025 |
gemini/gemini-2.5-flash |
gemini/gemini-2.0-flash-lite |
openai/gpt-5-nano |
openai/gpt-4.1 |
openai/gpt-4.1-mini |
openai/gpt-4.1-nano |
openai/gpt-4o |
openai/gpt-4o-mini |
openai/o4-mini |
openai/o3-mini |
openai/gpt-5 |
openai/gpt-5-codex |
openai/gpt-5-mini |
openai/o3 |
openai/codex-mini-latest |