API Reference

Models

InferexAI routes requests through virtual model names configured by your administrator. Use the model ID returned by /v1/models in the model field of all API requests. The gateway resolves the virtual name to an upstream endpoint transparently — your code never references the underlying service.

Virtual model names

Managed at the platform level
InferexAI configures model routes on the platform, assigning a virtual name to each upstream endpoint. You receive the virtual names — not the underlying endpoint details.
Stable across changes
If the admin changes which upstream endpoint handles "my-chat-model", your application code stays the same. Only the virtual name matters to your code.
Fallback-aware
A single virtual name can map to multiple upstream routes. If the primary fails, the gateway retries the next route automatically — transparent to your code.
Type-aware
Each model has a type — LLM, STT, or TTS. Use the correct endpoint for the model type (chat completions for LLM, audio/transcriptions for STT, audio/speech for TTS).

List models

GET/v1/models

Returns the list of model IDs active on your account. Always call this endpoint to get the current list — model names are set by your administrator and may change.

bash
curl https://api.inferexai.in/v1/models \
  -H "Authorization: Bearer sk-live-your-key-here"
response.json
{
  "object": "list",
  "data": [
    {
      "id": "my-chat-model",
      "object": "model",
      "created": 1748000000,
      "owned_by": "inferexai"
    },
    {
      "id": "whisper-stt",
      "object": "model",
      "created": 1748000000,
      "owned_by": "inferexai"
    },
    {
      "id": "tts-voice",
      "object": "model",
      "created": 1748000000,
      "owned_by": "inferexai"
    }
  ]
}

Using models in code

models.py
from inferexai import InferexAI

client = InferexAI(api_key="sk-live-your-key-here")

# List available models
models = client.models.list()
for m in models.data:
    print(m.id)

# Use a specific model
response = client.chat.completions.create(
    model="my-chat-model",   # use any ID from the list above
    messages=[{"role": "user", "content": "Hello!"}],
)

Model catalog in the portal

Log in to the Customer Portal → Models to see a visual catalog of all available models with descriptions and type badges. From there you can click Open in Playground to test any model interactively before writing code.

LLM
Large Language Models. Use with /v1/chat/completions.
STT
Speech-to-Text. Use with /v1/audio/transcriptions.
TTS
Text-to-Speech. Use with /v1/audio/speech.
Contact your administrator to enable additional model routes. Newly added routes appear in /v1/models immediately without any changes to your code.