API Reference
OpenAI-compatible endpoints. Change the base URL to https://api.rivenai.io/v1 and use your Riven API key.
POST
/v1/chat/completionsCreate a chat completion. Supports streaming, function calling, and multi-turn conversations.
Authentication
Bearer token
Request body
{
"model": "gpt-4o",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"stream": false,
"temperature": 0.7,
"max_tokens": 1024
}Response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1718000000,
"model": "gpt-4o",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 10,
"total_tokens": 30
}
}GET
/v1/modelsList available models including context windows, pricing, and capabilities.
Authentication
Bearer token
Response
{
"object": "list",
"data": [
{
"id": "gpt-4o",
"object": "model",
"created": 1718000000,
"owned_by": "openai"
},
{
"id": "claude-sonnet-4",
"object": "model",
"created": 1718000000,
"owned_by": "anthropic"
}
]
}POST
/v1/embeddingsCreate vector embeddings for text input. Supports batch requests.
Authentication
Bearer token
Request body
{
"model": "text-embedding-3-large",
"input": "The quick brown fox jumps over the lazy dog."
}Response
{
"object": "list",
"data": [{
"object": "embedding",
"index": 0,
"embedding": [0.0023, -0.0091, ...]
}],
"model": "text-embedding-3-large",
"usage": {
"prompt_tokens": 9,
"total_tokens": 9
}
}Base URL
https://api.rivenai.io/v1All endpoints require an Authorization: Bearer <token> header.