RoraOS Logo

API Quick Start

Code examples for integrating with our API

Developer API

https://labs.roraos.com/api/v1/chat

Agent API

https://labs.roraos.com/api/v1/agents/chat

Content-Type

application/json

Developer API

General-purpose chat API for developers. Create API keys in the Developer Portal and use any available model.

Endpoint: /api/v1/chat

Auth: Bearer YOUR_API_KEY

Agent API

API for custom AI agents. Each agent has its own API key with pre-configured system prompt, knowledge base, and settings.

Endpoint: /api/v1/agents/chat

Auth: Bearer agent_XXXXXX

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
# === Developer API (copy-paste ready) ===
curl -X POST https://labs.roraos.com/api/v1/chat -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"messages": [{"role": "user", "content": "Hello!"}], "model": "gemini-2.5-flash"}'

# === Agent API (copy-paste ready) ===
curl -X POST https://labs.roraos.com/api/v1/agents/chat -H "Authorization: Bearer agent_YOUR_AGENT_API_KEY" -H "Content-Type: application/json" -d '{"messages": [{"role": "user", "content": "Hello"}]}'

# === With Streaming ===
curl -X POST https://labs.roraos.com/api/v1/chat -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"messages": [{"role": "user", "content": "Write a poem"}], "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