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

# API basics

> Set up authentication, safe retries, and run polling before using the endpoint reference.

<Note>
  Using a coding assistant? Choose **Copy page** or **View as Markdown** above,
  then use the [coding assistant guide](/get-started/use-with-an-assistant).
  The OpenAPI field names on this site are the exact HTTP contract.
</Note>

## Base URL

```text theme={null}
https://api.getmillwork.dev/v1
```

## Authentication

Use an organization API key as a bearer token. Dashboard cookies are for human
browser sessions and must not be used in an application.

```bash theme={null}
curl --fail-with-body \
  --header "Authorization: Bearer $MILLWORK_API_KEY" \
  "https://api.getmillwork.dev/v1/account"
```

**Expected result:** the response names your organization and current account
limits without exposing the API key.

## Safe retries

Use a unique `Idempotency-Key` for each new run. If a network failure leaves the
response uncertain, retry with the same key and identical body.

## Runs are asynchronous

Submitting work returns before the run finishes. Poll the status link until the
run reaches `completed`, `failed`, `cancelled`, or `expired`.

## Errors

Errors use a standard JSON shape. Read
[Errors and retries](/guides/errors-and-retries) before implementing automatic
retries.

<CardGroup cols={2}>
  <Card title="Make your first API call" icon="terminal" href="/get-started/first-api-call">
    Check authentication without calling a provider.
  </Card>

  <Card title="Run a model" icon="play" href="/get-started/builder">
    Submit a live task and read the result.
  </Card>
</CardGroup>
