Update gateway token key
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.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const TokenKey = await client.llmTokenGateway.tokenKeys.update('id', {
max_parallel_requests: 'max_parallel_requests',
'Idempotency-Key': 'idempotency-key',
'If-Match': 'if-match',
});
console.log(TokenKey.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
token_key = client.llm_token_gateway.token_keys.update(
id="id",
max_parallel_requests="max_parallel_requests",
idempotency_key="idempotency-key",
if_match="if-match",
)
print(token_key.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
tokenKey, err := client.LlmTokenGateway.TokenKeys.Update(
context.TODO(),
"id",
telnyx.LlmTokenGatewayTokenKeyUpdateParams{
MaxParallelRequests: telnyx.String("max_parallel_requests"),
IdempotencyKey: "idempotency-key",
IfMatch: "if-match",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", tokenKey.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.llmTokenGateway.tokenKeys.TokenKeyUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TokenKeyUpdateParams params = TokenKeyUpdateParams.builder()
.maxParallelRequests("max_parallel_requests")
.idempotencyKey("idempotency-key")
.ifMatch("if-match")
.build();
var response = client.llmTokenGateway().tokenKeys().update("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
token_key = telnyx.llm_token_gateway.token_keys.update(
"id",
max_parallel_requests: "max_parallel_requests",
idempotency_key: "idempotency-key",
if_match: "if-match"
)
puts(token_key)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$token_key = $client->llmTokenGateway->tokenKeys->update(
'id',
max_parallel_requests: 'max_parallel_requests',
idempotencyKey: 'idempotency-key',
ifMatch: 'if-match',
);
var_dump($token_key);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx llm-token-gateway:token-keys update \
--api-key 'My API Key' \
--id id \
--max-parallel-requests max_parallel_requests \
--idempotency-key idempotency-key \
--if-match if-matchcurl --request PATCH \
--url https://api.telnyx.com/v2/llm_token_gateway/token_keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'If-Match: <if-match>' \
--data '
{
"max_parallel_requests": 5
}
'{
"data": {
"record_type": "token_key",
"id": "11111111-1111-4111-8111-111111111111",
"created_at": "2026-10-07T08:00:00Z",
"updated_at": "2026-10-07T08:00:00Z",
"version": 1,
"name": "support-backend",
"token_group_id": "11111111-1111-4111-8111-111111111111",
"token_user_id": null,
"max_budget": 1000,
"budget_duration": "1d",
"tpm_limit": 10000000,
"rpm_limit": 6000,
"allowed_models": null,
"expires_at": null,
"blocked": false,
"required_end_user_id": false,
"spend": 0,
"reserved_spend": 0,
"budget_started_at": null,
"resets_at": null,
"max_parallel_requests": 5,
"provisioning": "ready"
}
}{
"errors": [
{
"code": "invalid_request",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "unauthorized",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "unauthorized",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "not_found",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "idempotency_conflict",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "precondition_failed",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "precondition_required",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "rate_limit_exceeded",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "invalid_request",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "enforcement_unavailable",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "invalid_request",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}Authorizations
Management-only Telnyx account credential.
Headers
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.
1 - 128^[A-Za-z0-9_-]+$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.
1 - 256^[^\u0000-\u001f\u007f]+$Path Parameters
Body
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.
1 <= x <= 10001 - 256^[^\u0000-\u001f\u007f]+$Omitted or null defaults to the maximum (1000 USD) (on a blocked key, null is kept until the key is unblocked); a value below the minimum (0.000001 USD) 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. The default budget is lifetime unless budget_duration is set. Budgets and spend are an enforcement guard computed at one flat placeholder rate for every Telnyx-hosted model (rate_version telnyx-reference-v1: 5 USD per million input and 15 USD per million output tokens), not the customer's bill; Telnyx Inference usage is billed separately at the model's actual price.
0.000001 <= x <= 1000Must be a multiple of 0.0000011d, 7d, 30d, null 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.
1 <= x <= 10000000Omitted 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.
1 <= x <= 600010001 - 256^[^\u0000-\u001f\u007f]+$Require a nonempty caller-asserted end-user ID; not proof of identity. Omission preserves the current requirement.
Response
OK
Show child attributes
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const TokenKey = await client.llmTokenGateway.tokenKeys.update('id', {
max_parallel_requests: 'max_parallel_requests',
'Idempotency-Key': 'idempotency-key',
'If-Match': 'if-match',
});
console.log(TokenKey.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
token_key = client.llm_token_gateway.token_keys.update(
id="id",
max_parallel_requests="max_parallel_requests",
idempotency_key="idempotency-key",
if_match="if-match",
)
print(token_key.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
tokenKey, err := client.LlmTokenGateway.TokenKeys.Update(
context.TODO(),
"id",
telnyx.LlmTokenGatewayTokenKeyUpdateParams{
MaxParallelRequests: telnyx.String("max_parallel_requests"),
IdempotencyKey: "idempotency-key",
IfMatch: "if-match",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", tokenKey.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.llmTokenGateway.tokenKeys.TokenKeyUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TokenKeyUpdateParams params = TokenKeyUpdateParams.builder()
.maxParallelRequests("max_parallel_requests")
.idempotencyKey("idempotency-key")
.ifMatch("if-match")
.build();
var response = client.llmTokenGateway().tokenKeys().update("id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
token_key = telnyx.llm_token_gateway.token_keys.update(
"id",
max_parallel_requests: "max_parallel_requests",
idempotency_key: "idempotency-key",
if_match: "if-match"
)
puts(token_key)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$token_key = $client->llmTokenGateway->tokenKeys->update(
'id',
max_parallel_requests: 'max_parallel_requests',
idempotencyKey: 'idempotency-key',
ifMatch: 'if-match',
);
var_dump($token_key);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx llm-token-gateway:token-keys update \
--api-key 'My API Key' \
--id id \
--max-parallel-requests max_parallel_requests \
--idempotency-key idempotency-key \
--if-match if-matchcurl --request PATCH \
--url https://api.telnyx.com/v2/llm_token_gateway/token_keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'If-Match: <if-match>' \
--data '
{
"max_parallel_requests": 5
}
'{
"data": {
"record_type": "token_key",
"id": "11111111-1111-4111-8111-111111111111",
"created_at": "2026-10-07T08:00:00Z",
"updated_at": "2026-10-07T08:00:00Z",
"version": 1,
"name": "support-backend",
"token_group_id": "11111111-1111-4111-8111-111111111111",
"token_user_id": null,
"max_budget": 1000,
"budget_duration": "1d",
"tpm_limit": 10000000,
"rpm_limit": 6000,
"allowed_models": null,
"expires_at": null,
"blocked": false,
"required_end_user_id": false,
"spend": 0,
"reserved_spend": 0,
"budget_started_at": null,
"resets_at": null,
"max_parallel_requests": 5,
"provisioning": "ready"
}
}{
"errors": [
{
"code": "invalid_request",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "unauthorized",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "unauthorized",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "not_found",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "idempotency_conflict",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "precondition_failed",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "precondition_required",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "rate_limit_exceeded",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "invalid_request",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "enforcement_unavailable",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}{
"errors": [
{
"code": "invalid_request",
"title": "Request could not be completed",
"detail": "Check the request and the documented handling for this error.",
"meta": {
"request_id": "11111111-1111-4111-8111-111111111111"
}
}
]
}