The Riven API gives you one OpenAI-compatible endpoint for chat, streaming, embeddings, and image generation — backed by Riven's own hosted models plus routed frontier models. This page takes you from zero to a working request.
Every request is authenticated with a Riven API key — a bearer token that starts with rvn_.
export RIVEN_API_KEY="rvn_..."
Keys can also be minted, rotated, and revoked programmatically — see Authentication & Keys.
The base URL is https://api.rivenai.io. Chat completions are OpenAI-compatible, so existing OpenAI SDKs work by changing the base URL and key.
curl https://api.rivenai.io/v1/chat/completions \
-H "Authorization: Bearer $RIVEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "riven-core",
"messages": [{"role": "user", "content": "Say hello from Riven."}],
"max_tokens": 100
}'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-core",
messages=[{"role": "user", "content": "Say hello from Riven."}],
max_tokens=100,
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.rivenai.io/v1",
apiKey: process.env.RIVEN_API_KEY,
});
const resp = await client.chat.completions.create({
model: "riven-core",
messages: [{ role: "user", content: "Say hello from Riven." }],
max_tokens: 100,
});
console.log(resp.choices[0].message.content);Set "stream": true to receive server-sent events with OpenAI-compatible chat.completion.chunk objects as tokens are generated.
curl -N https://api.rivenai.io/v1/chat/completions \
-H "Authorization: Bearer $RIVEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "riven-core", "messages": [{"role": "user", "content": "Count to five."}], "stream": true}'riven-core is the balanced flagship tier and a safe default. List everything available to your key with a public, unauthenticated call:
curl https://api.rivenai.io/v1/models
Browse capabilities and plan availability in the Model Catalog. Some models require a paid plan — requests beyond your plan return a structured rate_limit_exceeded error (see Errors).
curl https://api.rivenai.io/billing/quota \ -H "Authorization: Bearer $RIVEN_API_KEY"
Returns your plan, usage against the current billing window, and the reset date. Quota state is also attached to every completion response via x-riven-quota-* headers — see API Reference → Quota.