Skip to main content
Zero-config agent with web search capabilities.

Code

How It Works

Agent Setup
  • instructions: Defines agent behavior
  • model: OpenRouter’s GPT model
  • tools: DuckDuckGo for web search
Handler
  • Passes messages to agent
  • Agent processes with LLM and tools
  • Returns structured response
Environment
  • Requires OPENROUTER_API_KEY in .env
  • load_dotenv() loads environment variables

Dependencies

Environment Setup

Create .env file:

Run

Examples

  • “Tell me about artificial intelligence”
  • “What are the main features of large language models?”
  • “Explain machine learning in simple terms”

Example API Calls

Frontend Setup

Open http://localhost:5173 and try to chat with zero config agent