NON-TEXT ENDPOINTS

Audio and embeddings API

TTS, transcription and embeddings do not use /v1/chat/completions. Each capability has its own endpoint and request format.

Updated 2026-08-05Bearer authenticationOpenAI-compatible routes

Use the dedicated guides

This page is a compact overview. For verified pricing, limits, model-specific parameters and cURL, Python and Node.js examples, open the text-to-speech guide, Whisper speech-to-text guide, or embeddings guide.

Text to speech (TTS)

Supported models: gpt-4o-mini-tts and tts-1-hd. The response is binary audio, so save it to a file instead of parsing JSON.

Terminal · MP3 output
curl https://api-models.com/v1/audio/speech \
  -H "Authorization: Bearer $API_MODELS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini-tts",
    "input": "Hello from API Models.",
    "voice": "alloy",
    "response_format": "mp3"
  }' \
  --output speech.mp3
Python · requests
import os
import requests

response = requests.post(
    "https://api-models.com/v1/audio/speech",
    headers={"Authorization": f"Bearer {os.environ['API_MODELS_KEY']}"},
    json={
        "model": "gpt-4o-mini-tts",
        "input": "Hello from API Models.",
        "voice": "alloy",
        "response_format": "mp3",
    },
    timeout=120,
)
response.raise_for_status()
open("speech.mp3", "wb").write(response.content)

model, input and voice are required. Common formats are mp3, opus, aac, flac, wav and pcm. instructions works with gpt-4o-mini-tts, not tts-1-hd.

Speech to text with Whisper

whisper-1 accepts a file upload as multipart/form-data and returns text. Do not send a JSON chat body.

Terminal · transcription
curl https://api-models.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $API_MODELS_KEY" \
  -F "file=@./audio.mp3" \
  -F "model=whisper-1" \
  -F "response_format=json"
Python · multipart upload
import os
import requests

with open("audio.mp3", "rb") as audio:
    response = requests.post(
        "https://api-models.com/v1/audio/transcriptions",
        headers={"Authorization": f"Bearer {os.environ['API_MODELS_KEY']}"},
        files={"file": ("audio.mp3", audio, "audio/mpeg")},
        data={"model": "whisper-1", "response_format": "json"},
        timeout=180,
    )
response.raise_for_status()
print(response.json()["text"])

Optional fields include language, prompt, response_format and temperature. Whisper also supports text, srt, verbose_json and vtt output formats.

Text embeddings

Supported models: text-embedding-3-large, text-embedding-3-small and text-embedding-ada-002. The response contains vectors in data[].embedding.

Terminal · embedding vector
curl https://api-models.com/v1/embeddings \
  -H "Authorization: Bearer $API_MODELS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "Embed this sentence.",
    "encoding_format": "float"
  }'
Node.js · fetch
const response = await fetch("https://api-models.com/v1/embeddings", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.API_MODELS_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "text-embedding-3-small",
    input: "Embed this sentence.",
    encoding_format: "float",
  }),
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
console.log(data.data[0].embedding.slice(0, 8));

dimensions is supported by the text-embedding-3 models, but not by text-embedding-ada-002.

Troubleshooting

SymptomCauseFix
Chat-style errorWrong endpointUse the capability route listed above
415 / invalid bodyWrong content typeTTS and embeddings use JSON; transcription uses multipart
Empty or corrupt audioBinary response parsed as JSONWrite the response body to a file
404 modelModel ID mismatchCopy the exact ID from the live catalog