AI Gateway

Update gateway token key

Changed on

Update gateway token key within the authenticated Telnyx account. Foreign and unknown resource IDs return the same 404 response. Omitted fields are preserved. Null clears max_parallel_requests; null resets budget and rate limits to their maximum. A stale If-Match returns 412.

patch/llm_token_gateway/token_keys/{id}

Request

  • Base URL: https://api.telnyx.com/v2
  • URL: https://api.telnyx.com/v2/llm_token_gateway/token_keys/{id}
  • 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.

If-Matchstring required

Exact quoted resource-version ETag; an exact intermediary-weakened echo W/"n" is accepted. Wildcard, combined and malformed validators are rejected; stale 412; missing 428. HTTP field names are case-insensitive. Replayed idempotent result is checked first.

Request body

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.

namestring
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

Omitted or null defaults to the maximum (10000000) (on a blocked key, null is kept until the key is unblocked); a value below the minimum (1) or above the maximum is rejected with 400 limit_out_of_range; a malformed value (negative, wrong type or precision) is 400 invalid_request. Block the key (blocked: true) to deny it; blocking is always accepted.

rpm_limitinteger nullable

Omitted or null defaults to the maximum (6000) (on a blocked key, null is kept until the key is unblocked); a value below the minimum (1) or above the maximum is rejected with 400 limit_out_of_range; a malformed value (negative, wrong type or precision) is 400 invalid_request. Block the key (blocked: true) to deny it; blocking is always accepted.

allowed_modelsstring[] nullable
expires_atstring date-time nullable
blockedboolean
required_end_user_idboolean

Require a nonempty caller-asserted end-user ID; not proof of identity. Omission preserves the current requirement.

Response

OK

Changes