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

# Argil API

> Build on Argil: your library, every generation model, and the events of your workspace.

The Argil API gives your code access to your Argil workspace: the same library, models and credits as the Argil app, so what you make through the API shows up in the app, and the other way round.

## Building blocks

> [card] [Library](https://docs.argil.ai/v2/library/assets.md)
>
> **Assets** (your files and every output) and **elements** (characters, styles, locations and props built in Argil). Everything else in the API takes them as input.

> [card] [Generate](https://docs.argil.ai/v2/generate/generations.md)
>
> Run any video, image or audio model of the Argil playground with one resource and one input vocabulary.

> [card] [Events](https://docs.argil.ai/v2/platform/webhooks.md)
>
> Signed webhooks when something finishes in your workspace.

> [card] [Account](https://docs.argil.ai/v2/account/credits.md)
>
> Credits and estimates, shared with the app.

```mermaid theme={null}
flowchart LR
  L["Library<br/>assets · elements"] --> G["Generations"]
  C["Model catalog"] --> G
  G --> L
  G --> W["Webhooks"]
```

## A first call

```bash theme={null}
curl https://api.argil.ai/v2/generations \
  -H "Authorization: Bearer $ARGIL_API_KEY" \
  -H "Prefer: wait=60" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2.1",
    "mode": "text-to-image",
    "input": { "prompt": "Studio photo of a ceramic mug with steam, soft light" }
  }'
```

The image comes back in the response, and is in your library, in its `API` folder.

## Basics

| | |
| - | - |
| Base URL | `https://api.argil.ai/v2` |
| Auth | `Authorization: Bearer <your API key>` ([Authentication](https://docs.argil.ai/v2/get-started/authentication.md)) |
| Format | JSON, `snake_case`, ISO 8601 UTC timestamps, prefixed ids (`gen_…`, `asset_…`) ([Conventions](https://docs.argil.ai/v2/platform/conventions.md)) |
| Errors | `application/problem+json` ([Errors](https://docs.argil.ai/v2/platform/errors.md)) |
| Versioning | `/v2` in the URL, additive changes only ([Versioning](https://docs.argil.ai/v2/platform/versioning.md)) |

> [card] [Quickstart](https://docs.argil.ai/v2/get-started/quickstart.md)
>
> An image, a video from it, and a character-consistent shot, in five minutes.

> [card] [API reference](https://docs.argil.ai/v2/api-reference/overview.md)
>
> Every endpoint, request and response.


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