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

modelVendor key in X-Upstream-Api-KeyExtra 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)xAInone
gemini-* (try gemini-flash-latest)Google AI Studionone

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.

Opening the base URL in a browser shows Not Found. That is expected: send POST requests to /v1/chat/completions.

Continue or Cline

  1. Choose an OpenAI-compatible provider.
  2. Set the base URL to https://api.reacontrolplane.com/v1.
  3. Set the API key to your REA key.
  4. Add a custom header X-Upstream-Api-Key with 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

  1. Check the REA key. Apply the rate window and loop budget.
  2. PreFlight checks your declared deny rules. A match is refused with a reason before any vendor call ($0).
  3. TraceGuard classifies tool calls (observe mode).
  4. If the messages carry code, LoopGuard hashes the structure.
  5. Cache hit → replay the stored stop. No model call.
  6. Otherwise probe the snippet against a fixed time box.
  7. On a trap, the GPT path may attach logit bias for the next generate.
  8. Forward the same messages with your upstream key.
  9. For calls that use tools, TraceGuard records a class-only receipt (tool names, class, response label); no message content.
  10. 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

FieldMeaning
modeopenai, 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_hittrue when the model was skipped.
structural_hashFingerprint of the extracted code.
sandbox_statusBLOCKED_TIMEOUT, CRASHED, SYNTAX_REJECT (extracted code failed to parse), SUCCESS, or NO_CODE. A replay of a stored stop reports CACHE_HIT.
sandbox_msHow long the probe ran.

Status codes

HTTPMeaning
400Missing X-Upstream-Api-Key. No loop burned.
401Missing or invalid REA key.
402Loop balance is 0.
403Key is inactive.
422Empty or invalid JSON body (no model / messages, or Content-Length: 2 which is {}). LoopGuard does not return 422. Rebuild the body with json.dumps.
429You went over your plan's requests per minute. On streaming calls, a 429 from your model vendor is passed through as is.
A loop is one model call forwarded to your vendor. Calls REA stops or refuses cost no loops.

Plans

PlanRequests per minuteLoops includedPrice
Free Trial20 / min2,000 loops$0 · self-serve, no card
Developer Pro60 / min50,000 / mo$79 / mo
Growth Team300 / min250,000 / mo$299 / mo
Enterprise1,000 / min2,000,000 / mofrom $1,500 / mo · invoiced

LoopGuard, PreFlight and TraceGuard are included in every tier, from the free Trial to Enterprise. No add-ons.

Trial keys are self-serve. Name, work email, and company (phone optional). No card. Paid tiers are founder-onboarded: REA issues the key while self-serve checkout is being built. Email elijah@reacontrolplane.com. We do not store card numbers. Model tokens stay on your vendor invoice. Full pricing copy also lives on Pricing.