Skip to main content

Overview

Smart Routing automatically selects a model from a configured model pool according to request complexity. In the System API, a route is represented by an API-key record with smart_routing: true; it uses the same /api/token/ create, update, status, reveal, and delete endpoints as a standard key. The stored tier object also contains reasoning. The current console sets it to the same model as simple for compatibility.
smart_route_tiers is a JSON-encoded string. Do not send it as a nested JSON object.

Read the current presets

Preset model IDs are deployment configuration. Retrieve them from /api/status instead of copying model names from screenshots:
The first check stops the workflow when Smart Routing is disabled or auto is not advertised as a routing alias. Select a preset and normalize the compatibility field:
Verify that all three active tiers contain model IDs available to the selected group. Compare them case-insensitively against .data.smart_routing_excluded_models; excluded models cannot be selected.

Create a Smart Routing key

Creation does not return an ID. Locate the route with exclude_smart_routing=false:

Update the model pool

Read the current record and modify the decoded tier configuration. The update body must preserve every other mutable field.
Changes apply to subsequent requests made with the route key.

Reveal and use the route key

Use the inference endpoint and set model to auto:
Do not send the system access token to the inference endpoint.

Routing statistics

Read aggregate statistics for all route keys:
Filter by key and Unix-second time range:
The response includes requests, actual_quota, saved_quota, daily entries with baseline and actual, tier_dist, and trial_start_ts. Read current service-fee and trial configuration from /api/status:

Operational constraints

  • Requests use the OpenAI-compatible /v1/chat/completions format.
  • Claude targets are accessed through OpenAI compatibility mode, so Claude-native-only features may not be available.
  • Switching target models can prevent provider-side prompt-cache reuse.
  • Disable a route through the status-only update endpoint before deleting it when rotating production credentials.
For the console workflow and integration links, see Smart Routing.