API Reference / Introduction

Introduction

Explore the Oiiyao API reference with comprehensive guides, code examples, and endpoint documentation. Integrate powerful AI video translation, voice synthesis, and smart editing into your applications.

Base URL

https://api.oiiyao.com

Authentication

All API requests must include your API Key in the Authorization header, format: Bearer .

Need an API Key?

Go to the Developer Console to apply for your API Key.

Go to Console
HeaderDescription
AuthorizationFormat: 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

FieldTypeDescription
successbooleanWhether the request was successful
dataobjectBusiness data object
usageobjectCredits usage info (only returned when credits are consumed)
usage.credits_usedintegerCredits consumed by this request
usage.credits_remainingintegerRemaining credits
errorobjectError info object (only returned on failure)
error.typestringError type identifier
error.codestringError code
error.messagestringError description
error.paramstringRelated parameter name (optional)

Account

GET

Get Balance

Query current account credit balance and rate limit information.

Response

FieldDescription
data.credits_remainingRemaining credits
data.planCurrent plan
data.expires_atPlan expiration time
data.rate_limitsRate limit information
data.rate_limits.requests_per_minuteRequests per minute limit
data.rate_limits.queries_per_secondQueries per second limit
GET

Usage History

Query account credit usage history with date range filtering and cursor pagination.

Query Parameters

start_datestring

Start date (format: yyyy-MM-dd)

end_datestring

End date (format: yyyy-MM-dd)

cursorstring

Pagination cursor (from previous response's next_cursor)

limitinteger

Items per page (max 100, default 20)

Response

FieldDescription
data.recordsUsage records list
data.records[].task_idTask ID
data.records[].task_typeTask type
data.records[].credits_usedCredits consumed
data.records[].created_atCreated at (ISO 8601)
data.total_credits_usedTotal credits consumed
data.next_cursorNext page cursor
data.has_moreWhether more data exists
GET

Pricing

Query credit pricing for all task types.

Response

FieldDescription
data.pricingPricing list
data.pricing[].task_typeTask type
data.pricing[].credits_per_minuteCredits per minute
data.pricing[].descriptionDescription
data.pricing[].languageLanguage

Tasks

GET

Get Task

Query task details by task ID, including processing status and result files.

Path Parameters

task_idstringREQUIRED

Task ID

Response

FieldDescription
data.task_idTask ID
data.task_typeTask type
data.statusTask status (pending / processing / completed / failed)
data.progressProcessing progress (0-100)
data.nameTask name
data.source_languageSource language
data.target_languageTarget language
data.outputOutput file information
data.output.video_urlResult video URL
data.output.subtitle_urlSubtitle file URL
data.output.audio_urlAudio file URL (returned for text_to_speech tasks)
data.output.vocals_urlVocals file URL (returned for audio_separation tasks only)
data.output.background_urlBackground music file URL (returned for audio_separation tasks only)
data.output.expires_atOutput URL expiration time (ISO 8601). URLs are valid for 2 hours. Use POST /files/refresh-url to get new URLs after expiration
data.credits_usedCredits consumed
data.created_atCreated at (ISO 8601)
data.completed_atCompleted at (ISO 8601)
data.error_messageError message (only on failure)
GET

List Tasks

Query task list with status and type filtering, using cursor pagination.

Query Parameters

statusstring

Filter by status (pending / processing / completed / failed)

task_typestring

Filter by task type

cursorstring

Pagination cursor

limitinteger

Items per page (max 100, default 20)

Response

FieldDescription
data.tasksTask list
data.next_cursorNext page cursor
data.has_moreWhether more data exists

Videos

POST

Video Translation

Create a video translation task with multi-language support and dubbing.

Request Body

video_urlstringREQUIRED

Source video URL (HTTPS)

source_languagestringREQUIRED

Source language codeLanguage Codes

target_languagestringREQUIRED

Target language codeLanguage Codes

voice_cloneboolean

Clone the original speaker's voice (default: false). When true, voice_id is ignored

voice_idstring

Voice ID (required when voice_clone is false). Use GET /voices to list available voices

namestring

Task name

callback_urlstring

Task completion callback URL

idempotency_keystring

Idempotency key (prevents duplicate submissions)

Response

FieldDescription
data.task_idTask ID
data.task_typeTask type
data.statusTask status
POST

Smart Eraser

Create a subtitle/watermark removal task.

Request Body

video_urlstringREQUIRED

Source video URL (HTTPS)

namestring

Task name

normalized_regionsarray<object>

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_modestring

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

callback_urlstring

Task completion callback URL

idempotency_keystring

Idempotency key

Response

FieldDescription
data.task_idTask ID
data.task_typeTask type
data.statusTask status
POST

Subtitle Translation

Create a subtitle translation task to extract speech and translate to subtitles.

Request Body

video_urlstringREQUIRED

Source video URL (HTTPS)

source_languagestringREQUIRED

Source language codeLanguage Codes

target_languagestringREQUIRED

Target language codeLanguage Codes

namestring

Task name

callback_urlstring

Task completion callback URL

idempotency_keystring

Idempotency key

Response

FieldDescription
data.task_idTask ID
data.task_typeTask type
data.statusTask status
POST

Face Swap

Create a face swap task to replace faces in video with a source image.

Request Body

video_urlstringREQUIRED

Source video URL (HTTPS)

image_urlstringREQUIRED

Target face image URL (HTTPS)

namestring

Task name

callback_urlstring

Task completion callback URL

idempotency_keystring

Idempotency key

Response

FieldDescription
data.task_idTask ID
data.task_typeTask type
data.statusTask status
POST

Lip Sync

Create a lip sync task to synchronize lip movements with audio.

Request Body

video_urlstringREQUIRED

Source video URL (HTTPS)

audio_urlstringREQUIRED

Audio file URL (HTTPS)

namestring

Task name

callback_urlstring

Task completion callback URL

idempotency_keystring

Idempotency key

Response

FieldDescription
data.task_idTask ID
data.task_typeTask type
data.statusTask status
POST

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_urlstringREQUIRED

Video file URL (S3 presigned URL or publicly accessible URL)

source_languagestringREQUIRED

Source language codeLanguage Codes

target_languagestringREQUIRED

Target language codeLanguage Codes

expected_speaker_countinteger

Expected number of speakers (auto-detect if not provided)

namestring

Task name (optional)

callback_urlstring

Callback URL for task completion notification

idempotency_keystring

Idempotency key (prevents duplicate submissions)

Response

FieldDescription
data.task_idTask ID
data.task_typeTask type
data.statusTask status

Audio

POST

Voice Clone

Clone a voice from an audio sample. Synchronous API, returns voice ID.

Request Body

audio_urlstringREQUIRED

Audio file URL (HTTPS)

namestringREQUIRED

Voice name

Response

FieldDescription
data.voice_idVoice ID
data.nameVoice name
data.typeVoice type
POST

Text to Speech

Create a text-to-speech task, processed asynchronously.

Request Body

textstringREQUIRED

Text to convert

voice_idstringREQUIRED

Voice ID

languagestring

Language codeLanguage Codes

namestring

Task name

callback_urlstring

Task completion callback URL

idempotency_keystring

Idempotency key

emotionstring

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.

text_normalizationstring

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

FieldDescription
data.task_idTask ID
data.task_typeTask type
data.statusTask status
POST

Audio Separation

Separate an audio file into vocals and background music as two independent files.

Request Body

audio_urlstringREQUIRED

Audio file URL (S3 presigned URL or publicly accessible URL)

namestring

Task name (optional)

callback_urlstring

Callback URL for task completion notification

idempotency_keystring

Idempotency key (prevents duplicate submissions)

Response

FieldDescription
data.task_idTask ID
data.task_typeTask type
data.statusTask status

Voices

GET

List Voices

Query available voices with language and gender filtering.

Query Parameters

languagestring

Filter by language (e.g., zh-CN)

genderstring

Filter by gender (male / female)

Response

FieldDescription
data[].voice_idVoice ID
data[].nameVoice name
data[].languageLanguage
data[].genderGender
data[].accentAccent
data[].age_rangeAge range
data[].preview_urlPreview URL
data[].typeVoice type (system / cloned)

Files

POST

Get Upload URL

Get a pre-signed upload URL for direct file upload to object storage.

Request Body

file_namestringREQUIRED

File name

file_sizeintegerREQUIRED

File size in bytes

content_md5string

File MD5 (optional, for deduplication)

Response

FieldDescription
data.file_idFile ID
data.upload_urlPre-signed upload URL
data.upload_methodUpload method (PUT)
data.upload_headersRequired upload headers
data.expires_atUpload URL expiration time
data.urlFile download URL (returned immediately for duplicates)
POST

Confirm Upload

Confirm file upload completion and get download URL.

Request Body

file_idstringREQUIRED

File ID (from Get Upload URL response)

Response

FieldDescription
data.file_idFile ID
data.urlFile download URL
data.expires_atURL expiration time (ISO 8601)
POST

Refresh URL

Refresh file download URL (use when URL has expired).

Request Body

file_idstringREQUIRED

File ID

Response

FieldDescription
data.file_idFile ID
data.urlNew file download URL
data.expires_atURL expiration time (ISO 8601)

Error Types

TypeHTTP StatusDescription
authentication_error401API Key missing, invalid, or disabled
validation_error400Invalid parameters, missing fields, or URL validation failure
rate_limit_error429Rate limit exceeded
permission_error403HTTPS required or insufficient permissions
insufficient_credits402Insufficient credits
not_found404Resource not found
internal_error500Internal server error

Task Statuses

StatusDescription
pendingPending — Task submitted, waiting to be processed
processingProcessing — Task is being executed
completedCompleted — Task finished successfully
failedFailed — Task execution failed

Task Types

Task TypeDescription
video_translationVideo Translation
multi_speaker_translationMulti-Speaker Translation
lip_syncLip Sync
smart_erasureSmart Eraser
subtitle_translationSubtitle Translation
face_swapFace Swap
voice_cloneVoice Clone
text_to_speechText to Speech
audio_separationAudio Separation

Language Codes

The API accepts ISO 639-1 standard language codes. Below are the supported source and target languages.

Source Languages (source_language)

CodeLanguage
zhChinese
enEnglish
jaJapanese
koKorean
ruRussian
deGerman
frFrench
arArabic
esSpanish
itItalian
viVietnamese
ptPortuguese
msMalay
tlFilipino
idIndonesian
nlDutch
thThai
noNorwegian
caCatalan
bnBengali
srSerbian
yueCantonese

Target Languages (target_language)

CodeLanguage
zhChinese
enEnglish
jaJapanese
koKorean
ruRussian
deGerman
frFrench
arArabic
esSpanish
itItalian
viVietnamese
ptPortuguese
pt-BRBrazilian Portuguese
msMalay
tlFilipino
idIndonesian
nlDutch
thThai
noNorwegian
caCatalan
bnBengali
srSerbian
csCzech
bgBulgarian
plPolish
roRomanian
svSwedish
taTamil
trTurkish
ukUkrainian
elGreek
hiHindi
fiFinnish
hrCroatian
skSlovak
daDanish
huHungarian
faPersian

© 2026 Oiiyao Tech. All rights reserved.