Save To History
POST/text-to-speech/save-to-history
Save already generated audio to the user's history. This endpoint allows saving audio that was previously generated but not saved. Args: audio_data: The audio file to save text: The text that was converted to speech voice_id: The voice ID used for generation voice_name: Voice name (display name) format: Audio format (mp3, wav, etc.) duration: Audio duration in seconds current_user: Authenticated user from JWT cookie history_service: TTS history service Returns: Information about the saved entry
Authentication
Authorization: Bearer vm_sk_… with the media.write permission (or all.write). See Authentication.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
text* | query | string | |
voice_id* | query | string | |
voice_name | query | string | |
format | query | string | |
duration | query | number |
Request body
multipart/form-data
| Field | Type | Description |
|---|---|---|
audio_data* | file |
Response
200 application/json
| Field | Type | Description |
|---|---|---|
audio_url* | string | |
created_at | string | |
duration* | number | |
format* | string | |
text | string | |
voice | string |
{
"audio_url": "string",
"created_at": "2026-12-05T10:00:00Z",
"duration": 0,
"format": "string",
"text": "string",
"voice": "string"
}Errors
401 | Missing, wrong, revoked or expired key. |
403 | The key lacks media.write, the route is not available to keys, or the key's IP allow-list refuses this client. |
402 | Not enough credits, or the key reached its spending cap. |
422 | The request failed validation; `detail` lists the fields. |
429 | Over a rate limit; retry after `Retry-After` seconds. |
All statuses: Errors.
Example
curl -X POST "https://api.voicemint.io/api/v1/text-to-speech/save-to-history?text=TEXT&voice_id=VOICE_ID" \
-H "Authorization: Bearer $VOICEMINT_API_KEY" \
-F "audio_data=@./file"