OpenAI: Whisper-1 (Audio to Text) API Reference

About

The Whisper models are trained for speech recognition and translation tasks, capable of transcribing speech audio into the text in the language it is spoken (automatic speech recognition) as well as translated into English (speech translation). Researchers at OpenAI developed the models to study the robustness of speech processing systems trained under large-scale weak supervision. The model version 001 corresponds to whisper large v2.

Max request data size: 25mb of audio can be converted from speech to text per API request.

1. Calling the API

Setup your API Key

To begin using Infron, you first need to create an account and generate your API Key.

Once you have your API key, set it as an environment variable in your runtime environment. This allows your applications to securely access Infron’s API.

export INFRON_KEY="YOUR_API_KEY"

Submit a request

For long-running requests, you can poll for results.

curl https://media.onerouter.pro/v1/audios/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=openai/whisper-1/audio-to-text" \
  -F "file=@./files/audio.mp3" \
  -F "language=en" \
  -F "response_format=json"

Response with queue task id

The response will look like this:

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "9894198a09154ca890371974a960c238",
    "object": "audio",
    "model": "openai/whisper-1/audio-to-text",
    "status": "created",
    "urls": {
      "query": "https://media.onerouter.pro/v1/audios/tasks/9894198a09154ca890371974a960c238"
    },
    "created_at": "2026-06-01 01:27:57.14"
  }
}

Fetch request status

You can fetch the status of a request to check if it is completed or still in progress.

curl https://media.onerouter.pro/v1/audios/tasks/{task_id} \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" 

# For example
curl https://media.onerouter.pro/v1/audios/tasks/9894198a09154ca890371974a960c238 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response with queue task status query

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "9894198a09154ca890371974a960c238",
    "object": "audio",
    "model": "openai/whisper-1/audio-to-text",
    "status": "completed",
    "fail_reason": "",
    "submit_time": 1780277277,
    "start_time": 1780277277,
    "finish_time": 1780277278,
    "outputs": [
      "Today is a wonderful day to build with Infron."
    ],
    "usage": {
      "completion_tokens": 0,
      "output_count": 1,
      "prompt_tokens": 3,
      "total_tokens": 3
    },
    "cost": {
      "total_cost": 0.000333,
      "cost_details": {
        "prompt_cost": 0,
        "completion_cost": 0,
        "image_cost": 0,
        "video_cost": 0,
        "audio_cost": 0.000333,
        "native_web_search_cost": 0,
        "plugin_web_search_cost": 0,
        "tools_cost": 0,
        "prompt_cache_read_cost": 0,
        "prompt_cache_write_cost": 0,
        "prompt_cache_write_5_min": 0,
        "prompt_cache_write_1_h": 0,
        "reasoning_cost": 0,
        "discount_rate": 1,
        "is_byok": false,
        "byok_cost": 0
      }
    },
    "created_at": "2026-06-01 01:27:57"
  }
}

Possible statuses:

  • created
  • in_progress
  • processing
  • completed
  • failed

created -> in_progress → processing → completed | failed

Poll every 1-2 seconds until status is "completed" or "failed"

Get the result (when status is "completed")

Once the request is completed, you can fetch the result. See the Output Schema for the expected result format.

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "9894198a09154ca890371974a960c238",
    "object": "audio",
    "model": "openai/whisper-1/audio-to-text",
    "status": "completed",
    "fail_reason": "",
    "submit_time": 1780277277,
    "start_time": 1780277277,
    "finish_time": 1780277278,
    "outputs": [
      "Today is a wonderful day to build with Infron."
    ],
    "usage": {
      "completion_tokens": 0,
      "output_count": 1,
      "prompt_tokens": 3,
      "total_tokens": 3
    },
    "cost": {
      "total_cost": 0.000333,
      "cost_details": {
        "prompt_cost": 0,
        "completion_cost": 0,
        "image_cost": 0,
        "video_cost": 0,
        "audio_cost": 0.000333,
        "native_web_search_cost": 0,
        "plugin_web_search_cost": 0,
        "tools_cost": 0,
        "prompt_cache_read_cost": 0,
        "prompt_cache_write_cost": 0,
        "prompt_cache_write_5_min": 0,
        "prompt_cache_write_1_h": 0,
        "reasoning_cost": 0,
        "discount_rate": 1,
        "is_byok": false,
        "byok_cost": 0
      }
    },
    "created_at": "2026-06-01 01:27:57"
  }
}

2. Schema

Input

ParameterTypeRequiredDefaultRangeDescription
modelstringYes--Explore all modelsModel name.
filefileYes--flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webmThe audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
chunking_strategystringNoauto--Controls how the audio is cut into chunks. When set to 'auto', the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. server_vad object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block.
includearrayNo----Additional information to include in the transcription response. logprobs will return the log probabilities of the tokens in the response to understand the model's confidence in the transcription.
knownspeakernamesarrayNo----Optional list of speaker names that correspond to the audio samples provided in knownspeakerreferences[]. Each entry should be a short identifier (for example customer oragent). Up to 4 speakers are supported.
knownspeakerreferencesarrayNo----Optional list of audio samples (as data URLs) that contain known speaker references matching knownspeakernames[]. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by file.
languagestringNoenISO-639-1 (e.g. en)The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency.
promptstringNo----An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
response_formatstringNojsonjson, text, srt, verbose_json, vtt, diarized_jsonThe format of the output.
temperaturenumberNo0>=0 and <=1The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.

Example request

curl https://media.onerouter.pro/v1/audios/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=openai/whisper-1/audio-to-text" \
  -F "file=@./files/audio.mp3" \
  -F "language=en" \
  -F "response_format=json"

Output

ParameterTypeRangeDescription
codeinteger--Status code of the request.
messagestring--Status message of the request.
dataobject--Data of the task.
data.task_idstring--ID of the task.
data.objectstring--Object type of the task.
data.modelstring--Model name of the task.
data.statusstringcreated, in_progress, processing, completed, failedStatus of the task.
data.fail_reasonstring--Fail reason of the task.
data.submit_timeinteger--Timestamp of the task submission.
data.start_timeinteger--Timestamp of the task start.
data.finish_timeinteger--Timestamp of the task finish.
data.outputsarray--Outputs of the task.
data.created_atstring--Timestamp of the task creation.

Example output

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "9894198a09154ca890371974a960c238",
    "object": "audio",
    "model": "openai/whisper-1/audio-to-text",
    "status": "completed",
    "fail_reason": "",
    "submit_time": 1780277277,
    "start_time": 1780277277,
    "finish_time": 1780277278,
    "outputs": [
      "Today is a wonderful day to build with Infron."
    ],
    "usage": {
      "completion_tokens": 0,
      "output_count": 1,
      "prompt_tokens": 3,
      "total_tokens": 3
    },
    "cost": {
      "total_cost": 0.000333,
      "cost_details": {
        "prompt_cost": 0,
        "completion_cost": 0,
        "image_cost": 0,
        "video_cost": 0,
        "audio_cost": 0.000333,
        "native_web_search_cost": 0,
        "plugin_web_search_cost": 0,
        "tools_cost": 0,
        "prompt_cache_read_cost": 0,
        "prompt_cache_write_cost": 0,
        "prompt_cache_write_5_min": 0,
        "prompt_cache_write_1_h": 0,
        "reasoning_cost": 0,
        "discount_rate": 1,
        "is_byok": false,
        "byok_cost": 0
      }
    },
    "created_at": "2026-06-01 01:27:57"
  }
}

3. Detailed Pricing

Pricing TypeUnitPrice
Input audio1 minute$0.006
Output text--