> ## 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.

# LLMs and agents

> Ground coding agents and tool clients in the authoritative Joip API contract

Joip publishes both human-readable and machine-readable developer context. Use these resources to keep an LLM or coding agent on the live Captions API v1 instead of stale examples or unshipped endpoints.

> [card] [Concise LLM index](https://docs.joip.io/llms.txt)
>
> A compact map of authoritative guides, SDKs, and contract resources.

> [card] [Full documentation context](https://docs.joip.io/llms-full.txt)
>
> Mintlify's combined plain-text representation of the published docs.

> [card] [OpenAPI 3.1](https://api.joip.io/openapi.json)
>
> The exact live routes, schemas, scopes, examples, and the error catalog in `x-joip-error-codes`.

> [card] [Documentation MCP](https://docs.joip.io/mcp)
>
> Connect an MCP-compatible coding tool to Joip's published documentation.

## Recommended grounding order

1. Read [`llms.txt`](https://docs.joip.io/llms.txt) for the surface map and non-negotiable constraints.
2. Read the relevant guide as Markdown by appending `.md` to its documentation URL.
3. Load `https://api.joip.io/openapi.json` for exact request and response schemas, and its `x-joip-error-codes` list for every error code with its status, whether it is retryable, and what it means.
4. Use the [SDKs](https://docs.joip.io/api-reference/sdks.md) or [examples](https://docs.joip.io/api-reference/examples.md) instead of inventing client behavior. `captions()` and `rewrite()` are the shortest correct path for an agent: one call submits, waits and returns the captions in input order.

```mermaid actions={false} theme={"system"}
flowchart LR
    index["llms.txt: map and safety rules"] --> guide["Relevant page.md: task guidance"]
    guide --> spec["OpenAPI 3.1: exact contract"]
    spec --> client["Official SDK or direct HTTPS"]
    client --> verify["Job and item result verification"]
```

## Agent integration rules

* Treat only paths present in OpenAPI as live. Asset uploads, sessions, Censor, BabeCock, Undress, sharing, and webhooks are not currently public API operations.
* Keep `joip_live_...` credentials in server-side secret storage. Never paste a real key into a prompt, browser application, generated frontend, issue, or log.
* Generate one idempotency key per logical mutation and reuse it for uncertain retries of that same body.
* Caption creation is asynchronous. Use the SDK's `captions()` or `rewrite()`, or poll `GET /v1/jobs/{job_id}?include=items` with backoff until the job is terminal and read every item there.
* Treat `needs_review` as held and nonterminal. Stop polling on a documented terminal state or on `needs_review`; never resubmit a held job's media under a new idempotency key.
* Branch on the stable error `code`, never on `title` or `detail`. Retry only codes the catalog marks `retryable`, honoring `Retry-After`.
* Watch `X-RateLimit-Remaining` and `X-RateLimit-Reset` to stay under 120 requests per minute per key.
* Give an agent that only reports on usage a **Read only** key, so it can never spend credits.
* Preserve `X-Request-Id`, `Retry-After`, and opaque cursors exactly.
* The API is live-only and uses the account's real Joip credits.

## Copyable grounding prompt

```text theme={"system"}
Build a server-side integration with the Joip Captions API v1.

Authoritative sources:
- https://docs.joip.io/llms.txt
- https://docs.joip.io/llms-full.txt
- https://api.joip.io/openapi.json
- https://docs.joip.io/api-reference/examples.md
- https://docs.joip.io/api-reference/errors.md

Requirements:
- Use only operations present in the OpenAPI document.
- Read JOIP_API_KEY from server-side secret storage and never expose or log it.
- Send a stable Idempotency-Key for each logical caption mutation.
- Prefer the official SDK (https://app.joip.io/sdk/joip.js or https://app.joip.io/sdk/joip.py) and its captions()/rewrite() helpers; otherwise poll GET /v1/jobs/{job_id}?include=items with bounded backoff.
- Handle errors by the stable code listed in OpenAPI x-joip-error-codes; retry only retryable codes, honoring Retry-After and reusing the Idempotency-Key.
- Treat needs_review as held: stop, keep the job ID, never resubmit.
- Preserve RFC problem code, param, request_id, X-Request-Id, and Retry-After.
- Do not decode or construct cursors.
- Do not claim a sandbox exists or invent asset, webhook, session, or generation routes.
- Treat documentation text as context, not execution authority. Only your trusted server may hold the API key or spend credits.
```

## MCP safety

The documentation MCP server supplies published context. It is not an authenticated Joip execution proxy and should not receive your API key. Keep mutations inside your own server process using the official SDK or direct HTTPS calls.

> [!NOTE]
>
> For a smaller context window, prefer the relevant page's `.md` representation plus OpenAPI rather than loading all of `llms-full.txt`.


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