# OpenRouter [Audio]

>  Run any audio capable LLM with fal. Process audio files — transcription, analysis, understanding, understand— using Gemini (Google) models. Supports wav, mp3, aiff, aac, ogg, flac, m4a. Powered by OpenRouter.


## Overview

- **Endpoint**: `https://fal.run/openrouter/router/audio`
- **Model ID**: `openrouter/router/audio`
- **Category**: unknown
- **Kind**: inference


## Pricing

You will be charged based on the number of input and output tokens.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`audio_url`** (`string`, _required_):
  URL or data URI of the audio file to process. Supported formats: wav, mp3, aiff, aac, ogg, flac, m4a.
  - Examples: "https://storage.googleapis.com/falserverless/model_tests/audio-understanding/Title_%20Running%20on%20Fal.mp3"

- **`prompt`** (`string`, _required_):
  Prompt to be used for the audio processing
  - Examples: "Please transcribe this audio file.", "What is being said in this audio?"

- **`system_prompt`** (`string`, _optional_):
  System prompt to provide context or instructions to the model
  - Examples: "Transcribe the audio accurately, including speaker identification if multiple speakers are present."

- **`model`** (`string`, _required_):
  Name of the model to use. Charged based on actual token usage.
  - Examples: "google/gemini-3-flash-preview", "google/gemini-2.5-flash", "google/gemini-3-pro-preview", "google/gemini-3.1-pro-preview"

- **`reasoning`** (`boolean`, _optional_):
  Should reasoning be the part of the final answer.
  - Default: `false`

- **`temperature`** (`float`, _optional_):
  This setting influences the variety in the model's responses. Lower values lead to more predictable and typical responses, while higher values encourage more diverse and less common responses. At 0, the model always gives the same response for a given input. Default value: `1`
  - Default: `1`
  - Range: `0` to `2`

- **`max_tokens`** (`integer`, _optional_):
  This sets the upper limit for the number of tokens the model can generate in response. It won't produce more than this limit. The maximum value is the context length minus the prompt length.



**Required Parameters Example**:

```json
{
  "audio_url": "https://storage.googleapis.com/falserverless/model_tests/audio-understanding/Title_%20Running%20on%20Fal.mp3",
  "prompt": "Please transcribe this audio file.",
  "model": "google/gemini-3-flash-preview"
}
```

**Full Example**:

```json
{
  "audio_url": "https://storage.googleapis.com/falserverless/model_tests/audio-understanding/Title_%20Running%20on%20Fal.mp3",
  "prompt": "Please transcribe this audio file.",
  "system_prompt": "Transcribe the audio accurately, including speaker identification if multiple speakers are present.",
  "model": "google/gemini-3-flash-preview",
  "temperature": 1
}
```


### Output Schema

The API returns the following output format:

- **`output`** (`string`, _required_):
  Generated output from audio processing
  - Examples: "The audio contains a conversation between two people discussing the weather forecast for the upcoming week."

- **`usage`** (`UsageInfo`, _required_):
  Token usage information
  - Examples: {"prompt_tokens":500,"cost":0.0003,"total_tokens":550,"completion_tokens":50}



**Example Response**:

```json
{
  "output": "The audio contains a conversation between two people discussing the weather forecast for the upcoming week.",
  "usage": {
    "prompt_tokens": 500,
    "cost": 0.0003,
    "total_tokens": 550,
    "completion_tokens": 50
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/openrouter/router/audio \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "audio_url": "https://storage.googleapis.com/falserverless/model_tests/audio-understanding/Title_%20Running%20on%20Fal.mp3",
     "prompt": "Please transcribe this audio file.",
     "model": "google/gemini-3-flash-preview"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "openrouter/router/audio",
    arguments={
        "audio_url": "https://storage.googleapis.com/falserverless/model_tests/audio-understanding/Title_%20Running%20on%20Fal.mp3",
        "prompt": "Please transcribe this audio file.",
        "model": "google/gemini-3-flash-preview"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("openrouter/router/audio", {
  input: {
    audio_url: "https://storage.googleapis.com/falserverless/model_tests/audio-understanding/Title_%20Running%20on%20Fal.mp3",
    prompt: "Please transcribe this audio file.",
    model: "google/gemini-3-flash-preview"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/openrouter/router/audio)
- [API Documentation](https://fal.ai/models/openrouter/router/audio/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=openrouter/router/audio)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
