Documentation

Rouva Docs

Everything you need to connect your app to Rouva — from a quick start to the full API reference.


Quick start

Connect your app to Rouva in three steps. No infrastructure changes required.

  1. Create an account
    Sign up at app.rouva.io and connect your Anthropic or OpenAI API key in Settings.
  2. Generate your Rouva gateway key
    Go to Integrations in your dashboard and click Generate API key. Your key starts with rva_.
  3. Route your first request
    Use the SDK or call the gateway directly. Rouva handles the rest.

SDK

The official Node.js SDK is the fastest way to integrate. One client for Anthropic and OpenAI — drop-in compatible with the OpenAI SDK.

Install

npm install @rouvanpm/rouva

Usage

import { Rouva } from '@rouvanpm/rouva'

const rouva = new Rouva({ apiKey: 'rva_your_key' })

const response = await rouva.chat.completions.create({
  messages: [{ role: 'user', content: 'Your prompt here' }],
})
Omit model to let Rouva route automatically to the cheapest capable model. Pass a model explicitly to override routing for that request.

Already using OpenAI or Anthropic?

Change two lines. Rouva uses the same message format — your existing code works as-is.

// Before (OpenAI)
import OpenAI from 'openai'
const openai = new OpenAI({ apiKey: '...' })
const res = await openai.chat.completions.create({ messages, model: 'gpt-4o' })

// Before (Anthropic)
import Anthropic from '@anthropic-ai/sdk'
const anthropic = new Anthropic({ apiKey: '...' })
const res = await anthropic.messages.create({ messages, model: 'claude-sonnet-4-6', max_tokens: 1024 })

// After — one client, any provider, routes automatically
import { Rouva } from '@rouvanpm/rouva'
const rouva = new Rouva({ apiKey: 'rva_...' })
const res = await rouva.chat.completions.create({ messages })

Options

Option Type Required Description
apiKey string Required Your rva_ gateway key from the dashboard
baseURL string Optional Override the default gateway URL

Gateway endpoint

Prefer Python or another language? Call the gateway directly over HTTP — no SDK required.

POST https://app.rouva.io/api/gateway/messages

Headers

HeaderValue
Authorization Bearer rva_your_key
Content-Type application/json

Request body

FieldTypeRequiredDescription
messages array Required Array of { role, content } objects
model string Optional Target model. Omit to enable intelligent routing.
max_tokens number Optional Maximum tokens to generate
stream boolean Optional Stream the response via SSE

Example — Python

import requests

response = requests.post(
    "https://app.rouva.io/api/gateway/messages",
    headers={
        "Authorization": "Bearer rva_your_key",
        "Content-Type": "application/json",
    },
    json={
        "messages": [{"role": "user", "content": "Hello!"}],
    }
)

print(response.json())

Supported models

Pass any of these model IDs in the model field to override routing. Make sure the relevant provider key is connected in your dashboard Settings.

ProviderModel IDBest for
Anthropic claude-opus-4-7 Complex reasoning, architecture, deep research
Anthropic claude-opus-4-6 Complex reasoning, balanced cost
Anthropic claude-sonnet-4-6 Code, analysis, balanced performance
Anthropic claude-haiku-4-5-20251001 Fast, lightweight tasks
OpenAI gpt-5-nano Ultra-fast, lowest cost tasks
OpenAI gpt-5-mini Summarization, simple Q&A, creative tasks
OpenAI gpt-5 General purpose, balanced performance
OpenAI gpt-5.5 Complex reasoning, long context
OpenAI gpt-4.1-nano Lightweight, cost-sensitive tasks
OpenAI gpt-4.1-mini Fast, efficient mid-tier tasks
OpenAI gpt-4.1 Code, analysis, detailed instructions
OpenAI gpt-4o General purpose, vision
OpenAI gpt-4o-mini Simple Q&A, summarization

Intelligent routing

When enabled, Rouva classifies each prompt and routes it to the cheapest model that can handle it well — without sacrificing quality. Toggle it in Gateway → Intelligent Routing.

Task typeRouted toWhy
summarize gpt-5-nano Lowest latency and cost for compression tasks
simple_qa gpt-5-nano Low cost, high accuracy for factual lookups
code gpt-5-mini Strong code quality at a fraction of frontier model cost
research claude-sonnet-4-6 Best quality-to-cost ratio for multi-step reasoning and research
creative gpt-5-nano Low cost with high fluency for generative tasks
complex claude-opus-4-7 Highest capability for multi-step planning and research
You can always override routing by passing an explicit model in your request. Rouva will use that model directly and skip classification.

Ready to get started?

Create your account, connect a provider, and make your first routed request in minutes.

Get started free →