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

# Quickstart

> Make your first prediction with a single HTTP request.

## 1. Create an API key

Sign in to the [console](https://console.sqwish.ai), wait for
your invitation to be activated, and create an API key. Copy it when it is shown.
Keep it on your server.

```bash theme={null}
export D1_API_URL='https://d1-staging-5gh8d.ondigitalocean.app'
export D1_API_KEY='your-api-key'
```

Check which models are available:

```bash theme={null}
curl --fail-with-body "$D1_API_URL/v1/models" \
  -H "Authorization: Bearer $D1_API_KEY"
```

An empty `models` list means prediction is not ready. If `simulated` is `true`,
answers are samples for testing your integration.

## 2. Ask a question

Generate an operation key **once** for this prediction. Keep it for retries.

```bash theme={null}
export D1_OPERATION_KEY="$(python3 -c 'import uuid; print(uuid.uuid4())')"
```

```bash theme={null}
curl --fail-with-body --connect-timeout 5 --max-time 40 \
  "$D1_API_URL/v1/predictions" \
  -H "Authorization: Bearer $D1_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Idempotency-Key: $D1_OPERATION_KEY" \
  --data '{
    "model": "default",
    "context": "My parcel arrived with a cracked mug. Please help.",
    "questions": [{
      "id": "needs_help",
      "type": "binary",
      "prompt": "Does the customer need support?"
    }]
  }'
```

## 3. Use the answer

Read `answers[0].probability_true` for the score from 0 to 1. The response also
contains `request_id`, the selected `model`, and `usage` with the actual token
count and charge. USD amounts are decimal strings.

A `200` response means the answer and charge are saved. If the connection times
out, rerun the **same request with the same operation key** to recover its result
without a second charge. See [retries and errors](/api#idempotency-deadlines-and-retries).

## Next steps

Explore the **API reference** for request fields and curl, Python, and JavaScript
examples. Read [question types](/api#questions-and-answers) to add choice and
score questions to your request. Generate a new operation key whenever you change
the input.

The reference includes an interactive playground. It
sends requests through Mintlify’s proxy to the staging API, using the key you
provide. Successful predictions consume test credit just like requests from your
own code.
