RivenGet started

Search docs

Find a page across the Riven documentation

Riven API

Live

One OpenAI-compatible gateway in front of 75 live models. Point an existing SDK at api.rivenai.io, change the key, and the rest of your code stays put.

Service
api

The Riven API is the single entry point for model access. It speaks the OpenAI wire format, so any client library that accepts a custom base URL works unmodified — the difference is what happens behind the request, where Riven Ultra Router resolves your model name to a healthy pool, on-prem first.

Base URL and authentication#

shell
export RIVEN_BASE_URL="https://api.rivenai.io/v1"
export RIVEN_API_KEY="rvn_..."

Keys are bearer tokens prefixed rvn_. See Authentication & keys for issuing, rotating, and revoking them, and Riven Keymaster for how they are stored.

Core endpoints#

POST/v1/chat/completions
POST/v1/embeddings
GET/v1/models
GET/billing/quota

The full parameter and response reference lives in the API reference; error codes are in Errors.

First request#

curl
curl https://api.rivenai.io/v1/chat/completions \
  -H "Authorization: Bearer $RIVEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "riven-best",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.rivenai.io/v1",
    api_key=os.environ["RIVEN_API_KEY"],
)

resp = client.chat.completions.create(
    model="riven-best",
    messages=[{"role": "user", "content": "Hello"}],
)

Response headers#

HeaderMeaning
x-riven-upstreamWhich pool served the request — on-prem node or cloud provider
x-riven-smart-routePresent when a routed alias resolved to a concrete tier
x-riven-quota-remainingTokens left in the current window
x-riven-quota-resetWhen the window rolls over

Model IDs are stable aliases, not provider model names. riven-best keeps working when the pool behind it changes — see Models & usage for the tier list and token multipliers.

What the gateway does for you#