CDAPI DOCS

SMART ROUTING

Choose the lowest-cost available route within the correct model boundary

A smart group is not another model. It selects among token groups that support the requested model and are available to the current user.

How smart routing works

Direct answer

Select a smart group when creating the key, but continue sending a real model ID. CDAPI filters compatible token groups, ranks them by the user's effective multiplier, and tries them in order.

  1. Validate the model against the smart group's capability boundary.
  2. Read enabled channels and token groups for that model.
  3. Remove unavailable groups, invalid multipliers, and incompatible image groups.
  4. Rank the remaining groups by effective user price.

Four smart groups

Token groupAllowedExcluded
smart:gptGPT, Codex, Cursor, and OpenAI text/reasoning modelsImage, video, Claude, GPT作图, AzGPT作图
smart:claudeClaude text modelsImage and video models
smart:gpt-imageImage generation modelsAll groups except GPT作图 and AzGPT作图
smart:seedance-videoSeedance video modelsNon-Seedance and non-video models

Selection uses the user's effective multiplier

The same model may be available in several token groups. CDAPI ranks the current user's effective route-to-group multiplier, not a single marketing number.

Compatibility comes first

A cheaper group that does not support the model never becomes a candidate. The public catalog follows the same rule.

Which failures trigger failover

Rate limits, transient upstream errors, overloads, selected 5xx responses, and equivalent transient errors wrapped in HTTP 200 can move to the next candidate. Invalid parameters, policy refusals, and context-length errors do not trigger blind retries.

Failover is bounded to prevent request loops. A client disconnect is not treated as an upstream failure.

Verify the selected route

  1. The visible group remains the smart group selected by the user.
  2. selected_group records the concrete token group that completed billing.
  3. Recovered intermediate attempts are hidden from the default log list.
  4. An administrator can inspect the full attempt chain by exact request ID.