AI Gateway

Create gateway token group

Changed on

Create gateway token group within the authenticated Telnyx account. Foreign and unknown resource IDs return the same 404 response.

post/llm_token_gateway/token_groups

Request

  • Base URL: https://api.telnyx.com/v2
  • URL: https://api.telnyx.com/v2/llm_token_gateway/token_groups
  • Auth: HTTP bearer

Headers

Idempotency-Keystring required

24h, scoped by account+method+path. Same key/body returns same outcome; changed body 409; in-progress 409 with Retry-After. Token-create replay returns 200 metadata WITHOUT secret.

Request body

namestring required
max_budgetnumber

USD, decimal precision at most 6 places; parse exactly to integer micro-USD, never binary float accounting.

budget_duration'1d' | '7d' | '30d' | 'null' nullable
tpm_limitinteger nullable
rpm_limitinteger nullable
allowed_modelsstring[] required
max_parallel_requestsinteger nullable

Optional maximum concurrent reserved/dispatched cache misses across replicas. Null means no concurrency cap. Cache hits do not consume slots; unknown usage retains its budget hold without a slot.

cache_ttlinteger nullable
provider_key_idsstring[]
fallbacksobject nullable

Per-group model fallbacks: primary alias -> ordered list of 1..3 other aliases. Every key and listed alias must be in allowed_models (a PATCH removing a referenced alias is 400); a chain never lists its own key; wildcards are rejected. Chains are one level deep (a step's own chain is not expanded). Fallback is attempted only for managed routes, only before the first provider event is forwarded, and only to steps the key may use; each attempt is reserved and recorded. {} and null both disable fallbacks.

blockedboolean

Response

OK

Changes