Force-align known text against its spoken audio and get word-level timestamps — e.g. align a script with the MP3 from POST /api/v1/tts to build accurate subtitles for any voice. Billing: 1 credit per started 5 minutes of audio, charged only on success. Synchronous — audio up to 30 minutes. Per-key concurrency is limited during beta; requests beyond the limit are rejected, not queued.
Headers
X-API-KeystringrequiredYour VisionStory API key (sk-vs-...), kept server-side. Create or manage keys in API keys (Pro plan and up).
Request body
application/jsonrequiredaudioMediaRefrequiredA media reference — provide exactly one of: asset_id (from the asset library, reusable across
requests), url (one-off public URL), or inline_data (one-off base64, not stored).
asset_idstring | nullnullableAsset ID from POST /api/v1/asset; use for materials reused across requests.
inline_dataInlineDataModel | nullnullableInline base64 media data for one-off use; not added to your asset library.
datastringrequiredThe file's raw bytes encoded as a base64 string (no data: URI prefix).
mime_typestringrequiredMIME type of the inline data, used to detect image vs audio. Audio: ['audio/avi', 'audio/mpeg', 'audio/mp3', 'audio/mp4', 'audio/m4a', 'audio/wav']; images: ['image/jpeg', 'image/jpg', 'image/png', 'image/webp', 'image/heic'].
urlstring | nullnullablePublicly accessible media URL for one-off use; not added to your asset library.
textstringrequiredThe exact text spoken in the audio (e.g. the script you synthesized with POST /api/v1/tts). Timestamps are aligned against this text.
Responses
200Successful Response
application/json
dataAlignResponse | nullrequirednullableThe endpoint payload. Its shape is specific to each endpoint (see that endpoint's response schema); null for operations that return no body, such as delete.
cost_creditintegerCredits charged for this request.
duration_secnumberDuration of the input audio in seconds.
wordsWordDto[]Word-level timestamps for the given text.
end_secnumberrequiredWord end time in seconds.
speakerstring | nullnullableSpeaker label, present only when diarize was requested.
start_secnumberrequiredWord start time in seconds.
textstringrequiredThe word as written.
messagestringHuman-readable status message; "success" on a successful call.
server_timestring · date-timerequiredServer-side timestamp when the response was produced, in ISO 8601 format (UTC).
defaultError response. All failures share one envelope: an error object with a numeric code, a human-readable message, an optional details string, and an optional hint giving an actionable next step (useful for AI agents).
application/json
errorErrorDetailrequiredcodeintegerrequiredMachine-readable error code. Mirrors the HTTP status for transport-level failures (e.g. 401, 404, 422, 500) and may carry a business-specific code otherwise.
detailsstring | nullnullableOptional structured detail about the failure, e.g. a JSON string of per-field validation errors on a 422. Absent when there is nothing extra to report.
hintstring | nullnullableActionable next step for resolving the error, written for both humans and AI agents (e.g. how to fix the request, or where to obtain an API key). May be absent.
messagestringrequiredHuman-readable explanation of what went wrong. Safe to log or surface to end users; not localized.