# Quickstart

This walks you through the typical generation flow end-to-end: authenticate, pick a model, estimate cost, generate, and retrieve results.

## 1\. Get your API token

Signing up and creating a token are both self-serve and free — see [self-serve access](/docs/self-serve-access) if you don’t have a workspace yet.

1. Log in to [app.layer.ai](https://app.layer.ai)
2. Go to **Settings > Personal Access Tokens**
3. Click **Create Token**, name it, and copy the value

Export it for the examples below:

```bash
export LAYER_TOKEN="your-pat-token"
export WORKSPACE_ID="your-workspace-id"
```

## 2\. Pick a base model

List the base models available in your workspace and choose one that fits your use case:

```bash
curl https://api.app.layer.ai/api/v2/workspaces/$WORKSPACE_ID/base-models \
  -H "Authorization: Bearer $LAYER_TOKEN"
```

Note the `base_model_id` of the base model you want to use. See [Models & capabilities](/docs/models) for filtering options.

## 3\. Estimate cost

Check how many Creative Units the generation will consume:

```bash
curl -X POST https://api.app.layer.ai/api/v2/workspaces/$WORKSPACE_ID/inferences/estimate \
  -H "Authorization: Bearer $LAYER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "base_model_id": "BASE_MODEL_ID",
    "prompt": "A medieval castle on a hilltop at sunset, game concept art",
    "width": 1024,
    "height": 1024
  }'
```

## 4\. Generate

```bash
curl -X POST https://api.app.layer.ai/api/v2/workspaces/$WORKSPACE_ID/inferences \
  -H "Authorization: Bearer $LAYER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "base_model_id": "BASE_MODEL_ID",
    "prompt": "A medieval castle on a hilltop at sunset, game concept art",
    "width": 1024,
    "height": 1024
  }'
```

This returns immediately with an `inference_id` and `status: "in_progress"`.

## 5\. Poll for results

```bash
curl https://api.app.layer.ai/api/v2/workspaces/$WORKSPACE_ID/inferences/INFERENCE_ID \
  -H "Authorization: Bearer $LAYER_TOKEN"
```

When `status` is `complete`, the response includes URLs to your generated assets.

## Next steps

* Browse the [API reference](/docs/v2/rest-api) for full endpoint details and parameter documentation
* Attach [reference sets](/docs/v2/rest-api/operations/tags/reference-sets) to guide generation with your own art style
* Use workflows to run multi-step pipelines
