Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

elizaOS Plugin OpenRouter (Python)

OpenRouter plugin for elizaOS - Multi-model AI gateway client for text and object generation.

Installation

pip install elizaos-plugin-openrouter

Usage

from elizaos_plugin_openrouter import OpenRouterClient, OpenRouterConfig

# Create a client with API key
config = OpenRouterConfig.from_env()
client = OpenRouterClient(config)

# Generate text
response = await client.generate_text_large("What is the meaning of life?")
print(response.text)

# Generate embeddings
embedding = await client.generate_embedding("Hello, world!")
print(f"Embedding dimension: {len(embedding.embedding)}")

Configuration

The client can be configured via environment variables:

Variable Description Default
OPENROUTER_API_KEY API key for authentication (required) -
OPENROUTER_BASE_URL Base URL for the API https://openrouter.ai/api/v1
OPENROUTER_SMALL_MODEL Model for small text generation google/gemini-2.0-flash-001
OPENROUTER_LARGE_MODEL Model for large text generation google/gemini-2.5-flash
OPENROUTER_EMBEDDING_MODEL Model for embeddings openai/text-embedding-3-small
OPENROUTER_EMBEDDING_DIMENSIONS Embedding dimensions 1536
OPENROUTER_TIMEOUT_SECONDS Request timeout 60

Features

  • Text Generation: Generate text using various models (Claude, GPT, Gemini, etc.)
  • Object Generation: Generate structured JSON objects
  • Text Embeddings: Generate embeddings for semantic search
  • Multi-Model Support: Access 100+ models through a single API

Requirements

License

MIT

Metadata

Release files for elizaos-plugin-openrouter 2.0.0a5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elizaos-plugin-openrouter 2.0.0a5
File Size Uploaded
elizaos_plugin_openrouter-2.0.0a5.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for elizaos-plugin-openrouter 2.0.0a5
File Interpreter ABI Platform
elizaos_plugin_openrouter-2.0.0a5-py3-none-any.whl Python 3 none any Details

Total release size: 17.7 kB

Release files / elizaos_plugin_openrouter-2.0.0a5.tar.gz

Download URL elizaos_plugin_openrouter-2.0.0a5.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5462b58a0763737462ab4c14f05c49bd375076ba04dd29ae9b9a292cf3e001d2
BLAKE2b-256 checksum
How to use checksums
578a66463e5c35bbe7699501f8b228578987ba410fcf533a0c0b35b8f00af4bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / elizaos_plugin_openrouter-2.0.0a5-py3-none-any.whl

Download URL elizaos_plugin_openrouter-2.0.0a5-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
253f7da504a3be970004babcb068532bc5d61830f4b6afcb86e23e66e931c30a
BLAKE2b-256 checksum
How to use checksums
a1965902a8723851ad37316e19720d70d2a260ab83e77c36c21873676d7f01b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

2.0.0a5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page