List an Agent Gateway's models
Lists the models the instance serves. Each has the name a request uses, the Telnyx Inference model behind it, and its price per million tokens.
GET
/
agent_gateways
/
{instance_id}
/
models
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.agentGateways.retrieveModels('instance_id');
console.log(response.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
)
response = client.agent_gateways.retrieve_models(
"instance_id",
)
print(response.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"),
)
response, err := client.AgentGateways.GetModels(
context.TODO(),
"instance_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.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().retrieveModels("instance_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.agent_gateways.retrieve_models("instance_id")
puts(response)<?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 {
$response = $client->agentGateways->retrieveModels(
'instance_id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways retrieve-models \
--api-key 'My API Key' \
--instance-id 32ce035d-3165-4031-b1a7-a7c0c259590acurl --request GET \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/models \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "4e416b40-84f1-46e4-9935-bb75079e4b08",
"name": "DeepSeek-V4.1-Flash",
"model": "deepseek-ai/DeepSeek-V4.1-Flash",
"pricing": {
"input": 0.3,
"output": 1.2,
"cached_input": 0.006,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:48.436741Z"
},
{
"id": "bc74a861-f8ed-4963-a15c-c7670811220a",
"name": "GLM-5.3",
"model": "zai-org/GLM-5.3",
"pricing": {
"input": 1.25,
"output": 4,
"cached_input": 0.24,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:48.684077Z"
},
{
"id": "4384def6-12c6-47ae-b67b-9d153fd5a58d",
"name": "GLM-5.3-Flash",
"model": "zai-org/GLM-5.3-Flash",
"pricing": {
"input": 0.135,
"output": 0.45,
"cached_input": 0.027,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:48.862281Z"
},
{
"id": "879ec00c-399a-4937-b9d3-362b2a4deaaf",
"name": "Qwen3.8-27B",
"model": "Qwen/Qwen3.8-27B",
"pricing": {
"input": 0.4,
"output": 3,
"cached_input": 0.05,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:49.168161Z"
},
{
"id": "0adc4aae-1b3b-498f-ba75-9db64cbef0af",
"name": "Qwen3.8-27B-nothink",
"model": "Qwen/Qwen3.8-27B",
"pricing": {
"input": 0.4,
"output": 3,
"cached_input": 0.05,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:49.289731Z"
}
]
}{
"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 response = await client.agentGateways.retrieveModels('instance_id');
console.log(response.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
)
response = client.agent_gateways.retrieve_models(
"instance_id",
)
print(response.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"),
)
response, err := client.AgentGateways.GetModels(
context.TODO(),
"instance_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.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().retrieveModels("instance_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.agent_gateways.retrieve_models("instance_id")
puts(response)<?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 {
$response = $client->agentGateways->retrieveModels(
'instance_id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways retrieve-models \
--api-key 'My API Key' \
--instance-id 32ce035d-3165-4031-b1a7-a7c0c259590acurl --request GET \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/models \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "4e416b40-84f1-46e4-9935-bb75079e4b08",
"name": "DeepSeek-V4.1-Flash",
"model": "deepseek-ai/DeepSeek-V4.1-Flash",
"pricing": {
"input": 0.3,
"output": 1.2,
"cached_input": 0.006,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:48.436741Z"
},
{
"id": "bc74a861-f8ed-4963-a15c-c7670811220a",
"name": "GLM-5.3",
"model": "zai-org/GLM-5.3",
"pricing": {
"input": 1.25,
"output": 4,
"cached_input": 0.24,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:48.684077Z"
},
{
"id": "4384def6-12c6-47ae-b67b-9d153fd5a58d",
"name": "GLM-5.3-Flash",
"model": "zai-org/GLM-5.3-Flash",
"pricing": {
"input": 0.135,
"output": 0.45,
"cached_input": 0.027,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:48.862281Z"
},
{
"id": "879ec00c-399a-4937-b9d3-362b2a4deaaf",
"name": "Qwen3.8-27B",
"model": "Qwen/Qwen3.8-27B",
"pricing": {
"input": 0.4,
"output": 3,
"cached_input": 0.05,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:49.168161Z"
},
{
"id": "0adc4aae-1b3b-498f-ba75-9db64cbef0af",
"name": "Qwen3.8-27B-nothink",
"model": "Qwen/Qwen3.8-27B",
"pricing": {
"input": 0.4,
"output": 3,
"cached_input": 0.05,
"currency": "USD",
"unit": "1M_tokens"
},
"priced_at": "2026-10-29T14:53:49.289731Z"
}
]
}{
"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"
}
}
]
}