API reference: Farsi TTS
The Farsi TTS 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#
- Farsi TTS: GET /api/v1/farsi-tts/voices, GET /api/v1/farsi-tts/pricing, GET /api/v1/farsi-tts/jobs, POST /api/v1/farsi-tts/jobs, GET /api/v1/farsi-tts/jobs/{id}, DELETE /api/v1/farsi-tts/jobs/{id}, PATCH /api/v1/farsi-tts/jobs/{id}/text, POST /api/v1/farsi-tts/jobs/{id}/approve, POST /api/v1/farsi-tts/jobs/{id}/cancel, GET /api/v1/farsi-tts/jobs/{id}/download
Farsi TTS#
Persian text to speech.
GET /api/v1/farsi-tts/voices#
List voices and moods for text to speech
- operationId
listFarsiTtsVoices· 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/farsi-tts/voices" \
-H "Authorization: Bearer $FARA_API_KEY"GET /api/v1/farsi-tts/pricing#
Get text-to-speech pricing
- operationId
getFarsiTtsPricing· 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/farsi-tts/pricing" \
-H "Authorization: Bearer $FARA_API_KEY"GET /api/v1/farsi-tts/jobs#
List text-to-speech jobs
- operationId
listFarsiTtsJobs· 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 |
Response 200
Responses
200Jobs. (application/json)- Errors:
401,403,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/farsi-tts/jobs" \
-H "Authorization: Bearer $FARA_API_KEY"POST /api/v1/farsi-tts/jobs#
Turn text into Persian speech
- operationId
createFarsiTtsJob· scopewrite· spends Fara · sendIdempotency-Key
English text is translated to Persian first. Fara is held from the text length (with room for edits), charged at the actual cost when done, and released on failure or cancel. The job stops at awaiting_review so you can edit the Persian text, 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,409,413,422,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X POST "https://faraatarjomeh.com/api/v1/farsi-tts/jobs" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"text":"string","sourceLang":"en"}'GET /api/v1/farsi-tts/jobs/{id}#
Get a text-to-speech job with its text
- operationId
getFarsiTtsJob· 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/farsi-tts/jobs/$ID" \
-H "Authorization: Bearer $FARA_API_KEY"DELETE /api/v1/farsi-tts/jobs/{id}#
Delete a text-to-speech job permanently
- operationId
deleteFarsiTtsJob· scopewrite· free · sendIdempotency-Key
Removes the text and the audio 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/farsi-tts/jobs/$ID" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"PATCH /api/v1/farsi-tts/jobs/{id}/text#
Edit the Persian text
- operationId
editFarsiTtsText· scopewrite· free · sendIdempotency-Key
Only while awaiting_review, and only up to reservedChars. No If-Match is needed here.
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
id |
path | string | yes | Job id. |
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,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X PATCH "https://faraatarjomeh.com/api/v1/farsi-tts/jobs/$ID/text" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"text":"string"}'POST /api/v1/farsi-tts/jobs/{id}/approve#
Approve the text and make the audio
- operationId
approveFarsiTtsText· scopewrite· free · sendIdempotency-Key
Uses the Fara already held; nothing new is held. If the work cannot be queued, answers 503 SERVICE_BUSY with Retry-After: the job is marked failed and the hold is released.
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
200Approved. (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/farsi-tts/jobs/$ID/approve" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"POST /api/v1/farsi-tts/jobs/{id}/cancel#
Cancel a text-to-speech job
- operationId
cancelFarsiTtsJob· 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/farsi-tts/jobs/$ID/cancel" \
-H "Authorization: Bearer $FARA_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"GET /api/v1/farsi-tts/jobs/{id}/download#
Download the MP3
- operationId
downloadFarsiTtsAudio· 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/farsi-tts/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. |
FarsiTtsCreateRequest#
| Field | Type | Required | Notes |
|---|---|---|---|
text |
string | yes | Text to speak. English text is translated to Persian first. |
sourceLang |
string | yes | one of: en, fa |
voiceId |
string | no | A voice id from GET /api/v1/farsi-tts/voices, or male / female. Default male. |
voiceGender |
string | no | Used when voiceId is left out. Default male. — one of: male, female |
voiceMood |
string | no | Mood of the voice. Default neutral. — one of: neutral, friendly, formal, happy, sad, calm, energetic, serious |
FarsiTtsJobEnvelope#
| Field | Type | Required | Notes |
|---|---|---|---|
job |
object | yes | |
job._id |
string | yes | Job id. |
job.displayName |
string | null | no | The name the customer gave the job (null: the original name is shown). — may be null |
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.sourceLang |
string | no | |
job.voiceGender |
string | no | |
job.voiceKey |
string | null | no | The chosen voice id. — may be null |
job.voiceMood |
string | null | no | may be null |
job.inputText |
string | no | |
job.farsiText |
string | no | Persian text that will be spoken. Editable while awaiting_review. |
job.reservedChars |
integer | no | Most characters the held Fara covers. |
job.estimatedMinutes |
number | no | |
job.estimatedCost |
object | null | no | 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 |
FarsiTtsJobList#
| Field | Type | Required | Notes |
|---|---|---|---|
jobs |
object[] | yes | |
jobs[]._id |
string | yes | Job id. |
jobs[].displayName |
string | null | no | The name the customer gave the job (null: the original name is shown). — may be null |
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[].sourceLang |
string | no | |
jobs[].voiceGender |
string | no | |
jobs[].voiceKey |
string | null | no | The chosen voice id. — may be null |
jobs[].voiceMood |
string | null | no | may be null |
jobs[].inputText |
string | no | |
jobs[].farsiText |
string | no | Persian text that will be spoken. Editable while awaiting_review. |
jobs[].reservedChars |
integer | no | Most characters the held Fara covers. |
jobs[].estimatedMinutes |
number | no | |
jobs[].estimatedCost |
object | null | no | 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 |
FarsiTtsPricing#
| Field | Type | Required | Notes |
|---|---|---|---|
faraPerMin |
number | no | Fara per minute of speech, as billed. |
charsPerMinute |
number | no | Characters of text per minute of speech. |
maxInputChars |
integer | no | |
holdHeadroom |
number | no | The hold is this many times the estimate, to allow for edits. |
FarsiTtsTextRequest#
| Field | Type | Required | Notes |
|---|---|---|---|
text |
string | yes | New Persian text. |
FarsiTtsTextResponse#
| Field | Type | Required | Notes |
|---|---|---|---|
ok |
boolean | yes | |
estimatedMinutes |
number | no | |
estimatedCost |
object | null | no | may be null |
OkResponse#
| Field | Type | Required | Notes |
|---|---|---|---|
ok |
boolean | yes |
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 |