Skip to main content
AI Gateway issues scoped inference credentials for applications. Instead of sharing a Telnyx account API key with every service, create a token group, issue a token key inside it and hand that key to the application. The gateway enforces the model allowlist, budget and rate limits attached to the key, and records every request in a usage ledger attributed to the key, its user, its group and the end user it served. Applications call the gateway with the official OpenAI SDKs by changing the base URL and the API key. No request rewriting is required. Anthropic models used with your own Anthropic key can also be called with the official Anthropic SDKs.

Capabilities

Two planes, two credentials

The gateway exposes a management plane for provisioning and reporting, and an inference plane that applications call. They use different hostnames and different credentials. Token keys start with ltg_sk_. The inference plane rejects Telnyx account API keys and provider secrets; the management plane rejects token keys. Keep every credential in a trusted backend or secret store, never in browser code, source control or logs.

How it works

  1. Create a token group with an explicit allowed_models list and optional budget and rate limits. To use your own OpenAI or Anthropic account, attach a provider key to the group.
  2. Issue a token key in that group, optionally bound to a token user. The secret is returned once, on the create response.
  3. Call models from the application with an OpenAI SDK (or, for Anthropic BYOK models, an Anthropic SDK) pointed at the inference base URL and authenticated with the token key.
  4. Inspect usage with the spend events and spend summary endpoints, filtered by group, user, key or end user.
  5. Revoke the key when the application no longer needs it. New admissions stop immediately; spend history is retained.
Telnyx owns authorization, admission, revocation and the authoritative usage ledger. Applications never hold provider credentials or configure model providers directly. Usage of Telnyx-hosted models is billed to your Telnyx account at standard Telnyx AI Inference pricing for each model. Requests on bring-your-own-key models are billed by your provider on your provider account. Budgets and reported cost values use a flat reference rate for enforcement and attribution; see Budgets.

Next steps

Quickstart

Create a group, issue a token key, make a request and revoke the key.

Inference API

Telnyx-hosted and BYOK models, OpenAI and Anthropic SDK configuration, streaming, request limits and supported fields.

Management API

Groups, users, keys, end users and provider keys, with idempotency and ETag rules.

Budgets and rate limits

How each control is enforced and what happens at the limit.

Bring your own key

Use your own OpenAI or Anthropic key; your provider bills those requests.

Usage reporting

Spend events, dimensional summaries and snapshot pagination.

Errors

Status codes, structured error codes and how to handle them.