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

# Quickstart

> Authenticate, inspect capabilities, and create your first Whitney training run.

## 1. Create a key

Create a test or live key in the Whitney portal and copy it once. New keys use
`whitney_test_…` or `whitney_live_…`.

```bash theme={null}
export WHITNEY_BASE_URL="https://api.staging.trywhitney.com"
export WHITNEY_API_KEY="whitney_test_..."
```

## 2. Inspect the current contract

```bash theme={null}
curl "$WHITNEY_BASE_URL/v1/training/capabilities" \
  -H "Authorization: Bearer $WHITNEY_API_KEY"
```

The response is an allowlist. Choose a returned model, or let Whitney choose
the provider by sending `provider: auto`.

## 3. Create a session

```bash theme={null}
curl -X POST "$WHITNEY_BASE_URL/v1/training/sessions" \
  -H "Authorization: Bearer $WHITNEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_id": "quickstart-session-1",
    "provider": "auto",
    "funding_preference": "platform"
  }'
```

Save the returned ID. Session creation is asynchronous; poll
`GET /v1/training/sessions/{session_id}` until the status is `ready` before
creating the run.

When `max_cost_microusd` is omitted for platform funding, Whitney applies an
organization spend ceiling. Set an explicit `max_cost_microusd` if you need a
hard ceiling for a single session.

## 4. Create a LoRA run

```bash theme={null}
curl -X POST \
  "$WHITNEY_BASE_URL/v1/training/sessions/$SESSION_ID/runs" \
  -H "Authorization: Bearer $WHITNEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_id": "quickstart-run-1",
    "base_model": "Qwen/Qwen3.5-4B",
    "tuning_mode": "lora",
    "lora": {
      "rank": 32,
      "train_mlp": true,
      "train_attn": true,
      "train_unembed": true
    }
  }'
```

Poll the returned run until it can accept operations, then continue with the
[SFT](/cookbooks/sft) or [GRPO](/cookbooks/grpo) cookbook.

<Warning>
  Creating a session can provision paid provider resources. Always finish or cancel the run and close the session,
  including after local failures.
</Warning>
