> ## Documentation Index
> Fetch the complete documentation index at: https://docs.joip.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create a key and get your first caption back in two minutes

You need a Joip account with credits. The API spends the same credits as the app, so there is no sandbox: your first request costs a real caption.

**1. Create a key**

Open [API keys](https://joip.com/joip-api) in the dashboard, name the integration and select **Create key**. Copy the `joip_live_...` value now. Joip shows it once and keeps only a verifier.

If the dashboard asks you to **Sign in again**, do it and come back. No key is created until that check passes.

**2. Put it in your environment**

```bash theme={"system"}
export JOIP_API_KEY="joip_live_REPLACE_ME"
```

Keep it on your server. A request from a browser is refused.

**3. Caption an image**

This uses Joip's public sample image, so it runs as written. The SDK helpers submit the job, wait for it, and hand back the captions.

![Illustrated blue-haired subject used as the Joip API quickstart image](https://joip.com/assets/landing/art-captions.webp)

Joip's public quickstart image

```bash cURL theme={"system"}
curl https://api.joip.io/v1/captions/generate \
  --header "Authorization: Bearer $JOIP_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: $(uuidgen)" \
  --data '{"media_urls": ["https://joip.com/assets/landing/art-captions.webp"], "style": "joi"}'

# Then read the job with its captions (use the id from the response):
curl "https://api.joip.io/v1/jobs/JOB_ID?include=items" \
  --header "Authorization: Bearer $JOIP_API_KEY"
```

```js JavaScript SDK theme={"system"}
// curl -fsSO https://app.joip.io/sdk/joip.js
import { JoipClient } from "./joip.js";

const joip = new JoipClient({ apiKey: process.env.JOIP_API_KEY });
const { job, captions } = await joip.captions({
  media_urls: ["https://joip.com/assets/landing/art-captions.webp"],
  style: "joi",
});

console.log(captions[0].text);
console.log(`${job.billing.settled_credits} credits`);
```

```python Python SDK theme={"system"}
# curl -fsSO https://app.joip.io/sdk/joip.py
import os
from joip import JoipClient

joip = JoipClient(os.environ["JOIP_API_KEY"])
result = joip.captions({
    "media_urls": ["https://joip.com/assets/landing/art-captions.webp"],
    "style": "joi",
})

print(result["captions"][0]["text"])
print(f"{result['job']['billing']['settled_credits']} credits")
```

## What came back

`captions()` returns the finished job, with its items, and one entry per image in the order you sent them (timestamps and IDs trimmed here):

```json theme={"system"}
{
  "job": {
    "id": "0d362d39-bf9a-4237-b9d3-59d77d487045",
    "type": "caption_generation",
    "state": "completed",
    "item_count": 1,
    "completed_item_count": 1,
    "failed_item_count": 0,
    "billing": { "reserved_credits": 4, "settled_credits": 4, "released_credits": 0, "currency": "credits" },
    "items": [{ "index": 0, "state": "completed", "result": { "type": "caption", "caption_text": "Your generated caption appears here." } }]
  },
  "captions": [
    { "index": 0, "text": "Your generated caption appears here.", "error": null }
  ]
}
```

* **What it cost** is `job.billing.settled_credits`. Joip reserves the price when it accepts the job, charges only for completed captions, and releases the rest. Check your balance with `GET /v1/credits`.
* **A failed image** has `text: null` and an `error` with a `code` from the [item error list](https://docs.joip.io/api-reference/errors.md#job-and-item-errors). Failed images cost nothing.
* **A held job** (`needs_review`) makes the helper throw `JoipJobHeldError`. Keep the job ID and don't resubmit. See [Jobs](https://docs.joip.io/api-reference/jobs.md#held-for-review).

The signed-in [Generations library](https://joip.com/joip-api?tab=generations) shows the same job, its captions and its cost without any code.

## The same thing over raw HTTP

Without an SDK, a caption is three calls: submit, poll, read.

**1. Submit**

```bash theme={"system"}
curl https://api.joip.io/v1/captions/generate \
  --header "Authorization: Bearer $JOIP_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: my-record-42-caption" \
  --data '{"media_urls": ["https://joip.com/assets/landing/art-captions.webp"], "style": "joi"}'
```

Joip answers `202 Accepted` with a job whose `state` is `queued`. Save its `id`. If the connection drops, send the same body with the same `Idempotency-Key`: you get the same job back, with `Idempotent-Replayed: true`, never a second one.

**2. Poll**

```bash theme={"system"}
curl "https://api.joip.io/v1/jobs/JOB_ID?include=items" \
  --header "Authorization: Bearer $JOIP_API_KEY"
```

Repeat every second or two, backing off to five, until `state` is `completed`, `partially_completed`, `failed` or `redacted`. Stop at `needs_review` too: it is held, not finished.

**3. Read**

With `include=items` the job carries every item. A completed caption item looks like this:

```json theme={"system"}
{
  "id": "c3c7f60a-95fc-4c82-9801-953ad3634838",
  "job_id": "0d362d39-bf9a-4237-b9d3-59d77d487045",
  "job_type": "caption_generation",
  "index": 0,
  "state": "completed",
  "input_asset_ids": ["d2e196a3-a26e-44eb-846f-9f04f2fd70d4"],
  "output_asset_ids": [],
  "result": {
    "type": "caption",
    "source_asset_id": "d2e196a3-a26e-44eb-846f-9f04f2fd70d4",
    "caption_text": "Your generated caption appears here."
  },
  "created_at": "2026-11-29T12:00:00.000Z",
  "updated_at": "2026-11-29T12:00:04.000Z",
  "completed_at": "2026-11-29T12:00:04.000Z"
}
```

`GET /v1/jobs/{job_id}/items` returns the same items as a paginated list.

## Next

> [card] [SDKs](https://docs.joip.io/api-reference/sdks.md)
>
> Retries, paginators, helpers and TypeScript types.

> [card] [Examples](https://docs.joip.io/api-reference/examples.md)
>
> Rewrites, custom styles, batches and history.

> [card] [Errors](https://docs.joip.io/api-reference/errors.md)
>
> Every code and exactly what to do.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.