Getting started
Claude RC internal API
One HTTP API for every internal app that needs Claude: bots, CRMs, back-office jobs. Each call runs Claude Code headless on the team's Claude subscription, so apps no longer bundle the Claude CLI or hold the subscription token themselves.
- Internal only. Each app gets its own key. Do not expose keys in browsers or mobile apps; call the API from your backend.
- Stateless. No conversation is stored. Send the history you need with every call.
- No tools. Claude cannot browse, run code or reach your systems. It can only read the files you attach to the call.
- Shared capacity. All apps share one subscription: at most 3 answers run at once, the rest wait in a queue.
Base URL
Getting started
Quickstart
1. Ask the platform team for an app key. It starts with rc_ and is tied to your app's name in the logs.
2. Store it on your server as CLAUDE_RC_KEY.
3. Send POST /v1/messages with a prompt. The answer is in text.
4. Set your HTTP client timeout above the API's own (180 s by default): answers usually take 3 to 30 seconds.
curl https://claude-rc.apps.aerbor.com/v1/messages \
-H "Authorization: Bearer $CLAUDE_RC_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Tulis 1 kalimat sapaan untuk pelanggan baru."}'const res = await fetch("https://claude-rc.apps.aerbor.com/v1/messages", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.CLAUDE_RC_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
system: "You are a concise assistant. Answer in Indonesian.",
prompt: "Ringkas email ini dalam 3 poin: ...",
}),
});
if (!res.ok) throw new Error((await res.json()).message);
const { text } = await res.json();import os, requests
r = requests.post(
"https://claude-rc.apps.aerbor.com/v1/messages",
headers={"Authorization": f"Bearer {os.environ['CLAUDE_RC_KEY']}"},
json={"prompt": "Tulis 1 kalimat sapaan untuk pelanggan baru."},
timeout=200,
)
r.raise_for_status()
print(r.json()["text"])Getting started
Authentication
Send the app key as Authorization: Bearer rc_…. Requests without a known key get 401 unauthorized. Keys are stored only as hashes; a lost key is replaced, not recovered.
Endpoints
Create a message
Returns Claude's answer as plain text.
Body
- promptstring
- The user message. Send
promptormessages, not both. - messagesarray
- Chat history:
[{role: "user" | "assistant", content}], ending with a user message. See Conversations. - systemstring
- System prompt: role, tone, rules, output language.
- modelstring
sonnet(default),opus,haiku, or a fullclaude-*id.- filesarray
- Up to 10 files, each
{name, data}withdatain base64, max 10 MB each. See Files. - timeoutSecinteger
- Seconds to wait for the answer, 5 to 600. Default 180.
Returns
- idstring
- Request id, also in the server log.
- modelstring
- Model that answered.
- textstring
- The answer.
- usageobject
inputTokens,outputTokens,costUsd(the API-price equivalent; the subscription is not billed per call).- durationMsinteger
- Time Claude took, without queue time.
{
"id": "rc_Xk2v9QeTq1pL",
"model": "claude-sonnet-5-5",
"text": "Selamat datang! Senang Anda bergabung bersama kami.",
"usage": {
"inputTokens": 1812,
"outputTokens": 24,
"costUsd": 0.0058
},
"durationMs": 4210
}Endpoints
Get structured JSON
Same body as /v1/messages plus a JSON Schema. The answer is validated against the schema and returned in data, ready to use without parsing text.
- schemaobjectrequired
- JSON Schema of the answer. Prefer
additionalProperties: falseand arequiredlist.
Use it for extraction, classification, routing and anything your code reads.
{
"prompt": "Ambil data dari teks: \"Budi pesan 3 buket mawar untuk 21 Nov, kirim ke Kemang.\"",
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"qty",
"item",
"date",
"address"
],
"properties": {
"name": {
"type": "string"
},
"qty": {
"type": "integer"
},
"item": {
"type": "string"
},
"date": {
"type": "string"
},
"address": {
"type": "string"
}
}
}
}{
"id": "rc_P0aZ3mWw8sKd",
"model": "claude-sonnet-5-5",
"data": {
"name": "Budi",
"qty": 3,
"item": "buket mawar",
"date": "2026-11-21",
"address": "Kemang"
},
"usage": {
"inputTokens": 2240,
"outputTokens": 61,
"costUsd": 0.0076
},
"durationMs": 5630
}Endpoints
List models
Returns the default model and the aliases you can send: sonnet (default, best for most work), opus (hardest reasoning, slower and uses the subscription faster), haiku (fast, simple tasks).
Endpoints
Health
No key needed. Returns ok, the answers running now (active), the queue length (queued) and request counters since start.
Guides
Conversations
The API keeps no session. For a chat, store the history in your app and send it as messages, ending with the newest user message. Keep it short: the last 10 to 20 turns are usually enough, and every token counts against the shared subscription.
{
"system": "You are the MMG data assistant.",
"messages": [
{
"role": "user",
"content": "Berapa unit terjual bulan ini?"
},
{
"role": "assistant",
"content": "42 unit terjual per 18 November."
},
{
"role": "user",
"content": "Yang paling banyak dari cabang mana?"
}
]
}Guides
Files and images
Attach PDFs, images (PNG, JPEG, WebP, GIF), text, CSV or JSON as base64 in files. Claude reads them for this call only; they are deleted when the answer returns. Up to 10 files, 10 MB each, 40 MB per request.
Spreadsheets (XLSX) and Word files are not read directly: convert them to CSV or PDF first.
{
"prompt": "Baca invoice ini dan sebutkan total dan tanggal jatuh tempo.",
"files": [
{
"name": "invoice.pdf",
"data": "<base64>"
}
]
}Guides
Limits and queue
- 60 requests per minute per app key.
- 3 answers at once across all apps; up to 50 wait in line, then
503 busy. - The subscription itself has usage limits. When it is reached, calls fail with
429 subscription_limituntil it resets. Build retries with backoff, and do not run bulk jobs during office hours.
Guides
Errors
Errors are JSON: {"error": "code", "message": "…"}.
| Status | Code | When |
|---|---|---|
| 400 | invalid_request / invalid_model / invalid_messages / invalid_file | The body is wrong; the message says what. |
| 401 | unauthorized | Missing or unknown app key. |
| 429 | rate_limited | Over 60 requests per minute for your app. |
| 429 | subscription_limit | The Claude subscription hit its usage limit. Retry later, or queue the work. |
| 502 | claude_error / bad_output | Claude Code failed or returned nothing usable. Retry once. |
| 503 | busy | More than 50 requests already waiting. |
| 504 | timeout | No answer within timeoutSec. |