POST /v1/messages) via
ANTHROPIC_BASE_URL. That path has the best trace reconstruction, supports training, and
relegation serving (cheaper model first, frontier fallback). It matches how most agent
frameworks call Claude today.
Other common endpoints (OpenAI Chat Completions, Responses API, Gemini, etc.) work for
capture and passthrough when upstream routing is set correctly. Relegation serving
(cheaper model + frontier fallback) applies only to POST /v1/messages.
Upstream routing (operator / hosted config)
ReasonBlocks sets upstream routing on hosted gateways. Self-hosters configure:
To forward OpenAI-shaped clients, point upstream at OpenAI:
Common LLM API paths
Paths the optional client shim treats as LLM calls (forX-RB-Run / X-RB-Seq headers).
All other paths still forward through the catch-all proxy.
Anthropic (default)
ANTHROPIC_BASE_URL.
OpenAI Chat Completions
Gateway upstream must be OpenAI (hosted config or self-hostedAGENTRECON_UPSTREAM_BASE):
POST /v1/chat/completions on the gateway; traffic forwards to OpenAI.
Capture works; structured golden traces and relegation serving are weaker or unavailable
on this path (see below).
OpenAI Responses API
Same pattern as Chat Completions:OPENAI_BASE_URL at the gateway, upstream
https://api.openai.com, path /v1/responses.
Gemini and other providers
Point the client base URL at the gateway and setAGENTRECON_UPSTREAM_BASE to the provider
origin (for example https://generativelanguage.googleapis.com). URLs containing
:generateContent are recognized by the client shim for run headers.
Framework compatibility
API keys pass through upstream and are not stored by ReasonBlocks.
Feature matrix by endpoint
Training and relegation serving use flat Anthropic-shaped transcripts. If your workflow
must use the cheaper model path, run the agent on
/v1/messages even if you also capture
other provider traffic.
Relegation serving (Anthropic path only)
After training, keep the same gateway URL. Relegation routing affects onlyPOST /v1/messages:
OpenAI-shaped requests are not rewritten to the cheaper model. They passthrough to
AGENTRECON_UPSTREAM_BASE.
Enable relegation in the dashboard (hosted) or via gateway config (self-hosted). See
Quickstart steps 5–6.
Client shim paths
When using Tier B or C,rbtrace.client.install() stamps run headers
on requests matching:
/v1/messages/v1/chat/completions/v1/responses/v1/complete- paths containing
:generateContent
pip install rbtrace (when published to PyPI).
Gateway admin endpoints
Not forwarded to upstream:
Self-hosted operators: see Deployment.
Limitations
- Upstream failures return 502 with Anthropic-shaped error JSON regardless of client type.
- Cheaper-model responses are synthesized Anthropic Messages JSON (or a single SSE burst), not native provider streaming.
- Integration tests in the gateway codebase focus on
POST /v1/messages; other paths are supported by architecture but less validated end-to-end.
Related
Integrating your agent
Tier A/B/C and the optional shim.
Gateway reference
Env vars and serve contract.

