API reference: Audio
The Audio endpoints (10 operations), generated from the OpenAPI document (https://faraatarjomeh.com/api/v1/openapi.json). For task-level walkthroughs use the guides; for error handling use /api/v1/docs/errors. The full reference: /api/v1/docs/reference.
At a glance#
- Auth on every call:
Authorization: Bearer $FARA_API_KEY scope:readfor GET/HEAD,writefor the rest- spends Fara: the call holds or charges Fara; get the price first and send
Idempotency-Key - Path parameters in the examples are shell variables (
$JOB_ID,$ID…) - Errors:
application/problem+jsonwith a stablecode(not repeated per endpoint below)
Index#
- Audio: GET /api/v1/audio/voices, GET /api/v1/audio/pricing, GET /api/v1/audio/jobs, POST /api/v1/audio/jobs, GET /api/v1/audio/jobs/{id}, DELETE /api/v1/audio/jobs/{id}, PATCH /api/v1/audio/jobs/{id}/segments/{segmentId}, POST /api/v1/audio/jobs/{id}/approve, POST /api/v1/audio/jobs/{id}/cancel, GET /api/v1/audio/jobs/{id}/download
Audio#
Podcast or audiobook from a finished translation.
GET /api/v1/audio/voices#
List voices and moods for podcasts and audiobooks
- operationId
listAudioVoices· scoperead· free
Response 200
Responses
200Voices and moods. (application/json)- Errors:
401,403,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/audio/voices" \
-H "Authorization: Bearer $FARA_API_KEY"GET /api/v1/audio/pricing#
Get podcast and audiobook pricing
- operationId
getAudioPricing· scoperead· free
Response 200
Responses
200Pricing. (application/json)- Errors:
401,403,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/audio/pricing" \
-H "Authorization: Bearer $FARA_API_KEY"GET /api/v1/audio/jobs#
List audio jobs
- operationId
listAudioJobs· scoperead· free
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
limit |
query | integer | no | Items to return (at most 50). — default: 20; min 1; max 50 |
offset |
query | integer | no | Items to skip. — default: 0; min 0 |
q |
query | string | no | Search by name. Matches the name given to the job or its original file name, ignoring case. Plain text, at most 100 characters; blank means no search. — max length 100 |
translationJobId |
query | string | no | Only jobs made from this translation. |
feature |
query | string | no | Only this kind. — one of: podcast, audiobook |
Response 200
Responses
200Jobs. (application/json)- Errors:
400,401,403,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/audio/jobs" \
-H "Authorization: Bearer $FARA_API_KEY"POST /api/v1/audio/jobs#
Make a podcast or audiobook from a translation
- operationId
createAudioJob· scopewrite· spends Fara · sendIdempotency-Key
Holds holdFara (the price of the longest length plus 20%), charges the actual cost when it finishes, and releases the rest. In rare cases the actual cost is higher than the hold. The job stops at awaiting_review with a script you can edit, then approve.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Request body application/json (required)
Response 201
Responses
201Created. (application/json)- Errors:
400,401,402,403,404,409,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X POST "https://faraatarjomeh.com/api/v1/audio/jobs" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"jobId":"string","feature":"podcast"}'GET /api/v1/audio/jobs/{id}#
Get an audio job with its script
- operationId
getAudioJob· scoperead· free
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Job id. |
Response 200
Responses
200The job. (application/json)- Errors:
401,403,404,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/audio/jobs/$ID" \
-H "Authorization: Bearer $FARA_API_KEY"DELETE /api/v1/audio/jobs/{id}#
Delete a podcast or audiobook job permanently
- operationId
deleteAudioJob· scopewrite· free · sendIdempotency-Key
Removes the script and the audio. A podcast or audiobook saved on the translation from this job is removed too from our servers. Ledger rows stay. Only finished jobs (completed, failed, cancelled): a running or queued job answers 409 JOB_NOT_FINISHED; cancel it first. Afterwards the job answers 404.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Job id. |
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Responses
204Deleted.- Errors:
400,401,403,404,409,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X DELETE "https://faraatarjomeh.com/api/v1/audio/jobs/$ID" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"PATCH /api/v1/audio/jobs/{id}/segments/{segmentId}#
Edit one script segment
- operationId
editAudioScriptSegment· scopewrite· free · sendIdempotency-Key
Only while awaiting_review. The whole script must stay within the held length.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Job id. |
segmentId |
path | string | yes | Segment id from the job's review data. |
If-Match |
header | string | yes | The job's current reviewVersion, bare (3) or quoted ("3"). |
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Request body application/json (required)
Response 200
Responses
200Saved. (application/json)- Errors:
400,401,403,404,409,413,422,428,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X PATCH "https://faraatarjomeh.com/api/v1/audio/jobs/$ID/segments/$SEGMENT_ID" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'If-Match: "$REVIEW_VERSION"' \
-H "Content-Type: application/json" \
-d '{"text":"string"}'POST /api/v1/audio/jobs/{id}/approve#
Approve the script and make the audio
- operationId
approveAudioScript· scopewrite· free · sendIdempotency-Key
Uses the Fara already held; nothing new is held.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Job id. |
If-Match |
header | string | yes | The job's current reviewVersion, bare (3) or quoted ("3"). |
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Response 200
Responses
200Approved. (application/json)- Errors:
400,401,403,404,409,422,428,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X POST "https://faraatarjomeh.com/api/v1/audio/jobs/$ID/approve" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'If-Match: "$REVIEW_VERSION"'POST /api/v1/audio/jobs/{id}/cancel#
Cancel an audio job
- operationId
cancelAudioJob· scopewrite· free · sendIdempotency-Key
Releases the held Fara.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Job id. |
Idempotency-Key |
header | string | no | see /api/v1/docs/conventions#idempotency |
Response 200
Responses
200Cancelled. (application/json)- Errors:
400,401,403,404,409,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X POST "https://faraatarjomeh.com/api/v1/audio/jobs/$ID/cancel" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"GET /api/v1/audio/jobs/{id}/download#
Download the MP3
- operationId
downloadAudio· scoperead· free
Supports Range requests.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Job id. |
Responses
200The MP3. (audio/mpeg)206Part of the file, for a singleRange: bytes=start-endrequest. (audio/mpeg)416The requested range is outside the file.Content-Range: bytes */totalgives the size.- Errors:
401,403,404,409,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/audio/jobs/$ID/download" \
-H "Authorization: Bearer $FARA_API_KEY"Schemas#
Named request and response objects used above. Nested objects are flattened as parent.child; arrays as parent[].child.
ApproveResponse#
| Field | Type | Required | Notes |
|---|---|---|---|
ok |
boolean | yes | |
status |
string | yes | active. |
reviewVersion |
integer | no | |
untranslatedSpeechSegmentIds |
string[] | no | Video only: spoken segments with no Persian text. They will be silent. |
AudioCreateRequest#
| Field | Type | Required | Notes |
|---|---|---|---|
jobId |
string | yes | Id of a completed translation job. |
feature |
string | yes | one of: podcast, audiobook |
voiceId |
string | no | Audiobook narrator: a voice id from GET /api/v1/audio/voices, or male / female. Default male. |
voiceGender |
string | no | Audiobook only, used when voiceId is left out. Default male. — one of: male, female |
speaker1VoiceId |
string | no | Podcast only: voice id of the first speaker. Default: the male default voice. |
speaker2VoiceId |
string | no | Podcast only: voice id of the second speaker. Default: the female default voice. |
voiceMood |
string | no | Mood of the voices. Default neutral. — one of: neutral, friendly, formal, happy, sad, calm, energetic, serious |
AudioJobEnvelope#
| Field | Type | Required | Notes |
|---|---|---|---|
job |
object | yes | |
job._id |
string | yes | Audio job id. |
job.displayName |
string | null | no | The name the customer gave the job (null: the original name is shown). — may be null |
job.feature |
string | no | one of: podcast, audiobook |
job.translationJobId |
string | no | |
job.status |
string | yes | pending, active, awaiting_review (waiting for your edits and approval), and the end states completed, failed, cancelled. Treat any other value as still running. |
job.stage |
string | no | |
job.progress |
number | no | |
job.voiceGender |
string | null | no | may be null |
job.voiceKey |
string | null | no | Audiobook narrator voice id. — may be null |
job.speakerVoiceKeys |
object | null | no | Podcast speaker voice ids. — may be null |
job.speakerVoiceKeys.speaker1 |
string | no | |
job.speakerVoiceKeys.speaker2 |
string | no | |
job.voiceMood |
string | null | no | may be null |
job.reviewVersion |
integer | no | Send as If-Match when editing or approving the script. |
job.script |
object[] | no | Only on GET /api/v1/audio/jobs/{id}. |
job.script[].id |
string | no | |
job.script[].text |
string | no | |
job.estimatedMinutes |
number | no | |
job.estimatedCost |
object | null | no | Price for the script as it is now; faraCharged is in Fara. — may be null |
job.cost |
object | null | no | Price of a media job, in Fara. — may be null |
job.cost.faraCharged |
number | no | Fara for this job: the held amount while running, the actual charge once finished. |
job.cost.minutesBilled |
number | no | Billed minutes, for media jobs. |
job.cost.heldFara |
number | no | Fara held when the job started. |
job.cost.refundedFara |
number | no | Part of the hold returned after the actual charge. |
job.customerErrorCode |
string | null | no | Why the job failed, as a stable code. Null while the job is fine. — one of: NO_TEXT_LAYER, FILE_TOO_LARGE, TOO_MANY_PAGES, MEDIA_TOO_LONG, TOOK_TOO_LONG, PARTIAL_SECTIONS, INSUFFICIENT_CREDITS, SPEND_LIMIT_REACHED, SERVICE_BUSY, YOUTUBE_UNAVAILABLE, NO_SPEECH_FOUND, VOICE_CONSENT_REQUIRED, RETRY_LIMIT_REACHED, UNDER_REVIEW, OUTLINE_NO_MATERIAL, DOCUMENT_NO_MATERIAL, OUTLINE_EMPTY, RECOVERY_LIMIT, UNSUPPORTED_FILE_TYPE, DOCUMENT_PROTECTED, INVALID_DOCUMENT, DOCUMENT_CONVERSION_INCOMPLETE, DOCUMENT_CONVERSION_FAILED, GENERIC, null; may be null |
job.createdAt |
string | null | no | may be null |
job.updatedAt |
string | null | no | may be null |
AudioJobList#
| Field | Type | Required | Notes |
|---|---|---|---|
jobs |
object[] | yes | |
jobs[]._id |
string | yes | Audio job id. |
jobs[].displayName |
string | null | no | The name the customer gave the job (null: the original name is shown). — may be null |
jobs[].feature |
string | no | one of: podcast, audiobook |
jobs[].translationJobId |
string | no | |
jobs[].status |
string | yes | pending, active, awaiting_review (waiting for your edits and approval), and the end states completed, failed, cancelled. Treat any other value as still running. |
jobs[].stage |
string | no | |
jobs[].progress |
number | no | |
jobs[].voiceGender |
string | null | no | may be null |
jobs[].voiceKey |
string | null | no | Audiobook narrator voice id. — may be null |
jobs[].speakerVoiceKeys |
object | null | no | Podcast speaker voice ids. — may be null |
jobs[].speakerVoiceKeys.speaker1 |
string | no | |
jobs[].speakerVoiceKeys.speaker2 |
string | no | |
jobs[].voiceMood |
string | null | no | may be null |
jobs[].reviewVersion |
integer | no | Send as If-Match when editing or approving the script. |
jobs[].script |
object[] | no | Only on GET /api/v1/audio/jobs/{id}. |
jobs[].script[].id |
string | no | |
jobs[].script[].text |
string | no | |
jobs[].estimatedMinutes |
number | no | |
jobs[].estimatedCost |
object | null | no | Price for the script as it is now; faraCharged is in Fara. — may be null |
jobs[].cost |
object | null | no | Price of a media job, in Fara. — may be null |
jobs[].cost.faraCharged |
number | no | Fara for this job: the held amount while running, the actual charge once finished. |
jobs[].cost.minutesBilled |
number | no | Billed minutes, for media jobs. |
jobs[].cost.heldFara |
number | no | Fara held when the job started. |
jobs[].cost.refundedFara |
number | no | Part of the hold returned after the actual charge. |
jobs[].customerErrorCode |
string | null | no | Why the job failed, as a stable code. Null while the job is fine. — one of: NO_TEXT_LAYER, FILE_TOO_LARGE, TOO_MANY_PAGES, MEDIA_TOO_LONG, TOOK_TOO_LONG, PARTIAL_SECTIONS, INSUFFICIENT_CREDITS, SPEND_LIMIT_REACHED, SERVICE_BUSY, YOUTUBE_UNAVAILABLE, NO_SPEECH_FOUND, VOICE_CONSENT_REQUIRED, RETRY_LIMIT_REACHED, UNDER_REVIEW, OUTLINE_NO_MATERIAL, DOCUMENT_NO_MATERIAL, OUTLINE_EMPTY, RECOVERY_LIMIT, UNSUPPORTED_FILE_TYPE, DOCUMENT_PROTECTED, INVALID_DOCUMENT, DOCUMENT_CONVERSION_INCOMPLETE, DOCUMENT_CONVERSION_FAILED, GENERIC, null; may be null |
jobs[].createdAt |
string | null | no | may be null |
jobs[].updatedAt |
string | null | no | may be null |
AudioPricing#
| Field | Type | Required | Notes |
|---|---|---|---|
faraPerMin |
number | no | Fara per minute of finished audio, as billed. |
podcast |
object | no | |
podcast.targetMinutes |
number | no | |
podcast.maxMinutes |
number | no | |
podcast.holdFara |
number | no | Fara held when a podcast job is created. |
audiobook |
object | no | |
audiobook.targetMinutes |
number | no | |
audiobook.minMinutes |
number | no | |
audiobook.maxMinutes |
number | no | |
audiobook.holdFara |
number | no | Fara held when an audiobook job is created. |
OkResponse#
| Field | Type | Required | Notes |
|---|---|---|---|
ok |
boolean | yes |
ScriptSegmentEditRequest#
| Field | Type | Required | Notes |
|---|---|---|---|
text |
string | yes | New text for this script segment. |
ScriptSegmentEditResponse#
| Field | Type | Required | Notes |
|---|---|---|---|
ok |
boolean | yes | |
reviewVersion |
integer | yes | |
estimatedMinutes |
number | no | |
estimatedCost |
object | null | no | may be null |
VoiceCatalog#
| Field | Type | Required | Notes |
|---|---|---|---|
voices |
object[] | yes | |
voices[].id |
string | yes | Voice id, for example female-warm. |
voices[].gender |
string | yes | one of: male, female |
voices[].labelFa |
string | no | Name in Persian. |
voices[].labelEn |
string | no | Name in English. |
voices[].lineFa |
string | no | One-line description in Persian. |
voices[].lineEn |
string | no | One-line description in English. |
voices[].previewUrl |
string | no | Path of a short Persian sample (MP3) on this site. |
voices[].default |
boolean | no | The voice used for this gender when you send only male or female. |
moods |
object[] | yes | |
moods[].id |
string | yes | one of: neutral, friendly, formal, happy, sad, calm, energetic, serious |
moods[].labelFa |
string | no | |
moods[].labelEn |
string | no |