Skip to main content
POST
Record a Routing Correction
Records a single routing correction — a turn where the developer disagreed with the resolved mode and supplied the mode they expected. Theo keeps the last 30 days of corrections per caller and clusters them by expected_mode; once a cluster crosses the threshold, the playground surfaces an “I noticed a pattern” toast and the developer can ask Theo to suggest a rule derived from the cluster. Corrections are personal-or-team scoped (matching the caller’s active org context) so a personal correction never triggers a team-level suggestion banner.

Authentication

Requires a Bearer token with the billing API key scope. Idempotent — the same Idempotency-Key header replays the same response.

Body

string
required
The prompt that produced the unexpected mode. 1–4096 chars. Vendor-name scrubbed at the service layer.
string
required
The Theo mode the developer expected (e.g. "think", "image", "insurance_quote").
string
Optional message id of the turn the correction is attached to. ≤128 chars.

Request Examples

curl

Response

When pattern_suggestion_available is true, call POST /api/v1/routing-preferences/suggest-rule with the matching expected_mode to receive a deterministic regex derived from the cluster.

Errors

  • 400 routing_correction_invalid — Generic shape failure.
  • 400 routing_correction_vendor_name — Prompt mentions an upstream provider name (Claude, OpenAI, etc.).
  • 400 routing_correction_invalid_modeexpected_mode isn’t a known Theo mode.