Skip to content
Open CastalyConsole

Platform features

Smart API Key

One key that reaches every model your account can use, with a routing strategy instead of a fixed group.

An ordinary API key is bound to one routing group, so it can only call the models that group serves. A Smart API Key is bound to auto: it can call every model your account has access to, and it resolves the routing group per request.

Create one in API Keys with Create Smart API Key. Nothing changes on the client side — same base URL, same Authorization: Bearer header.

  1. The gateway collects every routing group your account may use.
  2. It keeps the groups that currently have a channel for the model ID you sent.
  3. It orders the remaining candidates by the key’s routing strategy.
  4. It sends the request to the first candidate, and continues to the next one when that group runs out of usable channels for the model.

Because step 2 runs per request, a model that only one group serves still works, and a group that is momentarily unusable is skipped instead of failing the call.

Strategy Order of candidate groups
Balanced (default) Starts in the middle of the price range, works up to the most expensive candidate, then back down through the cheaper ones.
Stability first Highest group multiplier first.
Low price first Lowest group multiplier first.

The strategy is a property of the key and can be changed on an existing key; the next request uses the new order.

A request is billed with the multiplier of the group that actually served it, not of the strategy’s first choice. The consume log records the resolved group and the strategy, so a switch is visible after the fact. See Usage and cost.

  • No per-model allowlist. A Smart API Key always follows your account’s current model access, so a newly released model works without editing the key.
  • Quota, expiry date, and IP allowlist work as on any other key.
  • A Smart API Key does not take a manual fallback list — it already walks every group your account can use. Ordered chains are for ordinary keys; see Group failover.