Set up
Connect your agent in four steps.
You need a REA key, your own model key, and this base URL. Any client that accepts a custom base URL and one extra header works: Continue, Cline, the OpenAI SDK, or curl.
https://api.reacontrolplane.com/v1
Set up in four steps
1. Get a key
Open Trial signup: name, work email, and company (phone optional). No card. Your REA key is shown once, so copy it right away. We cannot email a recovery copy yet.
2. Set the base URL
Point your client at https://api.reacontrolplane.com/v1 and use your REA key as the API key. It is sent as Authorization: Bearer YOUR_REA_API_KEY.
3. Add one header
Add X-Upstream-Api-Key with your own OpenAI, Anthropic, xAI, or Google AI Studio key. You pay that vendor directly; REA does not bill tokens.
Authorization: Bearer YOUR_REA_API_KEY X-Upstream-Api-Key: YOUR_MODEL_KEY Content-Type: application/json
4. Send a test call
Look for rea_meta in the reply.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_REA_API_KEY",
base_url="https://api.reacontrolplane.com/v1",
default_headers={"X-Upstream-Api-Key": "YOUR_MODEL_KEY"},
)
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Reply with exactly: REA LIVE"}],
)
print(resp.choices[0].message.content)
Or with curl:
curl -s https://api.reacontrolplane.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_REA_API_KEY" \
-H "X-Upstream-Api-Key: YOUR_MODEL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role":"user","content":"Reply with exactly: REA LIVE"}]
}'
Same URL and REA key for every vendor. Change only model and the vendor key in X-Upstream-Api-Key. Do not point base_url at the vendor host after this.
Pick the vendor with model
model | Vendor key in X-Upstream-Api-Key | Extra header |
|---|---|---|
gpt-* (try gpt-4o-mini) | OpenAI (sk-…) | none |
claude-* (try claude-haiku-4-5-20251001) | Anthropic (sk-ant-…) | X-REA-Upstream: anthropic if the model name is not claude-* |
grok-* (try grok-3-mini) | xAI | none |
gemini-* (try gemini-flash-latest) | Google AI Studio | none |
The key in X-Upstream-Api-Key must match the vendor. A wrong pairing fails upstream; REA does not swap keys for you. REA does not host models and does not bill tokens. X-REA-Upstream is only for Anthropic; xAI and Gemini do not need it.
stream: true is supported.
Health
curl -s https://api.reacontrolplane.com/health
You want "status": "INTEGRATED", "byok": true, "anthropic": true, "xai": true, "gemini": true, version 1.4.8-prod.
POST requests to /v1/chat/completions.Continue or Cline
- Choose an OpenAI-compatible provider.
- Set the base URL to
https://api.reacontrolplane.com/v1. - Set the API key to your REA key.
- Add a custom header
X-Upstream-Api-Keywith your model key.
X-Upstream-Api-Key is required for all four vendors, not just Claude. Point model at gpt-4o-mini, claude-haiku-4-5-20251001, grok-3-mini, or gemini-flash-latest and set that header to the matching vendor key. Add a separate entry per vendor if you want to switch without editing config. Claude also takes X-REA-Upstream: anthropic; Grok and Gemini do not.
Continue: use an OpenAI-compatible / custom provider. Base URL https://api.reacontrolplane.com/v1, API key = your REA key, custom header X-Upstream-Api-Key = the matching vendor key, model = one of those four IDs.
Cline: choose API Provider OpenAI Compatible, set Base URL to https://api.reacontrolplane.com/v1, API Key to your REA key, add the custom header X-Upstream-Api-Key, and pick one of those four models. Step-by-step: Cline gallery.
Those values live in the tool config. There is no website login. A 402 means the monthly loop pool is empty — the agent is not logged out.
What each request does
- Check the REA key. Apply the rate window and loop budget.
- PreFlight checks your declared deny rules. A match is refused with a reason before any vendor call ($0).
- TraceGuard classifies tool calls (observe mode).
- If the messages carry code, LoopGuard hashes the structure.
- Cache hit → replay the stored stop. No model call.
- Otherwise probe the snippet against a fixed time box.
- On a trap, the GPT path may attach logit bias for the next generate.
- Forward the same messages with your upstream key.
- For calls that use tools, TraceGuard records a class-only receipt (tool names, class, response label); no message content.
- Return the vendor text plus
rea_meta.
LoopGuard fixtures
Fences are optional. json.dumps is required. Continue and Cline often send a fenced block. Hermes and raw SDKs often send raw text. Prose that only mentions while True is NO_CODE, not a trap and not a 422.
Raw (benches / SDK):
{
"model": "gpt-4o-mini",
"messages": [{
"role": "user",
"content": "import time\nwhile True: pass"
}]
}
Fenced (Continue):
{
"model": "gpt-4o-mini",
"messages": [{
"role": "user",
"content": "```python\nwhile True:\n pass\n```"
}]
}
First call: HTTP 200, mode=block, sandbox_status=BLOCKED_TIMEOUT, stopped at the probe time box. Repeat: HTTP 200, mode=cache, cache_hit=true, sandbox_status=CACHE_HIT, same structural_hash.
The small receipt: rea_meta
| Field | Meaning |
|---|---|
mode | openai, anthropic, xai, or gemini means the vendor was called. block means LoopGuard stopped a first-seen trap. cache means REA replayed the stored stop. |
cache_hit | true when the model was skipped. |
structural_hash | Fingerprint of the extracted code. |
sandbox_status | BLOCKED_TIMEOUT, CRASHED, SYNTAX_REJECT (extracted code failed to parse), SUCCESS, or NO_CODE. A replay of a stored stop reports CACHE_HIT. |
sandbox_ms | How long the probe ran. |
Status codes
| HTTP | Meaning |
|---|---|
| 400 | Missing X-Upstream-Api-Key. No loop burned. |
| 401 | Missing or invalid REA key. |
| 402 | Loop balance is 0. |
| 403 | Key is inactive. |
| 422 | Empty or invalid JSON body (no model / messages, or Content-Length: 2 which is {}). LoopGuard does not return 422. Rebuild the body with json.dumps. |
| 429 | You went over your plan's requests per minute. On streaming calls, a 429 from your model vendor is passed through as is. |
Plans
| Plan | Requests per minute | Loops included | Price |
|---|---|---|---|
| Free Trial | 20 / min | 2,000 loops | $0 · self-serve, no card |
| Developer Pro | 60 / min | 50,000 / mo | $79 / mo |
| Growth Team | 300 / min | 250,000 / mo | $299 / mo |
| Enterprise | 1,000 / min | 2,000,000 / mo | from $1,500 / mo · invoiced |
LoopGuard, PreFlight and TraceGuard are included in every tier, from the free Trial to Enterprise. No add-ons.