List keys
Lists the instance’s keys, without their values. Returns the first 100. The instance must be ready; otherwise the request answers 409.
GET
/
agent_gateways
/
{instance_id}
/
keys
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const response of client.agentGateways.keys.list()) {
console.log(response);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.agent_gateways.keys.list(
"instance_id",
)
print(page.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"),
)
keys, err := client.AgentGateways.Keys.List(
context.TODO(),
"instance_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", keys.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 page = client.agentGateways().keys().list("instance_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.agent_gateways.keys.list("instance_id")
puts(page)<?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 {
$page = $client->agentGateways->keys->list(
'instance_id',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways:keys list \
--api-key 'My API Key' \
--instance-id ecffdf4b-93ea-4a7b-8295-51dfd2077996curl --request GET \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/keys \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "5f1c3a0e9b7d4c2a8e6f0b1d3c5a7e9f2b4d6c8a0e1f3a5c7e9b1d3f5a7c9e0b",
"name": "support-agent",
"team_id": "0b6c5d4e-3f2a-4b1c-9d8e-7f6a5b4c3d2e",
"models": [
"GLM-5.3-Flash"
],
"max_budget": 20,
"budget_resets_every": "30d",
"budget_resets_at": "2026-11-20T19:40:00Z",
"spend": 0,
"expires_at": null,
"created_at": "2026-10-21T19:40:00Z",
"blocked": false,
"requests_per_minute": 60,
"tokens_per_minute": null,
"max_parallel_requests": 4
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}{
"errors": [
{
"code": "99901",
"title": "Instance not ready",
"detail": "The instance is not ready; its engine is not running."
}
]
}{
"errors": [
{
"code": "99903",
"title": "Engine unavailable",
"detail": "The instance's engine did not answer; try again shortly."
}
]
}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
});
// Automatically fetches more pages as needed.
for await (const response of client.agentGateways.keys.list()) {
console.log(response);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.agent_gateways.keys.list(
"instance_id",
)
print(page.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"),
)
keys, err := client.AgentGateways.Keys.List(
context.TODO(),
"instance_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", keys.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 page = client.agentGateways().keys().list("instance_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.agent_gateways.keys.list("instance_id")
puts(page)<?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 {
$page = $client->agentGateways->keys->list(
'instance_id',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways:keys list \
--api-key 'My API Key' \
--instance-id ecffdf4b-93ea-4a7b-8295-51dfd2077996curl --request GET \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/keys \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "5f1c3a0e9b7d4c2a8e6f0b1d3c5a7e9f2b4d6c8a0e1f3a5c7e9b1d3f5a7c9e0b",
"name": "support-agent",
"team_id": "0b6c5d4e-3f2a-4b1c-9d8e-7f6a5b4c3d2e",
"models": [
"GLM-5.3-Flash"
],
"max_budget": 20,
"budget_resets_every": "30d",
"budget_resets_at": "2026-11-20T19:40:00Z",
"spend": 0,
"expires_at": null,
"created_at": "2026-10-21T19:40:00Z",
"blocked": false,
"requests_per_minute": 60,
"tokens_per_minute": null,
"max_parallel_requests": 4
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}{
"errors": [
{
"code": "99901",
"title": "Instance not ready",
"detail": "The instance is not ready; its engine is not running."
}
]
}{
"errors": [
{
"code": "99903",
"title": "Engine unavailable",
"detail": "The instance's engine did not answer; try again shortly."
}
]
}