Browser Use Integration

AVELIN API works with Browser Use — an open-source browser automation agent driven by LLMs via Chrome DevTools Protocol. With 92K+ GitHub stars and YC W25 backing, Browser Use lets any LLM execute real web tasks autonomously.

Browser Use is not a simulated browser or a scraping library — it drives a real Chrome instance via CDP (Chrome DevTools Protocol), clicking buttons, filling forms, navigating pages, and extracting data from live websites. Any LLM can be the "brain": you point it at Browser Use and it figures out the DOM, plans multi-step actions, and executes them. The killer feature is universality — if a human can do it in Chrome, Browser Use can automate it. With 92K GitHub stars and YC W25 backing, it's the most popular open-source browser automation framework, and it works with any OpenAI-compatible model.

Why AVELIN + Browser Use? Give Browser Use access to frontier reasoning models with 1M-token context windows, automatic failover, and competitive pricing — all through a single OpenAI-compatible endpoint.


Quick Setup

Step 1: Get your AVELIN API key

Sign up at avelin.ai and generate an API key. It will look like sk-ave...xxxx.

Step 2: Install Browser Use

pip install browser-use
playwright install chromium

Step 3: Configure Browser Use

Set AVELIN as your LLM provider via environment variables:

export OPENAI_API_BASE=https://api.avelin.ai/v1
export OPENAI_API_KEY=sk-avelin-YOUR_KEY

Step 4: Run Your First Task

from langchain_openai import ChatOpenAI
from browser_use import Agent
import asyncio

llm = ChatOpenAI(
    base_url="https://api.avelin.ai/v1",
    api_key="sk-avelin-YOUR_KEY",
    model="avelin-agentic-ultra",
)

async def main():
    agent = Agent(
        task="Go to Hacker News and summarize the top 5 stories",
        llm=llm,
    )
    result = await agent.run()
    print(result)

asyncio.run(main())

Primary: avelin-agentic-ultra

Featureavelin-agentic-ultraWhy it matters for Browser Use
Context window1M tokensTrack complex multi-page navigation
ReasoningTop-tierUnderstand page structure, plan multi-step tasks
Tool callingFirst-classReliable CDP action selection

Alternatives

ModelWhen to use
avelin-agentic-proStandard automation tasks — lower cost
avelin-agentic-fastHigh-volume simple tasks — lowest cost
avelin-coding-proCode-heavy web scraping and data extraction
avelin-ultraComplex multi-step research workflows

Why AVELIN for Browser Use?

  • Agentic models: Purpose-built for tool-calling and multi-step planning
  • Automatic failover: Browser tasks keep running even if a provider is down
  • 1M context: Track entire browsing sessions without losing context
  • Cost optimization: Prompt caching reduces repeated system prompt costs by ~80%

Example Workflows

Web Research

agent = Agent(
    task="Research the top 5 competitors in the AI code editor space. For each, find: name, pricing, key features, and target audience.",
    llm=llm,
)

Form Filling & Data Entry

agent = Agent(
    task="Log into the dashboard at example.com and fill out the monthly report form with the provided data.",
    llm=llm,
)

Monitoring & Alerts

agent = Agent(
    task="Check the status page at status.example.com. If any service shows degraded, summarize which ones and when.",
    llm=llm,
)

Advanced Configuration

Using LangChain

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    base_url="https://api.avelin.ai/v1",
    api_key="sk-avelin-YOUR_KEY",
    model="avelin-agentic-ultra",
    temperature=0.1,  # low for reliable automation
    max_tokens=65536,
)

Cost Management

For high-volume automation, use tiered model selection:

# Simple tasks — fast/cheap
simple_llm = ChatOpenAI(
    base_url="https://api.avelin.ai/v1",
    api_key="sk-avelin-YOUR_KEY",
    model="avelin-agentic-fast",
)

# Complex tasks — powerful
complex_llm = ChatOpenAI(
    base_url="https://api.avelin.ai/v1",
    api_key="sk-avelin-YOUR_KEY",
    model="avelin-agentic-ultra",
)

Troubleshooting

IssueSolution
Agent loops endlesslyLower temperature to 0.0-0.1, use avelin-agentic-ultra
Slow page actionsAdd explicit waits in task description
Token limit reachedBreak task into smaller steps
API key errorVerify OPENAI_API_BASE includes /v1
Tool call failuresUse avelin-agentic-ultra for best tool-calling reliability