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

> ## Agent Instructions
> Leap's API is at https://api.tryleap.ai. Send the key in the x-api-key header or as Authorization: Bearer; keys start with leap_.
> Take model IDs and input schemas from GET /v1/models/{creator}/{name}, or from https://api.tryleap.ai/v1/public/models without a key. Never guess an input field: unknown fields are a 400.
> Model inputs take uploaded file IDs (file_...), never URLs.
> To give a coding agent the whole API, install the Leap skill: curl -fsSL https://www.tryleap.ai/install.sh | sh
> The full OpenAPI 3.1 spec is at https://www.tryleap.ai/docs/openapi.json.

# Use Leap from your agent

> Install the Leap skill so your coding agent builds with the API correctly, connect an agent to Leap's MCP server to generate media directly, or point any LLM at these docs.

The Leap skill teaches a coding agent, such as Claude Code or Codex, to write code against the API. The MCP server lets an agent make images, video and audio itself, with no code. And every page of these docs is also plain Markdown, with an index for LLMs.

## Install the Leap skill

One command installs the skill for every coding agent it finds on your machine: Claude Code, Codex, and agents that read `.agents/skills`.

```bash theme={"theme":"css-variables"}
curl -fsSL https://www.tryleap.ai/install.sh | sh
```

The skill tells the agent which endpoints to call, how to read a model's schema, when to wait and when to poll, how to upload files and how to handle errors. Run the command again to update it.

| Option | Effect |
| - | - |
| `sh -s -- --project` | Install into the current repository instead (`.claude/skills` and `.agents/skills`), so everyone who clones it gets the skill. |
| `sh -s -- --mcp` | Also connect Claude Code to Leap's MCP server. |

The skill is also one readable file at [www.tryleap.ai/skills/leap/SKILL.md](https://www.tryleap.ai/skills/leap/SKILL.md).

## Connect over MCP

Leap's MCP server lets an agent find models, read their schemas, price a run, generate and check on it. Connect with your Leap account, signing in once in the browser, or with an [API key](/docs/authentication) for clients that can't sign in and for agents that run unattended.

### Sign in with your Leap account

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={"theme":"css-variables"}
    claude mcp add --transport http leap https://app.tryleap.ai/api/mcp
    ```

    Then run `/mcp` in Claude Code and choose `leap` to sign in.
  </Tab>

  <Tab title="Claude.ai and ChatGPT">
    Add a custom connector with the URL `https://app.tryleap.ai/api/mcp`. In Claude, that's Settings, then Connectors. In ChatGPT, it's Settings, then Apps and connectors.
  </Tab>

  <Tab title="VS Code">
    Add this to `.vscode/mcp.json`:

    ```json theme={"theme":"css-variables"}
    {
      "servers": {
        "leap": { "type": "http", "url": "https://app.tryleap.ai/api/mcp" }
      }
    }
    ```
  </Tab>
</Tabs>

Any other client works if it supports MCP's OAuth sign-in with client metadata documents. You approve what the agent may do, and it spends the workspace you choose.

### Connect with an API key

The key goes in the `Authorization` header. The agent then works in the key's workspace, with the key's scopes.

<Tabs>
  <Tab title="Cursor">
    Add this to `.cursor/mcp.json`, with `LEAP_API_KEY` set in your environment:

    ```json theme={"theme":"css-variables"}
    {
      "mcpServers": {
        "leap": {
          "url": "https://app.tryleap.ai/api/mcp",
          "headers": { "Authorization": "Bearer ${env:LEAP_API_KEY}" }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Claude Code">
    ```bash theme={"theme":"css-variables"}
    claude mcp add --transport http leap https://app.tryleap.ai/api/mcp --header "Authorization: Bearer $LEAP_API_KEY"
    ```
  </Tab>

  <Tab title="Codex">
    ```bash theme={"theme":"css-variables"}
    codex mcp add leap --url https://app.tryleap.ai/api/mcp --bearer-token-env-var LEAP_API_KEY
    ```
  </Tab>
</Tabs>

| Tool | What it does |
| - | - |
| `search_models` | Finds models and presets by what they make. |
| `get_model` | Returns one model with its input schema and price. |
| `quote` | Prices a run without starting it. |
| `generate` | Runs a model or preset and waits for the result, with thumbnails the agent can look at. |
| `get_generation` | Reads a run's status, cost and outputs. |
| `cancel_generation` | Stops a run that hasn't finished. |
| `get_account` | Shows the balance of the workspace the agent spends from. |
| `list_workspaces` | Lists your workspaces, so the agent can pick one. |

The agent spends the balance of the workspace you choose, at the same prices as the API.

## Point your agent at these docs

* [www.tryleap.ai/docs/llms.txt](https://www.tryleap.ai/docs/llms.txt) lists every page with a one-line summary.
* [www.tryleap.ai/docs/llms-full.txt](https://www.tryleap.ai/docs/llms-full.txt) is every page in one file.
* Add `.md` to any page's URL for its Markdown, such as [www.tryleap.ai/docs/quickstart.md](https://www.tryleap.ai/docs/quickstart.md).
* The menu at the top of each page copies it as Markdown, or opens it in ChatGPT or Claude.

To add Leap to an app with a coding agent, paste this prompt:

```text theme={"theme":"css-variables"}
Add Leap media generation to this app. Read https://www.tryleap.ai/docs/llms.txt first, then the Quickstart, Generations and Files pages it links to.

- Call https://api.tryleap.ai from server code only, with the key from the LEAP_API_KEY environment variable in the x-api-key header.
- Pick the model, then read its input schema from GET /v1/models/{creator}/{name} (input_schema). Send only fields the schema lists; unknown fields are a 400.
- Files are inputs by ID, never by URL: upload images to POST /v1/files (raw bytes as the body) and videos or sounds through POST /v1/uploads, then pass the file_... ID.
- Start runs with POST /v1/generations and a new idempotency-key header per request. For images, send prefer: wait=60 to get the result in one call. For video, long-poll: read GET /v1/generations/{id} with prefer: wait=60 in a loop until status is succeeded, failed or canceled. In a web app, name a webhook URL on the request instead (see /docs/webhooks).
- Check status before reading output. A failed run has error.message and isn't charged.
- Output URLs expire after 24 hours: download what you keep, or read the generation again for fresh links.
- On an error answer, branch on error.type and error.code, and show error.message to the user.
```


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