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

# Quickstart: REST

> Key → upload → run. Five minutes to a finished, editable cutout.

This walkthrough removes the background from a clip: the lead template, and a
synchronous one, so there is no polling: the run call returns the result.

## Base URL

All API calls go to one host:

```txt theme={null}
https://api.askeditor.com
```

Every response is wrapped as `{ "success": true, "data": … }`; errors carry
`{ "success": false, "errorCode": … }`.

<Steps>
  <Step title="Get a key">
    Create one at [Workspace → Your Account → API Keys](/docs/setting-up/get-your-api-key)
    with the **For skills** preset, and export it:

    ```bash theme={null}
    export ASKEDITOR_API_KEY="ake_live_…"
    ```
  </Step>

  <Step title="Check who you are (free)">
    ```bash theme={null}
    curl https://api.askeditor.com/v1/me \
      -H "Authorization: Bearer $ASKEDITOR_API_KEY"
    # → data: { projectName, plan, creditsRemaining, scopes }
    ```
  </Step>

  <Step title="Upload material">
    Skip this step if your video is already at a public https url: a run
    accepts the url directly. For a local file, mint a ticket and post the
    file to it:

    ```bash theme={null}
    curl -X POST https://api.askeditor.com/v1/uploads \
      -H "Authorization: Bearer $ASKEDITOR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "purpose": "clip for background removal" }'
    # → data: { ticket: "upl_…", uploadUrl: "…" }
    # uploadUrl is the BROWSER path for humans (open it, drop the file).
    # From a shell, ignore it and post the file directly, as below.

    curl -X POST https://api.askeditor.com/v1/uploads/upl_…/file \
      -F "file=@clip.mp4"
    # → data: { material: "mat…", status: "uploaded" }
    ```

    The file call needs no API key: the ticket is a one-time,
    single-purpose credential, safe to use in a shell.
  </Step>

  <Step title="Estimate (free)">
    ```bash theme={null}
    curl "https://api.askeditor.com/v1/estimate?recipeId=remove-background" \
      -H "Authorization: Bearer $ASKEDITOR_API_KEY"
    # → data: { credits: 25, etaSeconds: 90, blockers: [] }
    ```

    Blockers are typed (`INSUFFICIENT_CREDITS`, `IN_FLIGHT`, `SCOPE_DENIED`,
    `RECIPE_NOT_ALLOWED`, `SPEND_CAP_REACHED`): branch on codes, never parse
    prose.
  </Step>

  <Step title="Run: the response is the result">
    ```bash theme={null}
    curl -X POST https://api.askeditor.com/v1/run/remove-background \
      -H "Authorization: Bearer $ASKEDITOR_API_KEY" \
      -H "Content-Type: application/json" \
      --max-time 600 \
      -d '{ "material": "mat…" }'
    ```

    The call holds open while the GPU mattes the clip (\~40-90s), then:

    ```json theme={null}
    {
      "success": true,
      "data": {
        "status": "completed",
        "processedVideoUrl": "https://…/processed.webm",
        "canvasId": "66f…",
        "editorPath": "/workspace/canvas/editor/66f…",
        "credits": 25,
        "creditsCharged": true,
        "cached": false
      }
    }
    ```
  </Step>
</Steps>

The webm carries a true alpha channel, ready to composite. `editorPath`
(on askeditor.com) opens the same cutout as an editable canvas: see
[The editable canvas](/docs/concepts/the-editable-canvas). Retrying the identical
call returns `"cached": true` and charges nothing.

<Note>
  Queued templates (tighten, launch-cut) run through the
  [MCP connector](/docs/quickstart/agents) and resolve via
  [`GET /v1/jobs/{id}`](/docs/setting-up/jobs-and-polling).
</Note>
