# API reference: Account

> The Account endpoints (7 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`: `read` for GET/HEAD, `write` for 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+json` with a stable `code` (not repeated per endpoint below)

## Index

- **Account**: [POST /api/v1/estimate](#estimatePrice), [GET /api/v1/account](#getAccount), [GET /api/v1/account/transactions](#listAccountTransactions), [GET /api/v1/account/settings](#getAccountSettings), [PATCH /api/v1/account/settings](#updateAccountSettings), [GET /api/v1/openapi.json](#getOpenApiDocument), [GET /api/v1/docs](#getApiReferencePage)

## Account

Your account, Fara balance, and ledger.

<a id="estimatePrice"></a>
### POST /api/v1/estimate

Get the price of any product

- operationId `estimatePrice` · scope `write` · free · send `Idempotency-Key`

One call to price a translation, meeting, audio-to-text, video, Persian voice, podcast, audiobook or paid meeting tool before anything is uploaded. Free; nothing is held. `faraCharged` is the expected charge, `hold` what creating the job holds. The charge is the actual cost, so it can be a little above or below the hold. The per-product price calls stay for their extra details.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Request body** `application/json` (required)

[`EstimateRequest`](#schema-estimate-request)

**Response `200`**

[`EstimateResponse`](#schema-estimate-response)

**Responses**

- `200` The price. (`application/json`)
- Errors: `400`, `401`, `403`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X POST "https://faraatarjomeh.com/api/v1/estimate" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"feature":"translation"}'
```

<a id="getAccount"></a>
### GET /api/v1/account

Get the account and its Fara balance

- operationId `getAccount` · scope `read` · free

`credits.balance` is what you can spend now. Fara held for running jobs is in `credits.reserved` and already taken out of the balance.

**Response `200`**

[`Account`](#schema-account)

**Responses**

- `200` The account. (`application/json`)
- Errors: `401`, `403`, `404`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/account" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="listAccountTransactions"></a>
### GET /api/v1/account/transactions

List Fara transactions

- operationId `listAccountTransactions` · scope `read` · free

The Fara ledger, newest first, with cursor pagination. Filter by `jobId` to see the hold, charge, and refund of one job; the filter also returns its tool charges, section resends, and reprocess charges (rows whose `relatedJobId` is that job).

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `limit` | query | integer | no | Items per page (1-100). — default: `20`; min 1; max 100 |
| `startingAfter` | query | string | no | Cursor: the `nextCursor` (or last `id`) of the previous page. |
| `jobId` | query | string | no | Only transactions of this job. |
| `externalId` | query | string | no | Early access: only transactions of jobs created with this `externalId`. |

**Response `200`**

[`TransactionPage`](#schema-transaction-page)

**Responses**

- `200` One page of transactions. (`application/json`)
- Errors: `400`, `401`, `403`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/account/transactions" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="getAccountSettings"></a>
### GET /api/v1/account/settings

Get account settings

- operationId `getAccountSettings` · scope `read` · free

**Early access** (accounts with `meetings_api_v2`; others get 403 `FEATURE_NOT_ENABLED`). Auto-delete period for meetings and transcriptions, and the low-balance webhook threshold.

**Response `200`**

[`AccountSettings`](#schema-account-settings)

**Responses**

- `200` Settings. (`application/json`)
- Errors: `401`, `403`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/account/settings" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="updateAccountSettings"></a>
### PATCH /api/v1/account/settings

Change account settings

- operationId `updateAccountSettings` · scope `write` · free · send `Idempotency-Key`

**Early access** (accounts with `meetings_api_v2`; others get 403 `FEATURE_NOT_ENABLED`). Send a field to set it, `null` to turn it off, or leave it out to keep it. Auto-delete runs hourly on finished meeting and audio-to-text jobs older than the period (same as DELETE; ledger rows stay).

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Request body** `application/json` (required)

[`AccountSettingsPatch`](#schema-account-settings-patch)

**Response `200`**

[`AccountSettings`](#schema-account-settings)

**Responses**

- `200` Settings. (`application/json`)
- Errors: `400`, `401`, `403`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X PATCH "https://faraatarjomeh.com/api/v1/account/settings" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

<a id="getOpenApiDocument"></a>
### GET /api/v1/openapi.json

Get this OpenAPI document

- operationId `getOpenApiDocument` · scope `read` · free

Public: works without a key. Also shown as a web page at /api/v1/docs.

**Response `200`**

**Responses**

- `200` The OpenAPI document. (`application/json`)
- Errors: `401`, `403`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/openapi.json" \
  -H "Authorization: Bearer $FARA_API_KEY"
```

<a id="getApiReferencePage"></a>
### GET /api/v1/docs

Get this reference as a web page

- operationId `getApiReferencePage` · scope `read` · free

Public: works without a key.

**Responses**

- `200` HTML page. (`text/html`)
- Errors: `401`, `403`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X GET "https://faraatarjomeh.com/api/v1/docs" \
  -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`.

<a id="schema-account"></a>
### Account

| Field | Type | Required | Notes |
|---|---|---|---|
| `id` | string | yes | Account id. |
| `email` | string \| null | no | may be null |
| `emailVerified` | boolean | no |  |
| `credits` | object | yes |  |
| `credits.currency` | string | no | Always `FARA`. |
| `credits.faraPerUsd` | number | no | How many Fara make one US dollar. |
| `credits.balance` | number | yes | Fara you can spend now. Fara held for running jobs is already taken out. |
| `credits.reserved` | number | yes | Fara held for running jobs. |
| `credits.chargebackLiability` | number | no | Reversed payments not yet settled. While above zero, new holds are refused. |
| `credits.lifetimeUsage` | number | no | Fara spent over the life of the account. |
| `credits.lastTransactionAt` | string \| null | no | may be null |
| `auth` | object | no |  |
| `auth.type` | string | no | `api_key` or `session`. |
| `auth.keyId` | string | no | Id of the API key used for this request. |
| `auth.scopes` | string[] | no |  |
| `earlyAccess` | string[] | no | Early-access features turned on for this account, e.g. `meetings_api_v2`. |

<a id="schema-account-settings"></a>
### AccountSettings

| Field | Type | Required | Notes |
|---|---|---|---|
| `meetingRetentionDays` | integer \| null | no | Finished meeting and audio-to-text jobs are deleted this many days after they last changed. `null`: kept until you delete them. — may be null |
| `lowBalanceThreshold` | number \| null | no | When the balance falls below this many Fara, an `account.balance_low` webhook event is sent (once, until the balance is back above it). `null`: off. — may be null |

<a id="schema-account-settings-patch"></a>
### AccountSettingsPatch

| Field | Type | Required | Notes |
|---|---|---|---|
| `meetingRetentionDays` | integer \| null | no | 1-3650, or `null` to turn off. — min 1; max 3650; may be null |
| `lowBalanceThreshold` | number \| null | no | Fara, or `null` to turn off. — may be null |

<a id="schema-estimate-request"></a>
### EstimateRequest

| Field | Type | Required | Notes |
|---|---|---|---|
| `feature` | string | yes | What to price. — one of: `translation`, `meeting`, `transcription`, `video`, `farsi_tts`, `podcast`, `audiobook`, `meeting_tool`, `content_translation` |
| `words` | integer | no | `translation`: words in the document (a rough price; the real quote comes from analysis). `content_translation`: words of website or app text (or send `characters`). |
| `delivery` | string | no | Deprecated. Every translation runs fast; leave this out. Kept for old clients. — one of: `fast`, `economy` |
| `durationSeconds` | number | no | `meeting`, `transcription`, `video`, `meeting_tool`: recording length. |
| `output` | string | no | `meeting`: `full` (default), `summary`, `key_points`, `transcript`. `video`: `subtitles`, `standard` (default), `premium`, `cloned` (the speaker's own voice). |
| `glossary` | boolean | no | `meeting`: a word list will be sent (transcription costs 20% more). |
| `translate` | boolean | no | `transcription`: also translate the transcript. |
| `songDubbing` | boolean | no | `video` with a voice: songs will be sung in Persian (`songDubbing: true` on create). Adds the song allowance to the hold. |
| `songMode` | string | no | `video` with a voice: `mixed` or `song_only` price the same as `songDubbing: true`. — one of: `off`, `mixed`, `song_only` |
| `characters` | integer | no | `farsi_tts`: length of the text. Or send `minutes`. `content_translation`: characters of text to translate. |
| `minutes` | number | no | `farsi_tts`, `podcast`, `audiobook`: length of the audio. Podcast and audiobook default to the longest. |
| `tool` | string | no | `meeting_tool`: `highlights`, `recap_email`, `ask`, `regenerate_minutes`, `revise_minutes`, `write_minutes`, `mindmap`, `document`, `analytics`. |

<a id="schema-estimate-response"></a>
### EstimateResponse

| Field | Type | Required | Notes |
|---|---|---|---|
| `feature` | string | yes |  |
| `tool` | string | no |  |
| `faraCharged` | number | yes | The expected charge in Fara. |
| `minutesBilled` | integer | no |  |
| `hold` | number | yes | Fara held when the job is created. |
| `note` | string | no |  |

<a id="schema-transaction-page"></a>
### TransactionPage

One page of the Fara ledger, newest first.

| Field | Type | Required | Notes |
|---|---|---|---|
| `data` | object[] | yes |  |
| `data[].id` | string | yes | Transaction id. Also the pagination cursor. |
| `data[].type` | string | yes | For example `credit_hold`, `credit_refund`, `translation_charge`, `video_charge`, `meeting_charge`, `audio_charge`, `farsi_tts_charge`, `transcription_charge`, `knowledge_charge`, `slides_charge`, `service_failure_refund`, `payment_chargeback`, or a top-up. |
| `data[].amount` | number | yes | Size of the transaction in Fara. A settlement (`*_charge`) row is 0: the hold already took the Fara, and any overestimate comes back as its own `credit_refund` row. Read `chargedAmount` for what the work cost. |
| `data[].balanceChange` | number \| null | no | Signed change to the spendable balance. — may be null |
| `data[].balanceAfter` | number \| null | no | Spendable balance after this transaction. — may be null |
| `data[].jobId` | string \| null | no | Ledger id of the job. Tools and resends use derived ids such as `slides-<jobId>-<time>`, `chunk-resend:<jobId>:<id>`, or `video-reprocess-<id>-<time>`. — may be null |
| `data[].relatedJobId` | string \| null | no | The parent job this row belongs to (the plain job id, also for derived ledger ids). — may be null |
| `data[].description` | string \| null | no | may be null |
| `data[].externalId` | string | no | Early access: the `externalId` of the job this row belongs to, when it has one. |
| `data[].settlementStatus` | string | no | Only on `credit_hold`: `reserved`, `pending_finalization`, `charged`, `released`, or `failed_reconciliation`. |
| `data[].chargedAmount` | number | no | On settlement rows: the Fara the work actually cost (can be above `heldAmount` when the difference was charged). |
| `data[].heldAmount` | number | no | On settlement rows: the Fara that was held for it. |
| `data[].createdAt` | string \| null | yes | may be null |
| `hasMore` | boolean | yes | True when there are more items after this page. |
| `nextCursor` | string \| null | yes | Pass as `startingAfter` to get the next page. Null on the last page. — may be null |
