Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Telnyx API key

Path Parameters

instance_id
string<uuid>
required

The Agent Gateway's id.

Body

application/json
name
string | null

A label for people, unique on the instance.

Required string length: 1 - 100
models
string[] | null

The models the key may use. Leave it out to allow every model.

Maximum array length: 100
Required string length: 1 - 200
max_budget
number | null

The most the key may spend, in USD.

Required range: x >= 0
budget_resets_every
string | null

How often the spend resets: a number and a unit, s, m, h, or d.

Pattern: ^[1-9][0-9]{0,6}[smhd]$
Example:

"30d"

expires_in
string | null

How long until the key stops working: a number and a unit, s, m, h, or d.

Pattern: ^[1-9][0-9]{0,6}[smhd]$
Example:

"30d"

team_id
string<uuid> | null

A team on the instance. The key shares the team's model list, budget, and rate limits.

requests_per_minute
integer | null

The most requests the key may make per minute.

Required range: 1 <= x <= 2147483647
tokens_per_minute
integer | null

The most tokens the key may use per minute.

Required range: 1 <= x <= 2147483647
max_parallel_requests
integer | null

The most requests the key may have in flight at once.

Required range: 1 <= x <= 2147483647

Response

The key, with its value

data
object
required

A key that was just issued: the only response that carries its value.