The Root AI API is fully Anthropic-compatible. Point any agent or Anthropic SDK at our base URL and you can start building immediately. Chat, reasoning modes, vision, web search, image generation, and tool calls — all through one endpoint.
| Param | Value |
|---|---|
| base_url | https://root-ai.org/v1 |
| api_key | Your Root AI key — get it from Account Settings → API Access (rootai_...) |
| model | root-ai-flash, root-ai-pro, or root-ai-vision |
curl https://root-ai.org/v1/messages \
-H "x-api-key: rootai_YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "root-ai-flash",
"max_tokens": 512,
"messages": [
{ "role": "user", "content": "Hello, Root AI!" }
]
}'import anthropic
client = anthropic.Anthropic(
base_url="https://root-ai.org",
api_key="rootai_YOUR_API_KEY",
)
message = client.messages.create(
model="root-ai-flash",
max_tokens=512,
messages=[{"role": "user", "content": "Hello, Root AI!"}],
)
print(message.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://root-ai.org",
apiKey: "rootai_YOUR_API_KEY",
});
const message = await client.messages.create({
model: "root-ai-flash",
max_tokens: 512,
messages: [{ role: "user", content: "Hello, Root AI!" }],
});
console.log(message.content[0].text);curl https://root-ai.org/v1/models \ -H "x-api-key: rootai_YOUR_API_KEY"
Every model ships with a 1M token context window. Pick a reasoning mode by appending a variant suffix, or send reasoning_effort in the request body.
| Model ID | Description | Plans |
|---|---|---|
| root-ai-flash | Fast, lightweight chat model. Default reasoning: standard (1M ctx). | Free |
| root-ai-flash-instant | No reasoning — fastest responses. | Free |
| root-ai-flash-medium | Balanced reasoning speed/quality. | Free |
| root-ai-flash-reasoning | High-effort reasoning. | Free |
| root-ai-flash-ultra | Ultra reasoning — maximum effort. | Free |
| root-ai-pro | Best performance and reasoning. Default reasoning: standard (1M ctx). | Basic |
| root-ai-pro-instant | Pro, no reasoning — fast. | Basic |
| root-ai-pro-medium | Pro, balanced reasoning. | Basic |
| root-ai-pro-reasoning | Pro, high-effort reasoning. | Basic |
| root-ai-pro-ultra | Pro, ultra reasoning. | Basic |
| root-ai-vision | Image analysis. Accepts image blocks (base64 or URL) in user messages. | Basic |
Call GET /v1/models any time — the list returned is already filtered to what your plan includes.
Every registered account can create its own API key. Your key inherits your plan's limits automatically — upgrade or downgrade your subscription and the key's access updates live.
Use the x-api-key header — or Authorization: Bearer as a fallback.
# x-api-key header (Anthropic style)
curl https://root-ai.org/v1/messages \
-H "x-api-key: rootai_YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{ "model": "root-ai-flash", "max_tokens": 64, "messages": [{ "role": "user", "content": "Hi" }] }'
# Authorization header (fallback)
curl https://root-ai.org/v1/models \
-H "Authorization: Bearer rootai_YOUR_API_KEY"Security: keys are stored as SHA-256 hashes — Root AI never stores or displays the plaintext after generation. A revoked key stops working immediately on every request.
Limits are tied to your plan and shared across the app and the API.
| Plan | Messages / hour | Web search / day | Images / day |
|---|---|---|---|
| Free | 30 | 10 | Not included |
| Basic | 60 | 20 | 50 |
| Pro | 120 | Unlimited | 100 |
| Business | Unlimited | Unlimited | Unlimited |
Errors follow the Anthropic format:
{
"type": "error",
"error": {
"type": "rate_limit_error",
"message": "Hourly request limit reached for your plan."
}
}| HTTP | error.type | Meaning |
|---|---|---|
| 400 | invalid_request_error | Malformed request — missing/invalid model, messages, or parameters. |
| 401 | authentication_error | Missing, invalid, or revoked API key. |
| 403 | permission_error | Model or feature (vision, image gen) not included in your plan. |
| 404 | not_found_error | Unknown model id. The message lists the available Root AI models. |
| 429 | rate_limit_error | Hourly/daily limit reached for your plan. |
| 500 / 502 | api_error | Provider-side failure. Safe to retry after a short wait. |
Connect Root AI to any agent that supports an Anthropic-compatible provider.
https://root-ai.org/v1rootai_... key.root-ai-flash or root-ai-pro.https://root-ai.orgrootai_... key.root-ai-flash / root-ai-pro / root-ai-vision.export ANTHROPIC_BASE_URL=https://root-ai.org export ANTHROPIC_AUTH_TOKEN=rootai_YOUR_API_KEY claude --model root-ai-flash
// TypeScript
const client = new Anthropic({
baseURL: "https://root-ai.org", // SDK appends /v1/messages
apiKey: "rootai_YOUR_API_KEY",
});
# Python
client = anthropic.Anthropic(
base_url="https://root-ai.org",
api_key="rootai_YOUR_API_KEY",
)Any tool with an Anthropic-compatible custom base URL works: set the URL to https://root-ai.org (or https://root-ai.org/v1) and use your Root AI key.
Three ways to control reasoning — pick whichever fits your client.
"model": "root-ai-pro-ultra" // Ultra Reasoning "model": "root-ai-flash-instant" // Instant (no reasoning) "model": "root-ai-flash" // Standard (1M ctx)
curl https://root-ai.org/v1/messages \
-H "x-api-key: rootai_YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "root-ai-flash",
"reasoning_effort": "high",
"max_tokens": 512,
"messages": [{ "role": "user", "content": "Plan a project" }]
}'
// accepted: instant, standard, medium, high, xhigh
// aliases: reasoning -> high, ultra / max -> xhigh{
"model": "root-ai-pro",
"thinking": { "type": "enabled", "budget_tokens": 4096 },
"max_tokens": 2048,
"messages": [{ "role": "user", "content": "Hard problem" }]
}
// budget_tokens mapping:
// < 2048 -> medium
// < 8192 -> high
// >= 8192 -> ultra (max)The API is stateless — send the full messages array back every turn to continue a conversation.
// Turn 2: pass the previous assistant reply back in messages
{
"model": "root-ai-flash",
"max_tokens": 512,
"messages": [
{ "role": "user", "content": "What is 2 + 2?" },
{ "role": "assistant", "content": [ { "type": "text", "text": "2 + 2 is 4." } ] },
{ "role": "user", "content": "Now multiply it by 3." }
]
}Assistant tool_use blocks and user tool_result blocks are also passed back for tool-calling loops — see .
Ask for JSON directly in your prompt and parse the reply. For structured workflows, prefer tool calls with an input schema.
{
"model": "root-ai-flash",
"max_tokens": 512,
"messages": [{
"role": "user",
"content": "Return a JSON object with keys: name, age, city. Values: Juan, 24, Cebu. Respond with JSON only."
}]
}
// reply
{
"name": "Juan",
"age": 24,
"city": "Cebu"
}The proxy executes tools server-side and returns the result to the model, so agents get a finished answer — no extra round trips.
{
"model": "root-ai-flash",
"max_tokens": 800,
"tools": [ { "type": "web_search" } ],
"messages": [ { "role": "user", "content": "Latest AI news this week?" } ]
}{
"model": "root-ai-flash",
"max_tokens": 800,
"tools": [{
"type": "custom",
"name": "image_generate",
"description": "Generate an image from a text prompt.",
"input_schema": {
"type": "object",
"properties": {
"prompt": { "type": "string" },
"width": { "type": "integer", "enum": [1024, 1536] },
"height": { "type": "integer", "enum": [1024, 1536, 864] },
"output_format": { "type": "string", "enum": ["png", "jpg"] }
},
"required": ["prompt"]
}
}],
"messages": [ { "role": "user", "content": "Generate a logo of a pineapple surfing." } ]
}Any custom tool with an input_schema is passed to the model for function calling. The response contains tool_use blocks with the arguments:
{
"type": "message",
"role": "assistant",
"model": "root-ai-flash",
"content": [
{
"type": "tool_use",
"id": "call_abc123",
"name": "weather_lookup",
"input": { "city": "Cebu" }
}
],
"stop_reason": "tool_use",
...
}Analyze images with root-ai-vision. Send image blocks as base64 data URIs or direct URLs in user messages (up to 8 per request, 12MB each).
{
"model": "root-ai-vision",
"max_tokens": 512,
"messages": [{
"role": "user",
"content": [
{ "type": "text", "text": "What is in this image?" },
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png",
"data": "iVBORw0KGgoAAAANS..."
}
}
]
}]
}
// or by URL:
// { "type": "image", "source": { "type": "url", "url": "https://example.com/pic.png" } }Include the image_generate tool (see ). The model calls it automatically and the reply includes the finished image URL:
Here's your image:

// response also contains the tool_use block:
{
"type": "tool_use",
"id": "call_xyz",
"name": "image_generate",
"input": { "prompt": "...", "width": 1536, "height": 1024, "output_format": "png" }
}Image generation is available on Basic+ plans with daily limits: Basic 50/day · Pro 100/day · Business unlimited.
Prompt caching is automatic. Repeating prefixes — system instructions and conversation history — are cached on the provider side, so long multi-round conversations get faster and cheaper with no extra config.
// usage shows cached tokens per response
"usage": {
"input_tokens": 14210,
"output_tokens": 512,
"input_tokens_details": { "cached_tokens": 13880 } // hit the cache
}
// Tips for best cache hits:
// 1. Keep system instructions stable between turns.
// 2. Re-send conversation history in the same order.
// 3. Only append new messages at the end.Set "stream": true for Server-Sent Events (SSE) in the standard Anthropic format.
curl -N https://root-ai.org/v1/messages \
-H "x-api-key: rootai_YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "root-ai-flash",
"max_tokens": 512,
"stream": true,
"messages": [{ "role": "user", "content": "Tell me a story" }]
}'| Event | Purpose |
|---|---|
| message_start | Response started (message id, model, initial usage). |
| content_block_start | A text or tool_use block begins. |
| content_block_delta | Incremental content: text_delta or input_json_delta (tool arguments). |
| content_block_stop | Block finished. |
| message_delta | stop_reason (end_turn / tool_use) + output tokens. |
| message_stop | Response complete. |
| ping | Keep-alive during long tool execution. |
| error | Stream failed — Anthropic error shape. |
Because the API is Anthropic-compatible, you never need Root AI-specific client libraries. Just swap the base URL and key.
| Setting | Value |
|---|---|
| Base URL | https://root-ai.orgor https://root-ai.org/v1 — both work. SDKs append /v1/messages themselves. |
| API key | Your rootai_... key (x-api-key header). |
| Anthropic version | Any — requests are version-agnostic. |
Works with: Kilo, Cline, Claude Code, Anthropic SDKs (TypeScript / Python), and any tool that accepts a custom Anthropic endpoint.
https://root-ai.orgrootai_... keyroot-ai-flash / root-ai-pro / root-ai-visionCreate a message. Stream with "stream": true.
| Field | Type | Description |
|---|---|---|
| model | string | Required. Root AI model id (see Models). |
| messages | array | Required. Chat history: role + content blocks (text, image, tool_use, tool_result, thinking). |
| max_tokens | integer | Max output tokens. Default 2048, max 16384. |
| system | string | array | System prompt — string or text blocks. |
| tools | array | web_search server tool, image_generate, or custom tools with input_schema. |
| stream | boolean | SSE streaming (Anthropic events). |
| reasoning_effort | string | instant · standard · medium · high · xhigh |
| thinking | object | Anthropic extended thinking: {"type":"enabled","budget_tokens":N}. |
Lists models available on your plan (Anthropic format).
Estimates input tokens: { "input_tokens": 142 }. Body: messages, system, tools.
{
"id": "msg_...",
"type": "message",
"role": "assistant",
"model": "root-ai-flash",
"content": [ { "type": "text", "text": "..." } ],
"stop_reason": "end_turn", // or "tool_use"
"stop_sequence": null,
"usage": { "input_tokens": 91, "output_tokens": 19 }
}Root AI can read and repair files on your own machine directly from the chat. Install the Root AI Agent desktop app, pin your project folders, and simply describe what needs fixing — the agent does the work on your computer with automatic backups.
Root AI Agent.exe (portable). If SmartScreen appears, click More info → Run anyway.Root AI Agent, then in Terminal run xattr -cr "Root AI Agent.app" (removes the Gatekeeper quarantine flag — the app is not notarized yet), then open it.| Protection | What it does |
|---|---|
| Sensitive files | Private keys, certificates and credential stores can never be read or written. .env files CAN be read and edited so the agent can fix project configuration. |
| Project confinement | File edits stay inside the active project; browse_folders only lists folders. |
| Automatic backups | Every edited file is backed up to .kilocode-backups/ inside your project first. |
| Command allowlist | Only safe commands (php, composer, npm, git, …) run — no chaining, piping or redirection. |
| Desktop only | Coding tools appear only for desktop browsers; the agent app runs on your own machine with your own credentials. |