Skip to main content

Models API

The Models API returns the canonical catalog of language and embedding models that TokenFlux can route to across all configured providers. Use this endpoint to discover model capabilities, pricing, supported parameters, and provider provenance before making chat or embedding requests.
GET /v1/models mirrors the OpenAI Models API surface, but it returns TokenFlux-specific metadata (pricing, architecture, canonical IDs). The same response is also available at GET /models for compatibility with older clients.

List models

Endpoint

Authentication

No authentication is required. The catalog is publicly accessible so that you can inspect pricing and capabilities before generating traffic.

Query parameters

This endpoint does not accept query parameters.

Response structure

The response body is a JSON object with two properties:

Model object

Each item in data is a canonical Model description that TokenFlux uses for routing and billing. The properties are:
Architecture object
Pricing object
Pricing values are strings so that high-precision rates can be represented exactly. Interpret them as “price per unit tokens” in the provider’s currency. TokenFlux converts currencies (for example CNY) to USD internally when tracking usage. The fields are:

Aliases and routing

TokenFlux resolves convenient aliases like gpt-4.1 or claude-sonnet-4 to their canonical identifiers before contacting upstream providers. Always send the canonical id returned by this endpoint in new integrations. Responses from chat completions echo the provider’s server-side model ID (for example gpt-4o), which may omit the vendor prefix for some providers.

Example

Usage tips

  • The array is sorted lexicographically by id for deterministic paging in client SDKs.
  • Cache responses for up to 24 hours—TokenFlux keeps the model list fresh on an hourly cadence using an in-memory cache.
  • Use supported_parameters to tailor request bodies to each provider. Parameters not listed there are silently ignored by many vendors, so skipping unsupported options avoids confusing results.