Introduction
The Oiiyao API reference, with endpoint documentation, code examples, and request parameters. Integrate video processing such as video translation, multi-speaker translation, smart erasure, subtitle translation, face swap, and lip sync, alongside audio processing such as voice cloning and text-to-speech.
Base URL
https://api.oiiyao.comAuthentication
All API requests must include your API Key in the Authorization header, format: Bearer .
| Header | Description |
|---|---|
| Authorization | Format: Bearer |
Response Format
All API responses use a unified JSON envelope format.
Success Response
{
"success": true,
"data": {
"task_id": "551",
"task_type": "video_translation",
"status": "pending"
},
"usage": {
"credits_used": 60,
"credits_remaining": 10000
}
}Error Response
{
"success": false,
"error": {
"type": "validation_error",
"code": "missing_field",
"message": "video_url is required",
"param": "video_url"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the request was successful |
| data | object | Business data object |
| usage | object | Credits usage info (only returned when credits are consumed) |
| usage.credits_used | integer | Credits consumed by this request |
| usage.credits_remaining | integer | Remaining credits |
| error | object | Error info object (only returned on failure) |
| error.type | string | Error type identifier |
| error.code | string | Error code |
| error.message | string | Error description |
| error.param | string | Related parameter name (optional) |
Account
Get Balance
Query current account credit balance and rate limit information.
Response
| Field | Description |
|---|---|
| data.credits_remaining | Remaining credits |
| data.plan | Current plan |
| data.expires_at | Plan expiration time |
| data.rate_limits | Rate limit information |
| data.rate_limits.requests_per_minute | Requests per minute limit |
| data.rate_limits.queries_per_second | Queries per second limit |
Usage History
Query account credit usage history with date range filtering and cursor pagination.
Query Parameters
Start date (format: yyyy-MM-dd)
End date (format: yyyy-MM-dd)
Pagination cursor (from previous response's next_cursor)
Items per page (max 100, default 20)
Response
| Field | Description |
|---|---|
| data.records | Usage records list |
| data.records[].task_id | Task ID |
| data.records[].task_type | Task type |
| data.records[].credits_used | Credits consumed |
| data.records[].created_at | Created at (ISO 8601) |
| data.total_credits_used | Total credits consumed |
| data.next_cursor | Next page cursor |
| data.has_more | Whether more data exists |
Pricing
Query credit pricing for all task types.
Response
| Field | Description |
|---|---|
| data.pricing | Pricing list |
| data.pricing[].task_type | Task type |
| data.pricing[].credits_per_minute | Credits per minute |
| data.pricing[].description | Description |
| data.pricing[].language | Language |
Tasks
Get Task
Query task details by task ID, including processing status and result files.
Path Parameters
Task ID
Response
| Field | Description |
|---|---|
| data.task_id | Task ID |
| data.task_type | Task type |
| data.status | Task status (pending / processing / completed / failed) |
| data.progress | Processing progress (0-100) |
| data.name | Task name |
| data.source_language | Source language |
| data.target_language | Target language |
| data.output | Output file information |
| data.output.video_url | Result video URL |
| data.output.subtitle_url | Subtitle file URL |
| data.output.audio_url | Audio file URL (returned for text_to_speech tasks) |
| data.output.expires_at | Output URL expiration time (ISO 8601). URLs are valid for 2 hours. Use POST /files/refresh-url to get new URLs after expiration |
| data.credits_used | Credits consumed |
| data.created_at | Created at (ISO 8601) |
| data.completed_at | Completed at (ISO 8601) |
| data.error_message | Error message (only on failure) |
List Tasks
Query task list with status and type filtering, using cursor pagination.
Query Parameters
Filter by status (pending / processing / completed / failed)
Filter by task type
Pagination cursor
Items per page (max 100, default 20)
Response
| Field | Description |
|---|---|
| data.tasks | Task list |
| data.next_cursor | Next page cursor |
| data.has_more | Whether more data exists |
Videos
Video Translation
Create a video translation task with multi-language support and dubbing.
Request Body
Source video URL (HTTPS)
Source language codeLanguage Codes
Target language codeLanguage Codes
Clone the original speaker's voice (default: false). When true, voice_id is ignored and a flat 20-credit clone fee is added per task (independent of video length)
Voice ID (required when voice_clone is false). Use GET /voices to list available voices
Task name
Task completion callback URL
Idempotency key (prevents duplicate submissions)
Response
| Field | Description |
|---|---|
| data.task_id | Task ID |
| data.task_type | Task type |
| data.status | Task status |
Smart Eraser
Create a subtitle/watermark removal task.
Request Body
Source video URL (HTTPS)
Task name
Erasure regions array (required when erasure_mode is manual/protect; currently only the first region is used). Each item: x (left edge, 0-1), y (top edge, 0-1), width (0-1), height (0-1). Coordinates are relative to video dimensions
Erasure mode (default: auto). auto=auto-detect and erase subtitles/watermarks, no normalized_regions needed; manual=erase content within specified region, normalized_regions required; protect=protect specified region from erasure (erase subtitles/watermarks outside the region), normalized_regions required
Task completion callback URL
Idempotency key
Response
| Field | Description |
|---|---|
| data.task_id | Task ID |
| data.task_type | Task type |
| data.status | Task status |
Subtitle Translation
Create a subtitle translation task to extract speech and translate to subtitles.
Request Body
Source video URL (HTTPS)
Source language codeLanguage Codes
Target language codeLanguage Codes
Task name
Task completion callback URL
Idempotency key
Response
| Field | Description |
|---|---|
| data.task_id | Task ID |
| data.task_type | Task type |
| data.status | Task status |
Face Swap
Create a face swap task to replace faces in video with a source image.
Request Body
Source video URL (HTTPS)
Target face image URL (HTTPS)
Task name
Task completion callback URL
Idempotency key
Response
| Field | Description |
|---|---|
| data.task_id | Task ID |
| data.task_type | Task type |
| data.status | Task status |
Lip Sync
Create a lip sync task to synchronize lip movements with audio.
Request Body
Source video URL (HTTPS)
Audio file URL (HTTPS)
Task name
Task completion callback URL
Idempotency key
Response
| Field | Description |
|---|---|
| data.task_id | Task ID |
| data.task_type | Task type |
| data.status | Task status |
Multi-Speaker Video Translation
Submit a multi-speaker video translation task. The system automatically identifies speakers and assigns individual voices for translated dubbing.
Request Body
Video file URL (S3 presigned URL or publicly accessible URL)
Source language codeLanguage Codes
Target language codeLanguage Codes
Expected number of speakers (auto-detect if not provided)
Task name (optional)
Callback URL for task completion notification
Idempotency key (prevents duplicate submissions)
Response
| Field | Description |
|---|---|
| data.task_id | Task ID |
| data.task_type | Task type |
| data.status | Task status |
Audio
Voice Clone
Clone a voice from an audio sample. Synchronous API, returns voice ID.
Request Body
Audio file URL (HTTPS)
Voice name
Response
| Field | Description |
|---|---|
| data.voice_id | Voice ID |
| data.name | Voice name |
| data.type | Voice type |
Text to Speech
Create a text-to-speech task, processed asynchronously.
Request Body
Text to convert
Voice ID
Language codeLanguage Codes
Task name
Task completion callback URL
Idempotency key
Emotional tone. Allowed values: auto / neutral / happy / sad / angry / surprised. Default: auto (inferred from text). Note: some cloned voices do not support emotion override and will silently fall back to auto.
Number / date pronunciation. Allowed values: auto / on / off. Default: auto. on = read as full words (e.g., "$5" → "five dollars"); off = read literal characters.
Response
| Field | Description |
|---|---|
| data.task_id | Task ID |
| data.task_type | Task type |
| data.status | Task status |
Voices
List Voices
Query available voices with language and gender filtering.
Query Parameters
Filter by language (e.g., zh-CN)
Filter by gender (male / female)
Response
| Field | Description |
|---|---|
| data[].voice_id | Voice ID |
| data[].name | Voice name |
| data[].language | Language |
| data[].gender | Gender |
| data[].accent | Accent |
| data[].age_range | Age range |
| data[].preview_url | Preview URL |
| data[].type | Voice type (system / cloned) |
Files
Get Upload URL
Get a pre-signed upload URL for direct file upload to object storage.
Request Body
File name
File size in bytes
File MD5 (optional, for deduplication)
Response
| Field | Description |
|---|---|
| data.file_id | File ID |
| data.upload_url | Pre-signed upload URL |
| data.upload_method | Upload method (PUT) |
| data.upload_headers | Required upload headers |
| data.expires_at | Upload URL expiration time |
| data.url | File download URL (returned immediately for duplicates) |
Confirm Upload
Confirm file upload completion and get download URL.
Request Body
File ID (from Get Upload URL response)
Response
| Field | Description |
|---|---|
| data.file_id | File ID |
| data.url | File download URL |
| data.expires_at | URL expiration time (ISO 8601) |
Refresh URL
Refresh file download URL (use when URL has expired).
Request Body
File ID
Response
| Field | Description |
|---|---|
| data.file_id | File ID |
| data.url | New file download URL |
| data.expires_at | URL expiration time (ISO 8601) |
Error Types
| Type | HTTP Status | Description |
|---|---|---|
| authentication_error | 401 | API Key missing, invalid, or disabled |
| validation_error | 400 | Invalid parameters, missing fields, or URL validation failure |
| rate_limit_error | 429 | Rate limit exceeded |
| permission_error | 403 | HTTPS required or insufficient permissions |
| insufficient_credits | 402 | Insufficient credits |
| not_found | 404 | Resource not found |
| internal_error | 500 | Internal server error |
Task Statuses
| Status | Description |
|---|---|
| pending | Pending — Task submitted, waiting to be processed |
| processing | Processing — Task is being executed |
| completed | Completed — Task finished successfully |
| failed | Failed — Task execution failed |
Task Types
| Task Type | Description |
|---|---|
| video_translation | Video Translation |
| multi_speaker_translation | Multi-Speaker Translation |
| lip_sync | Lip Sync |
| smart_erasure | Smart Eraser |
| subtitle_translation | Subtitle Translation |
| face_swap | Face Swap |
| text_to_speech | Text to Speech |
Language Codes
The API accepts ISO 639-1 standard language codes. Source languages reflect speech-recognition (ASR) coverage; target languages reflect text-to-speech (TTS) coverage. The supported lists are below.
Source Languages (source_language)
| Code | Language |
|---|---|
| zh | Chinese |
| en | English |
| ja | Japanese |
| ko | Korean |
| ru | Russian |
| de | German |
| fr | French |
| ar | Arabic |
| es | Spanish |
| it | Italian |
| vi | Vietnamese |
| pt | Portuguese |
| ms | Malay |
| tl | Filipino |
| id | Indonesian |
| nl | Dutch |
| th | Thai |
| no | Norwegian |
| ca | Catalan |
| bn | Bengali |
| sr | Serbian |
| yue | Cantonese |
| hi | Hindi |
| tr | Turkish |
| pl | Polish |
| uk | Ukrainian |
| fa | Persian |
| ur | Urdu |
| sv | Swedish |
| da | Danish |
| fi | Finnish |
| cs | Czech |
| hu | Hungarian |
| ro | Romanian |
| el | Greek |
| bg | Bulgarian |
| hr | Croatian |
| sk | Slovak |
| sl | Slovenian |
| et | Estonian |
| lv | Latvian |
| lt | Lithuanian |
| bs | Bosnian |
| mk | Macedonian |
| is | Icelandic |
| sw | Swahili |
| ta | Tamil |
| te | Telugu |
| ml | Malayalam |
| kn | Kannada |
| gu | Gujarati |
| mr | Marathi |
| pa | Punjabi |
| km | Khmer |
| lo | Lao |
| my | Burmese |
| mn | Mongolian |
| ne | Nepali |
| he | Hebrew |
| az | Azerbaijani |
| kk | Kazakh |
| uz | Uzbek |
| ky | Kyrgyz |
| af | Afrikaans |
| am | Amharic |
| as | Assamese |
| ast | Asturian |
| be | Belarusian |
| ceb | Cebuano |
| cy | Welsh |
| ff | Fula |
| ga | Irish |
| gl | Galician |
| ha | Hausa |
| hy | Armenian |
| ig | Igbo |
| jv | Javanese |
| ka | Georgian |
| kea | Kabuverdianu |
| ku | Kurdish |
| lb | Luxembourgish |
| lg | Ganda |
| ln | Lingala |
| luo | Luo |
| mi | Maori |
| mt | Maltese |
| nso | Northern Sotho |
| ny | Nyanja |
| oc | Occitan |
| or | Odia |
| ps | Pashto |
| sd | Sindhi |
| sn | Shona |
| so | Somali |
| tg | Tajik |
| umb | Umbundu |
| wo | Wolof |
| xh | Xhosa |
| zu | Zulu |
Target Languages (target_language)
| Code | Language |
|---|---|
| zh | Chinese |
| en | English |
| ja | Japanese |
| ko | Korean |
| ru | Russian |
| de | German |
| fr | French |
| ar | Arabic |
| es | Spanish |
| it | Italian |
| vi | Vietnamese |
| pt | Portuguese |
| id | Indonesian |
| ms | Malay |
| tl | Filipino |
| nl | Dutch |
| th | Thai |
| tr | Turkish |
| pl | Polish |
| uk | Ukrainian |
| sv | Swedish |
| cs | Czech |
| el | Greek |
| hi | Hindi |
| fi | Finnish |
| da | Danish |
| no | Norwegian |
| hu | Hungarian |
| ro | Romanian |
| sk | Slovak |
| hr | Croatian |
| bg | Bulgarian |
| sr | Serbian |
| ca | Catalan |
| fa | Persian |
| ta | Tamil |
| bn | Bengali |
| af | Afrikaans |
| hy | Armenian |
| as | Assamese |
| az | Azerbaijani |
| be | Belarusian |
| bs | Bosnian |
| ceb | Cebuano |
| ny | Nyanja |
| et | Estonian |
| gl | Galician |
| ka | Georgian |
| gu | Gujarati |
| ha | Hausa |
| he | Hebrew |
| is | Icelandic |
| ga | Irish |
| jv | Javanese |
| kn | Kannada |
| kk | Kazakh |
| ky | Kyrgyz |
| lv | Latvian |
| ln | Lingala |
| lt | Lithuanian |
| lb | Luxembourgish |
| mk | Macedonian |
| ml | Malayalam |
| mr | Marathi |
| ne | Nepali |
| ps | Pashto |
| pa | Punjabi |
| sd | Sindhi |
| sl | Slovenian |
| so | Somali |
| sw | Swahili |
| te | Telugu |
| ur | Urdu |
| cy | Welsh |
