跳转到内容

OpenRouter [Audio]

集成

模型 id openrouter/router/audio
# 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 '{
    "audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "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"

每次运行最高 $1.858 按实际用量收费,剩余部分退款 在此页面运行

获取 API 密钥
OpenRouter · 文本

你的第一个结果会显示在这里

在下方构建请求,并使用你的 API 密钥运行。输出会复制到我们的存储中,可永久保存,也可免费保存 7 天。

构建请求

控件根据模型架构生成。修改控件时,代码和价格会同步更新。

•必填

指导音频处理的提示词。

•必填 audio_url
拖放文件,或

用于处理的音频输入,通过 URL 或数据 URI 指定。接受的格式包括 m4a、flac、ogg、aac、aiff、mp3 和 wav。

•必填

标识要运行的模型的名称。

高级 system_prompt · temperature · max_tokens · reasoning · enable_web_search · web_search_options

向模型提供指令或上下文的系统提示词。

默认 1

控制回答变化程度;输入不变时,值为 0 可保证回答完全相同。增大该值会使回答偏离可预测的典型答案,变得更加多样且不常见。

将回答生成的 Token 数量限制为不超过上下文长度减去提示词长度的值。生成内容不能超过指定上限。

Web 搜索配置,包括引擎选择、结果上限和域名过滤。仅当 enable_web_search 为 true 时使用。

POST /run/openrouter/router/audio?wait=20 报价 → $1.858
# 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 '{
    "audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "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"

运行此请求

你的密钥会保留在此浏览器中:仅发送到 Doitong API;只有勾选“记住”后才会保存到 localStorage。 获取 API 密钥

关于 OpenRouter [Audio]

通过 `audio_url` 接收音频文件,同时需要提供 `prompt` 和必需的 `model`。列出的格式包括 wav、mp3、aiff、aac、ogg、flac 和 m4a。可选使用 `system_prompt`、`temperature`、`max_tokens`、`reasoning` 和网页搜索设置。返回文本输出和 Token 用量。

参数

发送规范名称或原生名称之一,不要同时发送两者。 规范名称

名称类型 默认值允许值 描述
audio_url必填 audio
类型url · audio
用于处理的音频输入,通过 URL 或数据 URI 指定。接受的格式包括 m4a、flac、ogg、aac、aiff、mp3 和 wav。
prompt必填
类型string
指导音频处理的提示词。
system_prompt可选
类型string | null
向模型提供指令或上下文的系统提示词。
model必填
类型string
标识要运行的模型的名称。
reasoning可选
类型boolean
默认值false
是否在最终回答中包含推理。
temperature可选
类型number
默认值1
0 – 2
控制回答变化程度;输入不变时,值为 0 可保证回答完全相同。增大该值会使回答偏离可预测的典型答案,变得更加多样且不常见。
max_tokens可选
类型integer | null
≥ 1
将回答生成的 Token 数量限制为不超过上下文长度减去提示词长度的值。生成内容不能超过指定上限。
web_search_options可选
类型object
Web 搜索配置,包括引擎选择、结果上限和域名过滤。仅当 enable_web_search 为 true 时使用。
web_search_options.engine可选
类型enum
默认值auto
autonativeexa
搜索引擎选择:当原生搜索不可用时,'auto' 和 'native' 都会回退到 Exa。'auto' 使用可用的提供商原生搜索;'native' 优先使用 OpenAI、Anthropic、Google、xAI 或 Perplexity 的内置搜索。若仅使用 Exa 的搜索 API,请选择 'exa'。
web_search_options.max_results可选
类型integer | null
1 – 25
每次 Exa 搜索调用的结果上限,范围为 1 到 25,默认值为 5。提供商原生搜索会忽略此设置。
web_search_options.max_uses可选
类型integer | null
≥ 1
每个请求的搜索上限;原生搜索会将其传递给 Anthropic,但其他原生提供商会忽略。超过上限的调用会收到错误结果且不会运行。
web_search_options.max_total_results可选
类型integer | null
≥ 1
一次请求中所有搜索的合计结果上限。
web_search_options.search_context_size可选
类型enum
lowmediumhigh
Exa 每个结果的检索量;同时提供时由 max_characters 覆盖,原生提供商搜索会忽略此设置。选择 low 表示 5K 个字符,medium 表示 15K,high 表示 30K;不指定时,Exa 会将每个结果的数量自适应到约 2–4K。
web_search_options.max_characters可选
类型integer | null
1 – 100,000
Exa 每个结果的内容字符上限;同时提供时覆盖 search_context_size。设置 1 到 100,000 个字符之间的确切最大值;原生提供商搜索会忽略此设置。
web_search_options.allowed_domains可选
类型string[]
Exa 和大多数原生搜索提供商的域名允许列表,将结果限制为所列域名。Google 原生搜索不支持此设置。
web_search_options.excluded_domains可选
类型string[]
Exa 搜索及兼容的原生提供商的域名排除列表;Google 和 OpenAI 原生搜索无法应用此列表。来自所列域名的结果会被排除。
web_search_options.user_location可选
类型object
大致用户位置,用于在地理位置上影响原生搜索结果;Exa 不使用此信息。
web_search_options.user_location.type可选
类型string
默认值approximate
位置分类;唯一受支持的值是 'approximate'。
web_search_options.user_location.city可选
类型string | null
城市名称,例如 'San Francisco'。
web_search_options.user_location.region可选
类型string | null
州或地区名称,例如 'California'。
web_search_options.user_location.country可选
类型string | null
以两个字母表示的国家标识符,例如 'US'。
web_search_options.user_location.timezone可选
类型string | null
采用 IANA 表示法的时区标识符,例如 'America/Los_Angeles'。
必填 规范名称,也可接受

文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "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"
  }
}
文件由你选择每个 outputs[].url 都是我们存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
所有模型的结构一致图像、视频和音频的字段均为 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
output
string处理音频后生成的结果。
usage
object {prompt_tokens, completion_tokens, total_tokens, cost, prompt_tokens_details} | nullToken 消耗详情。

更多模型:LLM

对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh-CN/developers/models/openrouter/router/audio.md. 所有模型和指南: https://doitong.com/developers/llms.txt