openrouter-rs Integration

AVELIN API is compatible with openrouter-rs — Community-maintained Rust SDK and companion CLI for OpenRouter-compatible APIs like AVELIN.

openrouter-rs is a community-maintained Rust SDK and companion CLI for any OpenRouter-compatible API. Its killer feature is zero-cost abstractions in Rust — you get type-safe AI integration with no runtime overhead, plus a CLI tool for quick experimentation from the terminal. Every request and response is strongly typed, every error is handled at compile time, and the companion CLI lets you test prompts and models without writing code.

Built for Rust developers who refuse to compromise on type safety and performance. If you're building AI-powered systems in Rust — game engines, embedded devices, high-throughput services — openrouter-rs gives you idiomatic, ergonomic access to AVELIN's full model catalog.

Why AVELIN + openrouter-rs? Build production-grade AI applications with AVELIN's governed API, automatic failover, and 9 specialized models through a single 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 openrouter-rs

Refer to the openrouter-rs documentation for installation instructions.

Step 3: Configure AVELIN

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

API Reference

EndpointURL
OpenAI-compatiblehttps://api.avelin.ai/v1
Anthropic-compatiblehttps://api.avelin.ai

Use caseModelWhy
General purposeavelin-proBalanced quality and speed
Complex reasoningavelin-ultraFlagship capabilities
Code generationavelin-coding-pro1M context, ~100 tps
Agent workflowsavelin-agentic-ultraTop-tier tool calling
Fast responsesavelin-fastLowest latency and cost

Why AVELIN for openrouter-rs?

  • Production-ready: Automatic failover, retry logic, 99.9% uptime
  • Model diversity: 9 specialized models through one API key
  • Prompt caching: ~80% cost reduction on repeated prompts
  • Enterprise governance: Data sovereignty and compliance features

Troubleshooting

IssueSolution
API key errorVerify OPENAI_API_BASE includes /v1
Model not foundCheck model name matches exactly
Connection issuesVerify endpoint URL is correct
Rate limitingCheck your AVELIN plan limits