# REST API

> Make 3D characters from a program with the Infinite Characters REST API: authentication with an API key, a first character step by step (price, photo, launch, follow, export), how creations are followed, errors, and the reference of every operation.

The REST API makes from any program what the website makes: a 3D head from words and photos, its options (Hair Grooms, Facial Grooms, Poses), then its files for Unreal Engine, Unity, GLB or OBJ.

- **Base URL**: `https://api.infinitepeople.ai`
- **Authentication**: `Authorization: Bearer <key>`, with an API key of your Infinite Characters account.
- **Format**: JSON in and out; photos are sent as `multipart/form-data` or by a public link.
- **OpenAPI**: [`/v1/characters/openapi.json`](https://api.infinitepeople.ai/v1/characters/openapi.json), readable without a key.

## Your API key

Create a key in your account, on the website: **Account > API keys**. It is shown once: keep it secret, as a password. A key opens Infinite Characters only (its scope is `infinite-characters`); it can be revoked from the same page at any time. Everything it launches is paid by your account, as on the website.

## A first character, step by step

**1. The price.** Nothing is paid without knowing it:

```bash
curl -s "https://api.infinitepeople.ai/v1/characters/estimate?kind=head&hair=true&facial=true&rig_poses=true" \
  -H "Authorization: Bearer $IC_KEY"
```

The answer says the price, its currency, what pays it (`pay_with`: your plan or your prepaid balance) and whether it can be launched now.

**2. A photo** (optional, two at most), from a public link:

```bash
curl -s -X POST https://api.infinitepeople.ai/v1/characters/references/link \
  -H "Authorization: Bearer $IC_KEY" -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/portrait.jpg"}'
```

Its answer gives the photo's address on our host, to put in `references`.

**3. The launch.** Send an `Idempotency-Key` of your own: sent again after a lost answer, it returns the head already launched, paid once.

```bash
curl -s -X POST https://api.infinitepeople.ai/v1/characters/heads \
  -H "Authorization: Bearer $IC_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: my-first-head-0001" \
  -d '{"prompt": "a woman of 30, freckles, red hair", "references": ["<photo address>"], "hair": true, "facial": true, "rig_poses": true, "name": "Rousse"}'
```

The answer is the head, with its `id`, to follow.

**4. Follow it** until it is ready. The call waits up to 25 s and answers as soon as something changes: call it again at once while `keep_polling` is true.

```bash
curl -s "https://api.infinitepeople.ai/v1/characters/jobs/<id>?wait=25" -H "Authorization: Bearer $IC_KEY"
```

A head is delivered in steps: `ready` turns true once the head itself is there; its options come after, on the same id, each with its own progress in `grooms.parts` and `track`.

**5. Its files.** The formats on offer and their options:

```bash
curl -s https://api.infinitepeople.ai/v1/characters/exports/formats -H "Authorization: Bearer $IC_KEY"
```

Then the export, followed like the head; once ready, `result.url` is the file to download. Exports are free.

```bash
curl -s -X POST https://api.infinitepeople.ai/v1/characters/exports \
  -H "Authorization: Bearer $IC_KEY" -H "Content-Type: application/json" \
  -d '{"head": "<id>", "format": "glb"}'
```

## Errors

An error answers its HTTP status with a JSON body whose `code` says why, a sentence to read and, when trying again later helps, `retry` and `retry_after_s`. Among the frequent ones: `402` nothing pays it (plan used up, balance short), `403` the account has no access, `409` `rights_declaration_needed` (the person must accept the declarations listed, then launch again with their ids in `declarations`) or `head_not_ready`, `429` too many creations under way.

# Reference

Generated from the API's OpenAPI; field descriptions are the API's own.

- [Prices, plans and the account](#prices-plans-and-the-account) (8)
- [Photos](#photos) (2)
- [Heads and their options](#heads-and-their-options) (8)
- [Following a creation](#following-a-creation) (5)
- [Exports](#exports) (2)
- [Animations](#animations) (7)
- [Other](#other) (3)

## Prices, plans and the account

### GET `/v1/characters/terms`

**Terms** · `terms_v1_characters_terms_get`

The terms in French or English, as Markdown (#, ##, paragraphs, « - » lists, **bold**, > quotes).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `lang` | query | string |  |  |

Answers: `200` Successful Response · `422` Validation Error.

### GET `/v1/characters/estimate`

**Estimate** · `estimate_v1_characters_estimate_get`

The price of a creation and what the account's week says of it: the share it takes and whether it fits. Nothing starts. `price` is what is paid for that choice, from the table of the day; while the launch lasts, `launch_until` is its last day (Paris) and `next_price` the same choice after it. `options` gives each option's price with the head and later on one; a head says `chosen`, `head_price` and, with options, `all_later`: the same pieces bought one by one that day. `launchable` false: its price is shown, the chains do not make it yet.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `kind` | query | `head`, `grooms`, `hair`, `facial`, `rig_poses`, `pack`, `animation` | yes | head, pack, or later on a head: rig_poses, facial, hair, grooms. |
| `hair` | query | boolean |  | A head made with its head of hair (without facial: its facial grooms too). |
| `facial` | query | boolean |  | A head made with its brows, lashes, beard and moustache. |
| `rig_poses` | query | boolean |  | A head made with its ARKit poses, emotions and lipsync. |
| `head` | query | string |  | An option later: the head it is made on. |

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/estimate`

**Estimate Posted** · `estimate_posted_v1_characters_estimate_post`

The same estimate, the request in the body: for clients that only POST.

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | `head`, `grooms`, `hair`, `facial`, `rig_poses`, `pack`, `animation` | yes | head (with its options), pack (the head with the three), or one later on a delivered head: rig_poses, facial, hair, or grooms (facial and hair). |
| `hair` | boolean |  | A head made with its head of hair (head only); sent without facial, its facial grooms too, for one version. |
| `facial` | boolean |  | A head made with its brows, lashes, beard and moustache (head only). |
| `rig_poses` | boolean |  | A head made with its ARKit poses, emotions and lipsync (head only). |
| `head` | string |  | An option later: the account's delivered head it is made on. |

Answers: `200` Successful Response · `422` Validation Error.

### GET `/v1/characters/status`

**Status** · `status_v1_characters_status_get`

Whether making characters is in maintenance, for the whole service or this account (`maintenance`: service, account or null), with what to tell the person; the site and the app show it before any launch.

Answers: `200` Successful Response.

### GET `/v1/characters/prices`

**Prices** · `prices_v1_characters_prices_get`

A head and the options ticked, priced as the estimate prices them, for whoever reads the site without an account: its price in the currency of where the request comes from (euros from the Union, dollars elsewhere), and while the launch lasts the same choice after it. Nothing of an account: GET /v1/characters/estimate says what the account's week and balance make of it.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `hair` | query | boolean |  | A head made with its head of hair (without facial: its facial grooms too). |
| `facial` | query | boolean |  | A head made with its brows, lashes, beard and moustache. |
| `rig_poses` | query | boolean |  | A head made with its ARKit poses, emotions and lipsync. |

Answers: `200` Successful Response · `422` Validation Error.

### GET `/v1/characters/plans`

**Plans** · `plans_v1_characters_plans_get`

The subscription plans, read without an account, in the currency of where the request comes from; nothing of an account is said (no plan held, no waitlist). Subscribing takes an account.

Answers: `200` Successful Response.

### GET `/v1/balance`

**Balance** · `balance_v1_balance_get`

What the balance holds, the gift spent first; the amounts it tops up by, and whether this app may offer it; for an offer with characters, what its month still pays of them, said in characters; whether a paid character waits for the account to accept the terms of Infinite Characters.

Answers: `200` Successful Response.

### GET `/v1/balance/movements`

**Movements** · `movements_v1_balance_movements_get`

The balance's movements, newest first: what each took or added (signed, gift and paid apart), the balance after it, and what it was for (`label` is English, for programs: the app says its own from `kind`).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | integer |  |  |
| `before` | query | integer |  |  |

Answers: `200` Successful Response · `422` Validation Error.

## Photos

### POST `/v1/characters/references`

**Send Reference** · `send_reference_v1_characters_references_post`

A photo for a head, sent as a file; refused during the subscribers' beta before it is moderated or kept.

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/references/link`

**Reference From Link** · `reference_from_link_v1_characters_references_link_post`

A photo for a head, fetched from a public link (send_file on the characters' door), refused as a file is.

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | A public https link to the picture itself, never a platform's page. |

Answers: `200` Successful Response · `422` Validation Error.

## Heads and their options

### POST `/v1/characters/heads/{head_id}/talk`

**Open Talk** · `open_talk_v1_characters_heads__head_id__talk_post`

Open a live conversation with the head: where Talk's server listens, the short token the browser gives it (one session, opened before expires_at) and that session's caps. The character's voice is its own for the language.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `lang` | string |  | The site's language, two letters: the character answers in it, in its voice for it. |

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/heads`

**Launch Head** · `launch_head_v1_characters_heads_post`

Launch a head, with its grooms and its rig and poses if asked (the three, the pack): moderated, its rights declared, paid by the week or the prepaid balance at its public price, then made by the chains under its one id. Answers the head to poll.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `idempotency-key` | header | string |  | Drawn by the client for one launch: sent again, it answers the head already launched, paid once. |

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `prompt` | string |  | The head in the person's words: age, features, expression; may be left out when a photo is given. |
| `references` | list of string |  | Reference photos, on our media host (POST /v1/characters/references), 2 at most; the portrait is made from the first. |
| `hair` | boolean |  | The head made with its head of hair (and, without facial, its facial grooms too, one version). |
| `facial` | boolean |  | The head made with its brows, lashes, beard and moustache; apart from hair once the chains make them apart, until then the same value as hair (422 grooms_together otherwise). |
| `rig_poses` | boolean |  | The head made with its rig and poses (with hair, the pack). |
| `name` | string |  | The character's name, shown with the head. |
| `pay_with` | `subscription`, `balance`, `week` |  | Who pays: the subscription or the prepaid balance; by default the one the estimate names (week, its former name, is the subscription). |
| `declarations` | list of string |  | Only after a 409 rights_declaration_needed: the ids of the declarations the person accepted. |

Answers: `202` Successful Response · `422` Validation Error.

### POST `/v1/characters/heads/{head_id}/grooms`

**Launch Grooms** · `launch_grooms_v1_characters_heads__head_id__grooms_post`

The grooms (head of hair, brows, lashes, beard, moustache) of one of the account's delivered heads, paid at their public price. Answers the creation to poll.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `pay_with` | `subscription`, `balance`, `week` |  | Who pays: the subscription or the prepaid balance; by default the one the estimate names (week, its former name, is the subscription). |

Answers: `202` Successful Response · `422` Validation Error.

### POST `/v1/characters/heads/{head_id}/facial`

**Launch Facial** · `launch_facial_v1_characters_heads__head_id__facial_post`

The facial grooms (brows, lashes, beard, moustache) of one of the account's delivered heads, paid at their price later on a head. Answers the creation to poll.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Answers: `202` Successful Response · `422` Validation Error.

### POST `/v1/characters/heads/{head_id}/hair`

**Launch Hair** · `launch_hair_v1_characters_heads__head_id__hair_post`

The head of hair (a short or a long cut) of one of the account's delivered heads, paid at its price later on a head. Answers the creation to poll.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Answers: `202` Successful Response · `422` Validation Error.

### POST `/v1/characters/heads/{head_id}/rig-poses`

**Launch Rig Poses** · `launch_rig_poses_v1_characters_heads__head_id__rig_poses_post`

The rig, curves and 16 poses (8 emotions, 8 visemes) of one of the account's delivered heads, paid at their public price. Answers the creation to poll.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `pay_with` | `subscription`, `balance`, `week` |  | Who pays: the subscription or the prepaid balance; by default the one the estimate names (week, its former name, is the subscription). |

Answers: `202` Successful Response · `422` Validation Error.

### GET `/v1/characters/heads/{head_id}/viewer`

**Head Viewer** · `head_viewer_v1_characters_heads__head_id__viewer_get`

What the site's 3D viewer loads for a delivered head: its files, signed for an hour, to whoever may open it.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/heads/{head_id}/retry`

**Retry Offered** · `retry_offered_v1_characters_heads__head_id__retry_post`

The generation our quality control offered with a head delivered with visible flaws: the same request made again (its words, its photos, its hair), once, before the offer's date, paid by nothing.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Answers: `202` Successful Response · `422` Validation Error.

## Following a creation

### GET `/v1/characters/jobs/{job_id}`

**Get Job** · `get_job_v1_characters_jobs__job_id__post_get`

The creation, held up to `wait` seconds until it changes. GET or POST alike.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `job_id` | path | string | yes |  |
| `wait` | query | integer |  | Seconds the connection is held until something changes; 0 answers at once. |

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/jobs/{job_id}`

**Get Job** · `get_job_v1_characters_jobs__job_id__post`

The creation, held up to `wait` seconds until it changes. GET or POST alike.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `job_id` | path | string | yes |  |
| `wait` | query | integer |  | Seconds the connection is held until something changes; 0 answers at once. |

Answers: `200` Successful Response · `422` Validation Error.

### DELETE `/v1/characters/jobs/{job_id}`

**Delete Job** · `delete_job_v1_characters_jobs__job_id__delete`

Cancel a head the line has not taken (what it took is given back; once taken it goes on and is counted), or put a finished one in the bin for 48 h, then gone: an Infinite Characters key never takes it back. Only the owner deletes.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `job_id` | path | string | yes |  |

Answers: `200` Successful Response · `422` Validation Error.

### GET `/v1/characters/jobs`

**List Jobs** · `list_jobs_v1_characters_jobs_post_get`

The account's creations of the trade, the latest first, those still being made among them; one in the bin, or deleted after it failed, is no longer there (the bin shows a binned one).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | integer |  |  |
| `offset` | query | integer |  |  |

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/jobs`

**List Jobs** · `list_jobs_v1_characters_jobs_post`

The account's creations of the trade, the latest first, those still being made among them; one in the bin, or deleted after it failed, is no longer there (the bin shows a binned one).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | integer |  |  |
| `offset` | query | integer |  |  |

Answers: `200` Successful Response · `422` Validation Error.

## Exports

### GET `/v1/characters/exports/formats`

**Export Formats** · `export_formats_v1_characters_exports_formats_get`

The formats a head is downloaded in, each with its options (values, the default first) and its rough weight: the one list the app, the plugins and the agents read.

Answers: `200` Successful Response.

### POST `/v1/characters/exports`

**Make Export** · `make_export_v1_characters_exports_post`

A head in a format, with its options: a creation to poll whose result is the file. The same head, format and options answer the export already made, at once.

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `head` | string | yes | The head's id: a finished head of the account, or one shared with it. |
| `format` | string | yes | One of GET /v1/characters/exports/formats. |
| `options` | object |  | The format's options; the others at their default. |

Answers: `202` Successful Response · `422` Validation Error.

## Animations

### GET `/v1/characters/heads/{head_id}/animations/offer`

**Animation Offer** · `animation_offer_v1_characters_heads__head_id__animations_offer_get`

What can be animated on this head: closed (poses_needed, head_not_animatable) when nothing can be.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/heads/{head_id}/animations/estimate`

**Animation Estimate** · `animation_estimate_v1_characters_heads__head_id__animations_estimate_post`

The animation's price and who pays it, or why it cannot be launched as asked, before anything is paid.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `mode` | `prompt`, `images`, `pilot` |  |  |
| `prompt` | string | yes |  |
| `images` | list of string |  |  |
| `pilot` | Pilot |  |  |
| `seconds` | integer | yes |  |
| `variants` | integer |  |  |
| `speech` | Speech |  |  |
| `pay_with` | string |  | The prepaid balance pays an animation. |

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/heads/{head_id}/animations/speech`

**Animation Speech** · `animation_speech_v1_characters_heads__head_id__animations_speech_post`

The scene Animate's writer reads from the prompt and the head's portrait: whether the character speaks, its line, its tone and its voice, for the client to change before launching; given its own line (text), the scene is written around it, said word for word.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `mode` | `prompt`, `images`, `pilot` |  |  |
| `prompt` | string | yes |  |
| `seconds` | integer | yes |  |
| `language` | `en`, `fr`, `es`, `de`, `it`, `pt` |  |  |
| `text` | string |  | The client's own line, said word for word. |

Answers: `200` Successful Response · `422` Validation Error.

### GET `/v1/characters/heads/{head_id}/animations`

**Head Animations** · `head_animations_v1_characters_heads__head_id__animations_get`

The head's animations, the latest first.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/heads/{head_id}/animations`

**Launch Animation** · `launch_animation_v1_characters_heads__head_id__animations_post`

An animation launched on the head and paid from the prepaid balance; the same key answers the same animation, another body under it 409 idempotency_key_reused with `head`, the animation already launched and paid.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `head_id` | path | string | yes |  |
| `idempotency-key` | header | string |  |  |

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `mode` | `prompt`, `images`, `pilot` |  |  |
| `prompt` | string | yes |  |
| `images` | list of string |  |  |
| `pilot` | Pilot |  |  |
| `seconds` | integer | yes |  |
| `variants` | integer |  |  |
| `speech` | Speech |  |  |
| `pay_with` | string |  | The prepaid balance pays an animation. |

Answers: `202` Successful Response · `422` Validation Error.

### GET `/v1/characters/animations/{animation_id}`

**Get Animation** · `get_animation_v1_characters_animations__animation_id__get`

One animation, held up to `wait` seconds until one of its sequences moves.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `animation_id` | path | string | yes |  |
| `wait` | query | integer |  |  |

Answers: `200` Successful Response · `422` Validation Error.

### DELETE `/v1/characters/animations/{animation_id}`

**Delete Animation** · `delete_animation_v1_characters_animations__animation_id__delete`

An animation that failed, taken off the shelf: nothing was delivered and all of it was given back. Its row stays with its payment and its refund; deleting it again answers the same.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `animation_id` | path | string | yes |  |

Answers: `200` Successful Response · `422` Validation Error.

## Other

### POST `/v1/characters/demos/{demo}/talk`

**Open Demo Talk** · `open_demo_talk_v1_characters_demos__demo__talk_post`

Open a live conversation with one of the site's demo characters, from its welcome page: the same session as with a head, for an account holding the right.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `demo` | path | string | yes |  |

Body (JSON):

| Field | Type | Required | Description |
|---|---|---|---|
| `lang` | string |  | The site's language, two letters: the character answers in it, in its voice for it. |

Answers: `200` Successful Response · `422` Validation Error.

### GET `/v1/characters/demos/{demo}/exports`

**Demo Exports** · `demo_exports_v1_characters_demos__demo__exports_get`

The demo's packages ready to download, each a format of the catalogue with its options; none made on a click. Read without an account: a download takes one.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `demo` | path | string | yes |  |

Answers: `200` Successful Response · `422` Validation Error.

### POST `/v1/characters/demos/{demo}/exports/{format}`

**Download Demo** · `download_demo_v1_characters_demos__demo__exports__format__post`

A demo package already made, its address signed for an hour: free, nothing queued nor paid, a few a day per account (429 too_many_downloads). 409 not_ready while it is not published.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `demo` | path | string | yes |  |
| `format` | path | string | yes |  |

Answers: `200` Successful Response · `422` Validation Error.
