# OpenRouter [Audio] API

> LLM गेटवे वैरिएंट, जो ट्रांसक्रिप्शन या विश्लेषण के लिए प्रॉम्प्ट के साथ ऑडियो फ़ाइल संसाधित करता है

`audio_url` के माध्यम से ऑडियो फ़ाइल, साथ में `prompt` और आवश्यक `model`, स्वीकार करता है। सूचीबद्ध फ़ॉर्मैट wav, mp3, aiff, aac, ogg, flac और m4a हैं। वैकल्पिक `system_prompt`, `temperature`, `max_tokens`, `reasoning` और वेब खोज सेटिंग उपलब्ध हैं। टेक्स्ट आउटपुट और टोकन उपयोग लौटाता है।

- Model id: `openrouter/router/audio`
- Made by: OpenRouter
- Category: LLM
- Output: text
- Charged by usage (up to $1.858 per run, typical $0.019; the rest of the hold is refunded): $0.01 / usage unit (cheapest run $0.019 (19 API credits))
- Run: `POST https://api.doitong.com/v1/run/openrouter/router/audio`
- Quote: `POST https://api.doitong.com/v1/quote/openrouter/router/audio`
- Docs page: https://doitong.com/hi/developers/models/openrouter/router/audio

## Pricing

Price: **$0.01 / usage unit**. Charged by actual usage at $0.01 / usage unit: up to $1.858 per run (the quote gives the maximum for your input), the rest is refunded automatically after the run. A typical run costs $0.019.

The full example input below holds up to $1.858 = 1858 API credits (up to 185.7946 units × $0.01) when it starts; a typical run costs $0.019 (19 API credits).

Prices are the upstream price in USD, paid from the API balance in API credits (1000 API credits = 1 USD). This model is charged by usage: `POST https://api.doitong.com/v1/quote/openrouter/router/audio` with the same JSON body returns the most the run can cost for that input (`credits`, debited when the run starts); after the run you pay the usage the model reports and the rest is refunded automatically. An input whose maximum would exceed the per-run limit is refused with 422. Invalid input is never charged and failed or canceled requests are refunded automatically.

## Input parameters

Send either the canonical name or the native field name (not both). Canonical names are the same across models.

| Parameter | Canonical name | Type | Required | Default | Allowed values / range | Description |
|---|---|---|---|---|---|---|
| `audio_url` | `audio` | string (audio URL) | yes |  |  | प्रोसेसिंग के लिए ऑडियो इनपुट, URL या डेटा URI द्वारा निर्दिष्ट। स्वीकृत फ़ॉर्मैट m4a, flac, ogg, aac, aiff, mp3 और wav हैं। |
| `prompt` |  | string | yes |  |  | ऑडियो प्रोसेसिंग को निर्देशित करने वाला प्रॉम्प्ट। |
| `system_prompt` |  | string \| null | no |  |  | मॉडल को निर्देश या संदर्भ देने वाला सिस्टम प्रॉम्प्ट। |
| `model` |  | string | yes |  |  | चलाए जाने वाले मॉडल की पहचान करने वाला नाम। |
| `reasoning` |  | boolean | no | `false` |  | अंतिम उत्तर में रीज़निंग शामिल करनी है या नहीं। |
| `temperature` |  | number | no | `1` | 0 – 2 | उत्तर की परिवर्तनशीलता का नियंत्रण, जिसमें इनपुट अपरिवर्तित रहने पर 0 समान उत्तर की गारंटी देता है। मान बढ़ाने पर उत्तर पूर्वानुमेय, सामान्य उत्तरों से हटकर अधिक विविध और कम सामान्य उत्तरों की ओर जाते हैं। |
| `max_tokens` |  | integer \| null | no |  | ≥ 1 | उत्तर में निर्मित टोकन की संख्या को ऐसी सीमा पर रोकें जो कॉन्टेक्स्ट लंबाई में से प्रॉम्प्ट लंबाई घटाने के परिणाम से अधिक न हो। निर्माण निर्दिष्ट सीमा से अधिक नहीं हो सकता। |
| `enable_web_search` |  | boolean | no | `false` |  | वेब पहुँच टॉगल, जो मॉडल को यह चुनने देता है कि खोज करनी है या नहीं और कब करनी है, जिसमें एक अनुरोध के भीतर कई खोजें शामिल हैं। खोजें रीयल-टाइम जानकारी प्राप्त करने के लिए OpenRouter के सर्वर-साइड वेब सर्च टूल का उपयोग करती हैं। |
| `web_search_options` |  | object {engine, max_results, max_uses, max_total_results, search_context_size, max_characters, allowed_domains, excluded_domains, user_location} \| null | no |  |  | वेब सर्च कॉन्फ़िगरेशन, जिसमें इंजन चयन, परिणाम सीमाएँ और डोमेन फ़िल्टरिंग शामिल हैं। केवल तब उपयोग किया जाता है जब enable_web_search true हो। |
| `web_search_options.engine` |  | enum (string) | no | `auto` | `auto`, `native`, `exa` | सर्च इंजन चयन: native सर्च उपलब्ध न होने पर 'auto' और 'native' दोनों Exa पर फ़ॉलबैक करते हैं। 'auto' उपलब्ध provider-native सर्च का उपयोग करता है; 'native' OpenAI, Anthropic, Google, xAI या Perplexity की बिल्ट-इन सर्च को प्राथमिकता देता है। केवल Exa के सर्च API का उपयोग करने के लिए 'exa' चुनें। |
| `web_search_options.max_results` |  | integer \| null | no |  | 1 – 25 | प्रत्येक Exa सर्च कॉल के परिणामों की सीमा, 1 से 25 तक, जिसका डिफ़ॉल्ट 5 है। Native provider सर्च इस सेटिंग को अनदेखा करता है। |
| `web_search_options.max_uses` |  | integer \| null | no |  | ≥ 1 | प्रति-अनुरोध सर्च सीमा, native सर्च के लिए Anthropic को भेजी जाती है, लेकिन अन्य native providers द्वारा अनदेखी की जाती है। सीमा से अधिक कॉल को त्रुटि परिणाम मिलता है और वे चलते नहीं हैं। |
| `web_search_options.max_total_results` |  | integer \| null | no |  | ≥ 1 | एक अनुरोध के भीतर सभी खोजों के लिए संयुक्त परिणाम सीमा। |
| `web_search_options.search_context_size` |  | enum (string) \| null | no |  | `low`, `medium`, `high` | Exa के लिए प्रति-परिणाम रिट्रीवल मात्रा, दोनों दिए जाने पर max_characters द्वारा प्रतिस्थापित और native provider सर्च के लिए अनदेखी की जाती है। 5K वर्णों के लिए low, 15K के लिए medium या 30K के लिए high चुनें; इसे निर्दिष्ट न करने पर Exa प्रति परिणाम लगभग 2–4K के अनुसार मात्रा समायोजित करता है। |
| `web_search_options.max_characters` |  | integer \| null | no |  | 1 – 100,000 | Exa के लिए प्रति-परिणाम सामग्री वर्ण सीमा, दोनों सेटिंग दिए जाने पर search_context_size को ओवरराइड करती है। 1 से 100,000 वर्णों तक सटीक अधिकतम सेट करें; native provider सर्च इस सेटिंग को अनदेखा करता है। |
| `web_search_options.allowed_domains` |  | array of string \| null | no |  |  | Exa और अधिकांश native सर्च providers के लिए डोमेन allowlist, जो परिणामों को सूचीबद्ध डोमेन तक सीमित करती है। Google native सर्च इसका समर्थन नहीं करती। |
| `web_search_options.excluded_domains` |  | array of string \| null | no |  |  | Exa खोजों और संगत नेटिव प्रदाताओं के लिए डोमेन अपवर्जन सूची; Google और OpenAI नेटिव खोजें इस सूची को लागू नहीं कर सकतीं। सूचीबद्ध डोमेन से आने वाले परिणामों को बाहर रखा जाता है। |
| `web_search_options.user_location` |  | object {type, city, region, country, timezone} \| null | no |  |  | उपयोगकर्ता का अनुमानित स्थान, जो नेटिव खोज परिणामों को भौगोलिक रूप से प्रभावित करता है; Exa इस जानकारी का उपयोग नहीं करता। |
| `web_search_options.user_location.type` |  | string | no | `approximate` |  | स्थान वर्गीकरण; समर्थित एकमात्र मान 'approximate' है। |
| `web_search_options.user_location.city` |  | string \| null | no |  |  | शहर का नाम, जैसे 'San Francisco'। |
| `web_search_options.user_location.region` |  | string \| null | no |  |  | राज्य या क्षेत्र का नाम, जैसे 'California'। |
| `web_search_options.user_location.country` |  | string \| null | no |  |  | दो अक्षरों में व्यक्त देश पहचानकर्ता, जैसे 'US'। |
| `web_search_options.user_location.timezone` |  | string \| null | no |  |  | IANA नोटेशन में टाइमज़ोन पहचानकर्ता, जैसे 'America/Los_Angeles'। |

File parameters (`audio`) take a public `https://` URL, a `data:` URI up to 10 MB, or the `file_url` of an upload from `POST /files`.

## Example input

Required parameters only:

```json
{
  "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
  "audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
  "model": "google/gemini-3.8-flash"
}
```

A fuller example:

```json
{
  "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
  "audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
  "model": "google/gemini-3.8-flash"
}
```

## Run it

Set `DOITONG_API_KEY` to a key from https://doitong.com/developers/dashboard#keys. `?wait=20` returns the finished request in the same call when it is ready within 20 seconds; otherwise poll `GET /requests/{id}` (it also accepts `?wait=`), or pass `webhook_url`.

### curl

```bash
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/openrouter/router/audio?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "model": "google/gemini-3.8-flash"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"
```

### JavaScript

```javascript
const API = "https://api.doitong.com/v1";
const headers = {
  "Authorization": "Bearer " + process.env.DOITONG_API_KEY,
  "Content-Type": "application/json",
};

// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/openrouter/router/audio?wait=20", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "model": "google/gemini-3.8-flash"
  }),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);

// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
  res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
  request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
```

### Python

```python
import os
import requests

API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}

payload = {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "model": "google/gemini-3.8-flash",
}

# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/openrouter/router/audio", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
    raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])

# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
    request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
    raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
```

### MCP

The MCP server at `https://api.doitong.com/v1/mcp` exposes the tools `search_models`, `get_model`, `quote`, `run`, `get_request`, `cancel_request`, `list_requests`, `create_upload` and `get_account`. A `run` call for this model:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "run",
    "arguments": {
      "model_id": "openrouter/router/audio",
      "input": {
        "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
        "audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
        "model": "google/gemini-3.8-flash"
      },
      "wait_seconds": 20
    }
  }
}
```

## Response

Every call returns a request object. `status` is one of `queued`, `running`, `succeeded`, `failed`, `canceled`. `outputs` lists the generated files with URLs on our storage (kept forever, or 7 days with `?storage=temporary`; `storage` says which); `output` is the model's own result object with the same URLs.

```json
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "openrouter/router/audio",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 1858,
    "usd": "1.858",
    "charged": 1858,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "model": "google/gemini-3.8-flash"
  },
  "output": {
    "output": "The audio contains a conversation between two people discussing the weather forecast for the upcoming week.",
    "usage": {
      "prompt_tokens": 1,
      "completion_tokens": 1,
      "total_tokens": 0,
      "cost": 1.0,
      "prompt_tokens_details": {
        "cached_tokens": 0,
        "cache_write_tokens": 0
      }
    }
  },
  "outputs": [
    {
      "type": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
```

### Output fields (`output`)

| Field | Type | Description |
|---|---|---|
| `output` | string | ऑडियो प्रोसेसिंग से उत्पन्न परिणाम। |
| `usage` | object {prompt_tokens, completion_tokens, total_tokens, cost, prompt_tokens_details} \| null | टोकन खपत का विवरण। |

## Related models

- [OpenRouter](https://doitong.com/developers/models/openrouter/router.md) (`openrouter/router`): $0.01 / usage unit
- [OpenRouter \[Enterprise\]](https://doitong.com/developers/models/openrouter/router/enterprise.md) (`openrouter/router/enterprise`): $0.01 / usage unit
- [OpenRouter \[Video\]](https://doitong.com/developers/models/openrouter/router/video.md) (`openrouter/router/video`): $0.01 / usage unit
- [OpenRouter \[Video\]\[Enterprise\]](https://doitong.com/developers/models/openrouter/router/video/enterprise.md) (`openrouter/router/video/enterprise`): $0.01 / usage unit
- [OpenRouter \[Vision\]](https://doitong.com/developers/models/openrouter/router/vision.md) (`openrouter/router/vision`): $0.01 / usage unit
- [Bytedance Seed V2 Mini](https://doitong.com/developers/models/bytedance/seed/v2/mini.md) (`bytedance/seed/v2/mini`): $0.0001 / 1000 tokens
- [Fibo Edit \[Structured Instruction\]](https://doitong.com/developers/models/bria/fibo-edit/edit/structured_instruction.md) (`bria/fibo-edit/edit/structured_instruction`): $0.01 / request
- [Fibo Lite · Structured Prompt](https://doitong.com/developers/models/bria/fibo-lite/generate/structured_prompt.md) (`bria/fibo-lite/generate/structured_prompt`): $0.008 / request

## Links

- HTML page: https://doitong.com/developers/models/openrouter/router/audio
- All models and guides for AI agents: https://doitong.com/developers/llms.txt
- OpenAPI 3.1 with this model's typed request body: https://doitong.com/developers/openapi.json?model=openrouter/router/audio
- Errors: https://doitong.com/developers/docs/errors
- Model details as JSON: https://api.doitong.com/v1/models/openrouter/router/audio
