Conventions
Rules that hold for every endpoint: URLs and versions, request and response formats, asynchronous jobs, idempotency, errors, rate limits, pagination, downloads, review steps, and discovery. Read this once before any guide.
At a glance#
| Topic | Rule |
|---|---|
| Base URL | https://faraatarjomeh.com — all endpoints under /api/v1 |
| Version | v1 in the path. Changes inside v1 only add fields, endpoints or values; see Changelog. |
| Auth | Authorization: Bearer fara_sk_... — Authentication |
| JSON bodies | Content-Type: application/json, max 10 MB, top level must be an object |
| Files | multipart/form-data; the field name is given per endpoint (file, audio, logo) |
| Names | JSON fields are camelCase |
| Times | ISO 8601 in UTC, e.g. 2026-09-25T10:12:03.120Z |
| IDs | translation jobs: UUID (3f1c2b7e-9a4d-4c1e-8f7a-2b9c4d5e6f70); all other jobs and objects: 24-hex (66f1c0a2b4e5d6f7a8b9c0d1) |
| Money | integer Fara |
| Errors | application/problem+json with a stable code — Errors |
| Retries of POST | Idempotency-Key header |
| Unknown fields and values | ignore unknown response fields; treat unknown status values as "still running" |
Asynchronous jobs#
Translation, video, meetings, audio, text-to-speech and transcription run in the background. The create call returns at once (201 or 202) with the job id. Then:
- Poll the job's GET endpoint (listed in each guide), or
- Receive a webhook when its status changes — Webhooks.
Polling: first check after 10 s, then every 30–60 s; never faster than every 5 s per job. Stop at a terminal status.
| Job type | Poll | Terminal statuses | Waits for you at |
|---|---|---|---|
| PDF translation | GET /api/v1/translate/status/{jobId} |
completed, completed_partial, failed, cancelled |
— |
| Video | GET /api/v1/video/jobs/{id} |
completed, failed, cancelled |
awaiting_review (if review was asked for) |
| Meeting minutes | GET /api/v1/meetings/jobs/{id} |
completed, failed, cancelled |
— (new jobs go straight to the PDF) |
| Podcast / audiobook | GET /api/v1/audio/jobs/{id} |
completed, failed, cancelled |
awaiting_review |
| Persian text-to-speech | GET /api/v1/farsi-tts/jobs/{id} |
completed, failed, cancelled |
awaiting_review |
| Transcription | GET /api/v1/transcription/jobs/{id} |
completed, failed, cancelled |
— |
Each guide has the full state machine. completed_partial means the translation finished but more than a quarter of the text stayed in English; outputs can be downloaded.
Idempotency#
Send an Idempotency-Key header on every POST, PUT, PATCH or DELETE you might retry — always on calls that spend Fara. It follows the IETF draft draft-ietf-httpapi-idempotency-key-header.
POST /api/v1/farsi-tts/jobs HTTP/1.1
Authorization: Bearer fara_sk_...
Content-Type: application/json
Idempotency-Key: "8e03978e-40d5-43e8-bc93-6894a57f9324"
{"text": "سلام دنیا", "sourceLang": "fa"}| Rule | Detail |
|---|---|
| Value | 1–255 visible ASCII characters, no spaces. Quoted ("…", structured-field string) or bare. Use a new UUID per operation. |
| Scope | Per account (all keys of the account share it) |
| Kept for | 24 hours after the first request |
| Same key, same request | You get the stored first answer (same status and body) with header Idempotent-Replayed: true. Nothing runs again; nothing is charged again. |
| Same key, different request | 422 IDEMPOTENCY_KEY_REUSED |
| Same key while the first is still running | 409 IDEMPOTENCY_KEY_IN_USE with Retry-After: 2 — wait and send again |
| First answer was a file (PDF, audio) | cannot be replayed: 409 IDEMPOTENCY_KEY_ALREADY_USED with originalStatus. The work was done once; use a new key to do it again. |
First answer was 4xx or 503 |
not stored: nothing was done. Fix the cause (or top up) and send again — the same key is fine. |
First answer was 500, 502 or 504 |
stored and replayed: the work may have happened. Check the job list for a job this request made; if there is none, send again with a new key. |
| "Same request" means | same method, path, query string and JSON body (key order ignored). For file uploads only method, path and query are compared. |
| Without the header | every request runs; a retry after a timeout can create a second job and a second charge |
Retry recipe for any POST:
| Outcome | Next step |
|---|---|
| Network error or timeout (no answer) | Send the identical request with the same key. |
409 IDEMPOTENCY_KEY_IN_USE, 429, 503 |
Wait Retry-After (or back off 2 s, 4 s, 8 s … max 5 min); send with the same key. |
Other 4xx |
Follow the error's rule in Errors. Resending as-is fails again. |
500, 502, 504 |
Look for a job this request made (list endpoint). None → send again with a new key. |
Errors#
Every error from an API-key request is application/problem+json (RFC 9457):
{
"type": "https://faraatarjomeh.com/api/v1/docs/errors#error-insufficient-scope",
"title": "Forbidden",
"status": 403,
"detail": "This API key needs the \"write\" scope for this request.",
"instance": "/api/v1/video/jobs",
"code": "INSUFFICIENT_SCOPE",
"request_id": "5f0b8d2e-1c3a-4b7e-9d6f-0a1b2c3d4e5f",
"requiredScope": "write"
}| Member | Use |
|---|---|
code |
Stable, upper-case. Branch on this. |
status |
Same as the HTTP status |
detail |
Human text; can change; do not parse |
type |
Link to the code's entry in Errors |
instance |
The request path |
request_id |
Give it to support |
| other members | Extra data for that error (balance, estimatedCost, requiredScope, currentVersion, retryAfter …) |
What to do for each code: Errors and the machine-readable errors.json.
Rate limits#
| Limit | Default | Key |
|---|---|---|
api_key |
120 requests per 60 s | per API key |
global |
300 requests per 60 s | per client IP |
api |
500 requests per 60 s | per account |
upload |
300 uploads per hour | per account (file uploads and job creation, website and API together). A chunked upload counts once, at POST /api/v1/uploads; its chunks and the job made from it do not count. |
These are the limits the server enforces right now. There is no separate limit on how many jobs run at once: jobs queue and run in order.
Every response carries the IETF draft-ietf-httpapi-ratelimit-headers fields, one entry per limit that applied:
RateLimit-Policy: "global"; q=300; w=60, "api_key"; q=120; w=60
RateLimit: "global"; r=287; t=41, "api_key"; r=113; t=41q = quota, w = window seconds, r = requests left, t = seconds until the window resets. When a limit is hit you get 429 RATE_LIMITED with Retry-After (seconds). Slow down when r gets low.
Pagination#
Three styles, depending on the endpoint:
| Style | Endpoints | Request | Response |
|---|---|---|---|
| Cursor | GET /api/v1/account/transactions, GET /api/v1/webhook-endpoints/{id}/deliveries |
limit (1–100, default 20), startingAfter (an id from the last page) |
data, hasMore, nextCursor |
| Page | GET /api/v1/jobs, GET /api/v1/translate/history, GET /api/v1/profile/credits, GET /api/v1/payment/history |
page (from 1), limit (max 100) |
total, page, totalPages |
| Offset | GET /api/v1/video/jobs, GET /api/v1/meetings/jobs, GET /api/v1/audio/jobs, GET /api/v1/farsi-tts/jobs, GET /api/v1/transcription/jobs |
limit (max 50, default 20), offset |
jobs (no total; stop when fewer than limit come back) |
Lists are newest first.
Downloads#
- Download endpoints answer with the file itself and
Content-Disposition: attachment; filename="…". - Video and audio downloads support
Rangerequests (206 Partial Content) for resuming. - Downloads are free and can be repeated.
Review steps and If-Match#
Video and podcast/audiobook jobs can stop at awaiting_review so a person can edit the text before the paid audio or video is made (Persian text-to-speech too, without If-Match). Every edit and approve call must send the job's current reviewVersion (from its GET) in If-Match:
PATCH /api/v1/video/jobs/66f1c0a2b4e5d6f7a8b9c0d1/segments/12 HTTP/1.1
Authorization: Bearer fara_sk_...
Content-Type: application/json
If-Match: "3"
{"farsi": "متن ویرایششده"}| Case | Answer | What to do |
|---|---|---|
No If-Match |
428 REVIEW_VERSION_REQUIRED |
Send it |
Not a whole number ("3" or 3 are both fine; W/"3" is not) |
400 INVALID_REVIEW_VERSION |
Fix the header |
| Someone else changed the review | 409 REVIEW_VERSION_CONFLICT with currentVersion |
GET the job, re-apply your edit, send with the new version |
Successful edits return the new reviewVersion; use it for the next call. Persian text-to-speech edits do not use If-Match.
Browsers and CORS#
API keys are for servers. Requests from web pages on other sites are refused by the browser (no CORS permission). Call the API from your backend and pass results to your front end.
Discovery#
| Resource | URL | For |
|---|---|---|
| OpenAPI 3.1 | https://faraatarjomeh.com/api/v1/openapi.json |
code generators, Postman, agents |
| API catalog (RFC 9727) | https://faraatarjomeh.com/.well-known/api-catalog |
automated API discovery |
| llms.txt | https://faraatarjomeh.com/api/v1/docs/llms.txt |
AI agents: index of these docs |
| All docs in one file | https://faraatarjomeh.com/api/v1/docs/llms-full.txt |
AI agents: full context in one fetch |
| Any page as Markdown | add .md to its URL, or send Accept: text/markdown |
AI agents |
| Error catalog | https://faraatarjomeh.com/api/v1/docs/errors.json |
clients that map codes to actions |
API-key responses also carry Link: <…/api/v1/openapi.json>; rel="service-desc", <…/api/v1/docs>; rel="service-doc" (RFC 8631).