Create a team
Creates a team on the instance. A team is a model list, a budget, and rate limits that its keys share. Names need not be unique; the id identifies the team. The instance must be ready; otherwise the request answers 409.
POST
/
agent_gateways
/
{instance_id}
/
teams
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const AgentGatewayTeam = await client.agentGateways.teams.create('instance_id', {
name: 'name',
});
console.log(AgentGatewayTeam.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_team = client.agent_gateways.teams.create(
instance_id="instance_id",
name="name",
)
print(agent_gateway_team.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"),
)
team, err := client.AgentGateways.Teams.New(
context.TODO(),
"instance_id",
telnyx.AgentGatewayTeamNewParams{
Name: "name",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", team.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.agentGateways.teams.TeamCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TeamCreateParams params = TeamCreateParams.builder()
.name("name")
.build();
var response = client.agentGateways().teams().create("instance_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
agent_gateway_team = telnyx.agent_gateways.teams.create("instance_id", name: "name")
puts(agent_gateway_team)<?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_team = $client->agentGateways->teams->create(
'instance_id',
name: 'name',
);
var_dump($agent_gateway_team);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways:teams create \
--api-key 'My API Key' \
--instance-id ecffdf4b-93ea-4a7b-8295-51dfd2077996 \
--name namecurl --request POST \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/teams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "support",
"models": [
"GLM-5.3-Flash",
"Qwen3.8-27B-nothink"
],
"max_budget": 50,
"budget_resets_every": "30d",
"requests_per_minute": 120
}
'{
"data": {
"id": "0b6c5d4e-3f2a-4b1c-9d8e-7f6a5b4c3d2e",
"name": "support",
"models": [
"GLM-5.3-Flash",
"Qwen3.8-27B-nothink"
],
"max_budget": 50,
"budget_resets_every": "30d",
"budget_resets_at": "2026-11-20T19:35:00Z",
"spend": 0,
"created_at": "2026-10-21T19:35:00Z",
"blocked": false,
"requests_per_minute": 120,
"tokens_per_minute": null
}
}{
"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": "10004",
"title": "Missing required parameter",
"detail": "Field required",
"source": {
"pointer": "/name"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10004"
}
}
]
}{
"errors": [
{
"code": "99903",
"title": "Engine unavailable",
"detail": "The instance's engine did not answer; try again shortly."
}
]
}Authorizations
Telnyx API key
Path Parameters
The Agent Gateway's id.
Body
application/json
A label for people.
Required string length:
1 - 100The models the team's keys may use. Leave it out to allow every model.
Maximum array length:
100Required string length:
1 - 200The most the team's keys may spend together, in USD.
Required range:
x >= 0How often the spend resets: a number and a unit, s, m, h, or d.
Pattern:
^[1-9][0-9]{0,6}[smhd]$Example:
"30d"
The most requests the team's keys may make per minute, together.
Required range:
1 <= x <= 2147483647The most tokens the team's keys may use per minute, together.
Required range:
1 <= x <= 2147483647Response
The team
A team on an instance: a model list, a budget, and rate limits that its keys share.
Show child attributes
Show child attributes
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 AgentGatewayTeam = await client.agentGateways.teams.create('instance_id', {
name: 'name',
});
console.log(AgentGatewayTeam.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_team = client.agent_gateways.teams.create(
instance_id="instance_id",
name="name",
)
print(agent_gateway_team.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"),
)
team, err := client.AgentGateways.Teams.New(
context.TODO(),
"instance_id",
telnyx.AgentGatewayTeamNewParams{
Name: "name",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", team.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.agentGateways.teams.TeamCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TeamCreateParams params = TeamCreateParams.builder()
.name("name")
.build();
var response = client.agentGateways().teams().create("instance_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
agent_gateway_team = telnyx.agent_gateways.teams.create("instance_id", name: "name")
puts(agent_gateway_team)<?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_team = $client->agentGateways->teams->create(
'instance_id',
name: 'name',
);
var_dump($agent_gateway_team);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways:teams create \
--api-key 'My API Key' \
--instance-id ecffdf4b-93ea-4a7b-8295-51dfd2077996 \
--name namecurl --request POST \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/teams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "support",
"models": [
"GLM-5.3-Flash",
"Qwen3.8-27B-nothink"
],
"max_budget": 50,
"budget_resets_every": "30d",
"requests_per_minute": 120
}
'{
"data": {
"id": "0b6c5d4e-3f2a-4b1c-9d8e-7f6a5b4c3d2e",
"name": "support",
"models": [
"GLM-5.3-Flash",
"Qwen3.8-27B-nothink"
],
"max_budget": 50,
"budget_resets_every": "30d",
"budget_resets_at": "2026-11-20T19:35:00Z",
"spend": 0,
"created_at": "2026-10-21T19:35:00Z",
"blocked": false,
"requests_per_minute": 120,
"tokens_per_minute": null
}
}{
"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": "10004",
"title": "Missing required parameter",
"detail": "Field required",
"source": {
"pointer": "/name"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10004"
}
}
]
}{
"errors": [
{
"code": "99903",
"title": "Engine unavailable",
"detail": "The instance's engine did not answer; try again shortly."
}
]
}