Audio and Video Understanding (audio/video → text only)
yaoshu-omni goes through the chat endpoint POST /v1/chat/completions: you send text, images, audio, or video, and the output is text only. It suits answering questions about audio or video, transcription, summarization, and subtitles — audio recognition belongs here, and the recognition result is text.
It cannot declare audio output, cannot specify a voice, and never returns speech. When you need voice output, use Text-to-Speech (yaoshu-audio) or Realtime Conversation (yaoshu-omni-realtime) instead.
1. Request Example (audio input)
curl https://token.yaoshu.cc/v1/chat/completions \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "yaoshu-omni",
"messages": [{
"role": "user",
"content": [
{"type": "input_audio", "input_audio": {"data": "<public audio URL or Base64>", "format": "wav"}},
{"type": "text", "text": "What is being said in this audio?"}
]
}],
"modalities": ["text"],
"stream": true
}'2. Multimodal Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
modalities | string[] | No | Use ["text"] only. This model returns text only |
input_audio.data | string | ✅ | Audio content: a public URL or Base64-encoded data |
input_audio.format | string | ✅ | Audio format: wav / mp3, etc. |
Image and video input follow the multimodal conventions in Chat Completions (image_url / video_url).
3. SDK Integration
from openai import OpenAI
client = OpenAI(api_key="sk-your-api-key", base_url="https://token.yaoshu.cc/v1")
transcript = client.chat.completions.create(
model="yaoshu-omni",
messages=[{
"role": "user",
"content": [
{"type": "input_audio", "input_audio": {"data": "https://example.com/speech.wav", "format": "wav"}},
{"type": "text", "text": "Transcribe this audio verbatim"},
],
}],
modalities=["text"], # text output only
stream=True,
)
for chunk in transcript:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")4. Limits
- Output is text only (no audio output capability)
- Context window of 1M tokens (audio is estimated at roughly 7 tokens per second, for budget estimation)
5. Billing
Metered by token: text, image, audio, and video input and text output are each counted as tokens (audio input is estimated at roughly 7 tokens per second, for budget estimation). Unit prices are per the model pricing page in the Console.
