Audio, video and voices
A media job runs as soon as it is created and is charged at credit prices for the usage the server measures. Read the catalog first; only products marked as open can run.
Prices
Section titled “Prices”Prices are given directly in credits:
| Product | product | Price |
|---|---|---|
| Speech recognition | asr | 20 credits/minute; the fun-asr real-time model 30 credits/minute (billed by the millisecond) |
| Subtitle translation | subtitle_translation | 60 credits/minute |
| Basic video processing (translated subtitles, original audio) | basic_video | 80 credits/minute |
| Full video processing (translated subtitles and dubbing) | full_video | 300 credits/minute |
| Speech synthesis | tts | 1,500 credits per 10,000 billed characters |
| First successful use of a voice | — | 300 credits per voice, charged once |
- Speech recognition is priced by the recognition model used; both models’ prices are listed separately in
pricesofcredit-catalog(themodelfield). - Duration is counted in milliseconds: speech recognition and subtitle translation by the source duration, video by the duration of the delivered video.
- Billed characters for speech synthesis: each Chinese character counts as 2, every other character (including spaces and punctuation) as 1.
- Recognition, translation, dubbing and other steps a product needs are included in its price. If the request allows a lower-tier result (
allowed_fallback_products) and one is delivered, the delivered product’s price applies. - Cost = unit price × usage, rounded to 0.001 credit (1 millicredit).
GET /api/v1/billing/media/credit-catalogPOST /api/v1/billing/media/credit-estimatescredit-catalog returns each product’s prices (prices, in millicredits) and whether it is open; credit-estimates computes the credits needed (rounded_millicredits) for a given duration, text or number of voices. It is for display only: it creates no job and charges nothing.
Create a job
Section titled “Create a job”POST /api/v1/media-jobsIdempotency-Key: unique-request-idProducts:
product | Purpose |
|---|---|
asr | Speech recognition |
tts | Speech synthesis |
subtitle_translation | Subtitle translation for audio and video |
basic_video | Basic video processing |
full_video | Full video processing |
Speech recognition example:
{ "product": "asr", "document_id": "4q8mx2q9z1k7p6ra", "source_language": "auto", "max_duration_ms": 600000}Every product except speech synthesis (tts) requires max_duration_ms (milliseconds, at most 21600000, which is 6 hours).
After the create request returns 202, the server checks the file and starts processing:
- Only the balance is checked before it starts: the balance (after debt) must be above the cost computed from the duration the server measured (for speech synthesis, from the billed characters, including any first-use voice fee not yet charged); with an API key that has a budget, the key’s remaining budget must also be above that cost. Starting does not change the balance.
- Actual usage is charged when it finishes: priced and charged by the delivered product and usage. Whatever the balance does not cover is recorded as debt and the balance shows as negative; credits that arrive later pay off the debt first. New jobs cannot start while the balance is negative.
- Failed or cancelled jobs are not charged.
When the balance is too low or the duration does not fit, nothing starts and nothing is charged: speech synthesis is checked at creation and returns 402 when the balance is too low; other products are checked once the server has measured the duration, and the job ends as failed with error_code insufficient_credits (balance too low) or media_duration_exceeds_confirmed_cap (the real duration exceeds max_duration_ms).
Query and cancel
Section titled “Query and cancel”GET /api/v1/media-jobs/{operation_id}GET /api/v1/media-jobs?limit=25POST /api/v1/media-jobs/{operation_id}/cancelThe query response includes the job status, the delivered files and the settlement reference.
Voices
Section titled “Voices”GET /api/v1/media-voicesPOST /api/v1/media-voicesGET /api/v1/media-voices/{asset_id}POST /api/v1/media-voices/{asset_id}/confirmPOST /api/v1/media-voices/{asset_id}/reconcilePOST /api/v1/media-voices/{asset_id}/revokereconcile recovers an uncertain remote result; it only checks the original operation and never creates a second voice.
Creating a voice requires confirming your rights to the recording:
{ "document_id": "authorized_recording_document_id", "consent": true, "consent_version": "voice-source-rights-v1"}The caller is responsible for making sure the recording is their own or used with valid permission.