Kotoba Speech-to-Text
集成
模型 id
kotoba-technologies/kotoba-stt/v1/speech-to-text
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/kotoba-technologies/kotoba-stt/v1/speech-to-text?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",
"language": "ja"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.ru/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/kotoba-technologies/kotoba-stt/v1/speech-to-text?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
"language": "ja"
}),
});
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 + ")");
import os
import requests
API = "https://api.doitong.ru/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
"language": "ja",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/kotoba-technologies/kotoba-stt/v1/speech-to-text", 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"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/zh/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.ru/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "kotoba-technologies/kotoba-stt/v1/speech-to-text",
"input": {
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
"language": "ja"
}
}
通过 Doitong API 调用 Kotoba Speech-to-Text 模型(kotoba-technologies/kotoba-stt/v1/speech-to-text)。智能体文档:https://doitong.com/zh/developers/models/kotoba-technologies/kotoba-stt/v1/speech-to-text.md
POST https://api.doitong.ru/v1/run/kotoba-technologies/kotoba-stt/v1/speech-to-text?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
"language": "ja"
}
如果响应状态为 "queued" 或 "running",请轮询 GET https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20,直到状态变为 "succeeded";文件位于 outputs[].url。使用相同请求体 POST https://api.doitong.ru/v1/quote/kotoba-technologies/kotoba-stt/v1/speech-to-text,可在运行前返回确切价格。
与示例类似的文件: $0.001 1 API 积分 · ≈ ₽0.11 运行前会测量你的文件 在此页面运行
你的新 API 密钥。 它仅在此时显示,并且已填入下方的代码和 API 密钥字段中。请妥善保密:切勿将其放入在浏览器中运行的代码。
构建请求
控件根据模型架构生成。更改控件时,代码和价格会同步更新。
POST
/run/kotoba-technologies/kotoba-stt/v1/speech-to-text?wait=20
报价 → $0.001
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/kotoba-technologies/kotoba-stt/v1/speech-to-text?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",
"language": "ja"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.ru/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/kotoba-technologies/kotoba-stt/v1/speech-to-text?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
"language": "ja"
}),
});
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 + ")");
import os
import requests
API = "https://api.doitong.ru/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
"language": "ja",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/kotoba-technologies/kotoba-stt/v1/speech-to-text", 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"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "kotoba-technologies/kotoba-stt/v1/speech-to-text",
"input": {
"audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
"language": "ja"
},
"wait_seconds": 20
}
}
}
关于 Kotoba Speech-to-Text
从 `audio_url` 转录最长 2 分钟的音频片段。将 `language` 设置为 ja、en、ko、zh、es、zh-hk、zh-tw 或 auto。可选的 `with_timestamps` 返回每个词的起止时间,`diarization` 标记说话人,`keywords` 接受最多 1000 个词语以引导拼写,`kana` 将日语姓名写成片假名。输出包括文本、检测到的语言和音频时长。
参数
发送规范名称或原生名称之一,不要同时发送两者。 规范名称
名称类型
默认值允许值
描述
audio_url必填
audio
类型url · audio
音频时长限制为 2 分钟。
language必填
类型enum
jaenkozheszh-hkzh-twauto
音频中说话者使用的语言。
with_timestamps可选
类型boolean
默认值false
`words` 中按词输出的时间信息,包括每个词的开始和结束时间。
diarization可选
类型boolean
默认值false
词级说话者归属,仅适用于支持说话者 token 的模型。每个词都会获得一个 `speaker_id`,但除非同时启用 `with_timestamps`,否则其时间仍为 null。
keywords可选
类型string[]
≤ 1,000 个项目
转录中应优先采用的词语拼写,包括名称或产品术语。最多接受 1000 个词语,每个词语最多 64 个字符。
kana可选
类型boolean
默认值false
日语人名和地名的片假名写法。
必填
规范名称,也可接受
文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件
输出
GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "kotoba-technologies/kotoba-stt/v1/speech-to-text",
"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": 1,
"usd": "0.001",
"charged": 1,
"refunded": 0
},
"input": {
"audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
"language": "ja"
},
"output": {
"audio_duration_secs": 1.0,
"language_code": "string",
"language_probability": 1.0,
"text": "string",
"words": [
{
"end": 1.0,
"speaker_id": "string",
"start": 1.0,
"text": "string",
"type": "word"
}
]
},
"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.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
你的文件,由你选择每个 outputs[].url 都是存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
每个模型的结构相同图像、视频和音频均包含 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
- audio_duration_secs
- number | null
- language_code
- string
- language_probability
- number
- text
- string
- words
- array of object {end, speaker_id, start, text, type}
更多模型:语音转文本
对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/kotoba-technologies/kotoba-stt/v1/speech-to-text.md. 所有模型和指南: https://doitong.com/developers/llms.txt