Skip to main content

OpenRouter plugin for vision agents

Project description

OpenRouter Plugin

This plugin provides LLM capabilities using OpenRouter's API, which offers access to multiple LLM providers through a unified OpenAI-compatible interface. It enables developers to easily switch between different models from various providers (Anthropic, Google, OpenAI, etc.) without changing their code.

Features

  • Access to multiple LLM providers through a single API
  • OpenAI-compatible interface for easy integration
  • Support for various models including Claude, Gemini, GPT, and more
  • Automatic conversion of instructions to system messages
  • Manual conversation history management

Installation

uv add vision-agents[openrouter]

Usage

from vision_agents.core import User, Agent
from vision_agents.plugins import openrouter, getstream, elevenlabs, deepgram, smart_turn

agent = Agent(
    edge=getstream.Edge(),
    agent_user=User(name="OpenRouter AI"),
    instructions="Be helpful and friendly to the user",
    llm=openrouter.LLM(
        model="anthropic/claude-haiku-4.5",
    ),
    tts=elevenlabs.TTS(),
    stt=deepgram.STT(),
    turn_detection=smart_turn.TurnDetection(),
)

Configuration

Parameter Description Accepted Values
api_key OpenRouter API key str | None. If not provided, uses OPENROUTER_API_KEY environment variable
base_url OpenRouter API base URL str. Default: "https://openrouter.ai/api/v1"
model Model identifier to use str. Default: "openrouter/andromeda-alpha". Examples: "anthropic/claude-haiku-4.5", "google/gemini-2.5-flash", "openai/gpt-4o"
**kwargs Additional arguments passed to OpenAI LLM Any additional parameters supported by the underlying OpenAI LLM implementation

Dependencies

  • vision-agents
  • vision-agents-plugins-openai

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vision_agents_plugins_openrouter-0.3.8.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file vision_agents_plugins_openrouter-0.3.8.tar.gz.

File metadata

File hashes

Hashes for vision_agents_plugins_openrouter-0.3.8.tar.gz
Algorithm Hash digest
SHA256 a57e63f440d275157b40f2a207de2479d58537f89bb74c982838f648cfb5b14f
MD5 c00ee68e7089897f01c3487209a79d3a
BLAKE2b-256 048d8819f09fa2264ffba01944c1256dd66e419b556962da29b2e6c2d25d73f2

See more details on using hashes here.

File details

Details for the file vision_agents_plugins_openrouter-0.3.8-py3-none-any.whl.

File metadata

File hashes

Hashes for vision_agents_plugins_openrouter-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 40c068fc0e8e9a70d443e8e25e19a5a97b491582799c3c8a540c3d4e96cacab0
MD5 330be31356fb9a4976c6ff00ccddaa8f
BLAKE2b-256 01f4df4a9b9df83281a841966b463494e359e597fae1934c041995c9e6e72411

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page