RoraOS Logo

API Quick Start

Code examples for integrating with our API

Base URL

https://your-domain.com/api/v1

Authentication

Bearer YOUR_API_KEY

Content-Type

application/json

Available Models

gemini-2.5-flash

Fast & efficient

gemini-2.0-flash

Balanced performance

gpt-4o-mini

OpenAI compatible

Request Parameters

messages
arrayRequired

Array of message objects with role and content

model
stringOptional

Model to use (default: gemini-2.5-flash)

stream
booleanOptional

Enable streaming response (default: false)

temperature
numberOptional

Sampling temperature 0-2 (default: 1)

max_tokens
numberOptional

Maximum tokens in response (default: 4096)

Code Examples

cURL
# Basic Chat Completion
curl -X POST https://your-domain.com/api/v1/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello, how are you?"}
    ],
    "model": "gemini-2.5-flash"
  }'

# With Streaming
curl -X POST https://your-domain.com/api/v1/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{"role": "user", "content": "Write a poem about coding"}],
    "model": "gemini-2.5-flash",
    "stream": true
  }'

OpenAI SDK Compatible

Our API is fully compatible with the official OpenAI SDKs. Simply change the base_url (Python) or baseURL (Node.js) to point to our API endpoint, and use your API key. This means you can use all the features of the OpenAI SDK including streaming, function calling, and more!

pip install openainpm install openai

Response Format

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1704067200,
  "model": "gemini-2.5-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 20,
    "total_tokens": 30
  }
}

Error Codes

400

Bad Request

Invalid request parameters

401

Unauthorized

Invalid or missing API key

429

Rate Limited

API limit exceeded, upgrade your plan

500

Server Error

Internal server error, try again later