Skip to main content
HyperAgent supports multiple LLM providers with native SDK integration. All models from each provider are supported—use whichever fits your needs.

Supported Providers

ProviderModelsEnvironment Variable
OpenAIAll modelsOPENAI_API_KEY
AnthropicAll modelsANTHROPIC_API_KEY
Google GeminiAll modelsGEMINI_API_KEY

Configuration

OpenAI

import { HyperAgent } from "@hyperbrowser/agent";

const agent = new HyperAgent({
  llm: {
    provider: "openai",
    model: "gpt-5.1",
  },
});

Anthropic

const agent = new HyperAgent({
  llm: {
    provider: "anthropic",
    model: "claude-sonnet-4-5",
  },
});

Google Gemini

const agent = new HyperAgent({
  llm: {
    provider: "gemini",
    model: "gemini-3-pro-preview",
  },
});

Environment Setup

Create a .env file in your project root:
# Add the API key for your chosen provider
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=...
Load it in your code:
import { config } from "dotenv";
config();

const agent = new HyperAgent({
  llm: {
    provider: "openai",
    model: "gpt-5.1",
  },
});

Switching Providers

Create agents with different providers for different tasks:
// Use Claude for complex reasoning
const complexAgent = new HyperAgent({
  llm: { provider: "anthropic", model: "claude-sonnet-4-5" },
});

// Use a smaller model for simple tasks
const simpleAgent = new HyperAgent({
  llm: { provider: "openai", model: "gpt-5-mini" },
});

Cost Optimization

Token costs vary by provider and model. To reduce costs:
  1. Use page.perform() instead of page.ai() when possible (single LLM call vs. multiple)
  2. Use Action Caching to replay without LLM calls
  3. Use smaller/cheaper models for simple tasks

Next Steps