Skip to main content
Use CometAPI audio model docs by choosing whether your app needs speech output, transcription, or translation. Audio endpoints use the same CometAPI API key pattern as other OpenAI-compatible endpoints.

Choose an audio API

Create Speech

Convert text to speech.

Create Transcription

Transcribe audio to text.

Create Translation

Translate audio to English text.

Create speech

Use an audio-capable model ID from the Models page or the model directory. The examples below call the speech endpoint.
These examples use the placeholder your-audio-model-id. Replace it with an available audio model ID from the Models page or model directory before you run the request.
Open Create Speech to use the playground and endpoint schema.
import os
import requests

response = requests.post(
    "https://api.cometapi.com/v1/audio/speech",
    headers={
        "Authorization": "Bearer " + os.environ["COMETAPI_KEY"],
        "Content-Type": "application/json",
    },
    json={
        "model": "your-audio-model-id",
        "input": "Welcome to CometAPI.",
        "voice": "alloy",
        "response_format": "mp3",
    },
    timeout=60,
)

response.raise_for_status()

with open("speech.mp3", "wb") as audio_file:
    audio_file.write(response.content)

Response example

A successful speech response is binary audio. The HTTP response can look like this:
HTTP/1.1 200 OK
Content-Type: audio/mpeg

speech.mp3

Example model records

This example model catalog response shows the /api/models envelope and one audio model record shape. It is not a complete model list.
cURL
curl https://api.cometapi.com/api/models
{
  "success": true,
  "page": 1,
  "page_size": 20,
  "total": 302,
  "data": [
    {
      "created": 0,
      "id": "your-audio-model-id",
      "code": "your-audio-model-id",
      "provider": "ExampleProvider",
      "provider_code": "example",
      "name": "Example audio model",
      "model_type": "audio",
      "features": [
        "text-to-speech"
      ],
      "endpoints": [
        "openai"
      ],
      "pricing": {
        "currency": "USD / M Tokens",
        "input": 12,
        "output": 12,
        "per_request": null,
        "per_second": null
      }
    }
  ]
}

Common errors

Use the formats documented on the endpoint page.
Compress the audio file or split the job into smaller files.
Confirm that the file contains speech and that the field name matches the docs.
Use https://api.cometapi.com/v1.

Error codes and retry strategy

Do not retry until the text, file, model ID, voice, or format is fixed.
Do not retry until the API key is present and valid.
Check the base URL, path, and model ID before retrying.
Reduce upload size before retrying.
Retry with exponential backoff and reduce concurrency.
Retry with backoff for transient provider or service errors.
For implementation patterns, see Error codes and retry strategy and Rate limits and concurrency.

Pricing and model directory

Models page

Read how CometAPI exposes model IDs in the docs.

Model directory

Browse model availability and capabilities.

Pricing

Check pricing before you call a model.
Last modified on May 28, 2026