# Faraatarjomeh API

> HTTP API for Faraatarjomeh (فراترجمه): English→Persian document translation and related tools (video, meeting minutes, podcasts and audiobooks, Persian text-to-speech, transcription). Every feature of the website is available with an API key. Work is paid in Fara from the key owner's account.

## At a glance

- Every capability in one list: [Everything the API can do](https://faraatarjomeh.com/api/v1/docs/capabilities.md)
- Base URL: `https://faraatarjomeh.com`
- All endpoints: under `/api/v1`
- Auth: `Authorization: Bearer fara_sk_...` (secret key, server-to-server only) — [Authentication](https://faraatarjomeh.com/api/v1/docs/authentication.md)
- Formats: JSON requests and responses; `multipart/form-data` for file uploads (or raw `application/octet-stream` chunks for [chunked uploads](https://faraatarjomeh.com/api/v1/docs/guides/chunked-uploads.md)); errors are `application/problem+json` (RFC 9457)
- Money: prices and charges are in Fara; check the balance with `GET /api/v1/account` — [Billing](https://faraatarjomeh.com/api/v1/docs/billing.md)
- Long work is asynchronous: create a job, then poll it or receive a webhook — [Conventions](https://faraatarjomeh.com/api/v1/docs/conventions.md), [Webhooks](https://faraatarjomeh.com/api/v1/docs/webhooks.md)
- Safe retries: send `Idempotency-Key` on every POST that spends Fara
- Machine-readable contract: [OpenAPI 3.1](https://faraatarjomeh.com/api/v1/openapi.json) · [error catalog (JSON)](https://faraatarjomeh.com/api/v1/docs/errors.json) · [llms.txt](https://faraatarjomeh.com/api/v1/docs/llms.txt) · [all docs in one file](https://faraatarjomeh.com/api/v1/docs/llms-full.txt)
- Every page of these docs is also plain Markdown: add `.md` to its URL, or send `Accept: text/markdown`.

## The universal flow

Every paid feature follows the same four steps:

1. **Price.** Ask for the price before spending (an analysis, an estimate, or a pricing endpoint). Compare it with the balance from `GET /api/v1/account`.
2. **Create.** Send the POST that starts the work, with an `Idempotency-Key`. Fara is held for the job. `402` with code `INSUFFICIENT_CREDITS` means the balance is too low.
3. **Wait.** Poll the job, or receive a webhook when its status changes. Some jobs stop at a review status and wait for you to approve.
4. **Collect.** Download the result. The hold becomes the real charge; unused Fara comes back. Failed or cancelled jobs cost nothing.

## Which page for which task

| Task | Guide | First call |
|---|---|---|
| Try the API end to end in 5 minutes | [Quickstart](https://faraatarjomeh.com/api/v1/docs/quickstart.md) | `GET /api/v1/account` |
| Translate a PDF (English → Persian) | [PDF translation](https://faraatarjomeh.com/api/v1/docs/guides/pdf-translation.md) | `POST /api/v1/translate/analyze` |
| Summary, slides, mind map, LinkedIn posts, proofreading of a translated PDF | [Translation tools](https://faraatarjomeh.com/api/v1/docs/guides/translation-tools.md) | `GET /api/v1/translate/{jobId}/summary` |
| Translate or dub a YouTube video or a video file | [Video](https://faraatarjomeh.com/api/v1/docs/guides/video.md) | `POST /api/v1/video/jobs/estimate` |
| Minutes from a meeting recording | [Meeting minutes](https://faraatarjomeh.com/api/v1/docs/guides/meeting-minutes.md) | `GET /api/v1/meetings/pricing` |
| Timed minutes, chapters, speaker names, context, revising by instruction, more documents, branding, categories, highlights, questions, analytics, delete (early access) | [Meetings: early-access features](https://faraatarjomeh.com/api/v1/docs/guides/meeting-extras.md) | `GET /api/v1/meetings/templates` |
| Podcast or audiobook from a translated PDF | [Podcast and audiobook](https://faraatarjomeh.com/api/v1/docs/guides/podcast-audiobook.md) | `GET /api/v1/audio/pricing` |
| Website or app text (i18n JSON, Markdown, HTML) in natural Persian, same structure | [Website and app copy](https://faraatarjomeh.com/api/v1/docs/guides/content-translation.md) | `POST /api/v1/content/translate` with `dryRun: true` |
| Persian text written again in natural, native Persian (not a translation) | [Persian editing](https://faraatarjomeh.com/api/v1/docs/guides/persian-editing.md) | `POST /api/v1/content/edit` with `dryRun: true` |
| Persian speech from text | [Persian text-to-speech](https://faraatarjomeh.com/api/v1/docs/guides/farsi-tts.md) | `GET /api/v1/farsi-tts/pricing` |
| Text or subtitles from a recording | [Transcription](https://faraatarjomeh.com/api/v1/docs/guides/transcription.md) | `GET /api/v1/transcription/pricing` |
| Send a large recording (up to 1 GB) in chunks, for a meeting, transcription or video job | [Chunked uploads](https://faraatarjomeh.com/api/v1/docs/guides/chunked-uploads.md) | `POST /api/v1/uploads` |
| Get told when jobs finish | [Webhooks](https://faraatarjomeh.com/api/v1/docs/webhooks.md) | `POST /api/v1/webhook-endpoints` |
| You are an AI agent acting for a user | [Rules for AI agents](https://faraatarjomeh.com/api/v1/docs/agents.md) | `GET /api/v1/account` |
| Look up one endpoint | [API reference](https://faraatarjomeh.com/api/v1/docs/reference.md) | — |
| Decide what to do with an error | [Errors](https://faraatarjomeh.com/api/v1/docs/errors.md) | — |

## What you cannot do with an API key

These stay on the website, for the account owner: sign in, change password or profile, buy Fara, and create or revoke API keys. A key that calls them gets `403` with code `API_KEY_ROUTE_NOT_ALLOWED`. A key never has admin rights.

## Support

Every response has an `X-Correlation-Id` header; error bodies repeat it as `request_id`. You may send your own id in an `X-Request-Id` request header and it is used instead. Include it when you contact support through https://faraatarjomeh.com/contact.
