# Agent prompt

> A prompt to paste into a coding agent before it integrates Mynth, and the rules it should follow.

Paste this into your coding agent before it writes an integration. It tells
the agent to read these docs first, ask before it touches credentials, pass an
explicit model, and not invent endpoints.

> **Prompt to give a coding agent**
>
> Integrate Mynth into this project. Before you write code, run `npx @mynthio/cli docs list` and
> `npx @mynthio/cli docs get getting-started`, and read the page for each call you are about to
> make. Docs need no account. Follow the docs exactly: no `/v1` prefix, no invented endpoints or
> fields, no model aliases. Pass an explicit model id such as `black-forest-labs/flux.2-pro`, never
> `auto`. Keep the API key on the server. Check the status of every image in a completed task.
> Before you create or store a credential, ask me which I want: I set `MYNTH_API_KEY` myself, or
> you run `npx @mynthio/cli auth login` and `npx @mynthio/cli api-key create <name>` after I
> approve the login.

## Rules for agents

These are the mistakes agents make most often with Mynth. Each links to the
page that explains it.

| Rule                                                                        | Why                                                                               |
| --------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| The base URL is `https://api.mynth.io`, with no version prefix              | [API reference](https://mynth.io/docs/api-reference.md)                                              |
| Pass an explicit model id from the catalog                                  | [`auto` is experimental](https://mynth.io/docs/models.md#auto-is-experimental)                       |
| Generation returns a task, not a file                                       | [Tasks](https://mynth.io/docs/concepts/tasks.md)                                                     |
| Check `status` on every item of a completed task                            | [Partial failure](https://mynth.io/docs/concepts/tasks.md#completed-does-not-mean-every-item-worked) |
| Never send the `mak_` key to a browser. Browsers poll with the `pat_`       | [Authentication](https://mynth.io/docs/authentication.md#browser-polling)                            |
| Copy files you need for more than 7 days, or use a destination              | [File lifetimes](https://mynth.io/docs/concepts/tasks.md#file-lifetimes)                             |
| Verify webhooks against the raw body, and deduplicate on `X-Mynth-Delivery` | [Webhooks](https://mynth.io/docs/concepts/webhooks.md)                                               |
| Do not blindly retry a create. There are no idempotency keys                | [What is safe to retry](https://mynth.io/docs/api-reference/errors.md#what-is-safe-to-retry)         |
| Read prices from the catalog or an estimate, never from these docs          | [Pricing](https://mynth.io/docs/pricing.md)                                                          |
| In TypeScript, use `@mynthio/sdk` and its webhook helpers                   | [TypeScript SDK](https://mynth.io/docs/sdks/typescript.md)                                           |

## Next steps

- [llms.txt](https://mynth.io/docs/sdks/agents/llms-txt.md): every way to read these docs as markdown.
- [Skills](https://mynth.io/docs/sdks/agents/skills.md): the Mynth skill for coding agents.
- [Getting started](https://mynth.io/docs/getting-started.md): a key and a first image.
