Get gateway token key
Get gateway token key within the authenticated Telnyx account. Foreign and unknown resource IDs return the same 404 response.
GET
/
llm_token_gateway
/
token_keys
/
{id}
JavaScript
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.retrieve('id');
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.retrieve(
"id",
)
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.Get(
context.TODO(),
"id",
)
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;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.llmTokenGateway().tokenKeys().retrieve("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
token_key = telnyx.llm_token_gateway.token_keys.retrieve("id")
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->retrieve(
'id',
);
var_dump($token_key);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx llm-token-gateway:token-keys retrieve \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/llm_token_gateway/token_keys/{id} \
--header 'Authorization: Bearer <token>'{
"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"
}
}
]
}Was this page helpful?
JavaScript
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.retrieve('id');
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.retrieve(
"id",
)
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.Get(
context.TODO(),
"id",
)
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;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.llmTokenGateway().tokenKeys().retrieve("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
token_key = telnyx.llm_token_gateway.token_keys.retrieve("id")
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->retrieve(
'id',
);
var_dump($token_key);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx llm-token-gateway:token-keys retrieve \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/llm_token_gateway/token_keys/{id} \
--header 'Authorization: Bearer <token>'{
"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"
}
}
]
}