Retrieve an Agent Gateway
Returns one of the account’s Agent Gateway instances.
GET
/
agent_gateways
/
{instance_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 AgentGateway = await client.agentGateways.retrieve('instance_id');
console.log(AgentGateway.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
)
agent_gateway = client.agent_gateways.retrieve(
"instance_id",
)
print(agent_gateway.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"),
)
agentGateway, err := client.AgentGateways.Get(
context.TODO(),
"instance_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", agentGateway.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.agentGateways().retrieve("instance_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
agent_gateway = telnyx.agent_gateways.retrieve("instance_id")
puts(agent_gateway)<?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 {
$agent_gateway = $client->agentGateways->retrieve(
'instance_id',
);
var_dump($agent_gateway);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways retrieve \
--api-key 'My API Key' \
--instance-id ecffdf4b-93ea-4a7b-8295-51dfd2077996curl --request GET \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "ecffdf4b-93ea-4a7b-8295-51dfd2077996",
"name": "support-gw",
"engine": "litellm",
"engine_version": "v1.105.1",
"status": "ready",
"gateway_url": "http://172.27.0.3:4000",
"wireguard_interface_id": "c788eb40-a4c0-4bf5-8f84-976027960f8e",
"network_id": "7ade8c3c-95a7-447b-92f2-c829f760159c",
"created_at": "2026-10-21T19:32:48.377714Z"
}
}{
"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"
}
}
]
}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 AgentGateway = await client.agentGateways.retrieve('instance_id');
console.log(AgentGateway.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
)
agent_gateway = client.agent_gateways.retrieve(
"instance_id",
)
print(agent_gateway.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"),
)
agentGateway, err := client.AgentGateways.Get(
context.TODO(),
"instance_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", agentGateway.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.agentGateways().retrieve("instance_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
agent_gateway = telnyx.agent_gateways.retrieve("instance_id")
puts(agent_gateway)<?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 {
$agent_gateway = $client->agentGateways->retrieve(
'instance_id',
);
var_dump($agent_gateway);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways retrieve \
--api-key 'My API Key' \
--instance-id ecffdf4b-93ea-4a7b-8295-51dfd2077996curl --request GET \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "ecffdf4b-93ea-4a7b-8295-51dfd2077996",
"name": "support-gw",
"engine": "litellm",
"engine_version": "v1.105.1",
"status": "ready",
"gateway_url": "http://172.27.0.3:4000",
"wireguard_interface_id": "c788eb40-a4c0-4bf5-8f84-976027960f8e",
"network_id": "7ade8c3c-95a7-447b-92f2-c829f760159c",
"created_at": "2026-10-21T19:32:48.377714Z"
}
}{
"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"
}
}
]
}