# Quickstart

Verify your API key, model ID, and response shape with a few minimal requests.

## 1. Prepare an API key

Create or select an API key in the console and send it in the `Authorization` header:

```http
Authorization: Bearer <YOUR_API_KEY>
```

## 2. List available models

Call the model list first so you do not hard-code a model that is unavailable to the current key.

```bash
curl https://kaienapi.com/v1/models \\
  -H "Authorization: Bearer <YOUR_API_KEY>"
```

Use the returned `id` as the model name in later requests.

## 3. Send your first text request

```bash
curl https://kaienapi.com/v1/chat/completions \\
  -H "Authorization: Bearer <YOUR_API_KEY>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "model": "gpt-5.5",
    "messages": [
      {"role": "user", "content": "Summarize this support ticket in one sentence"}
    ]
  }'
```

For a non-streaming response, read the text from `choices[0].message.content`.

## 4. Send your first image request

```bash
curl https://kaienapi.com/v1/images/generations \\
  -H "Authorization: Bearer <YOUR_API_KEY>" \\
  -H "Content-Type: application/json" \\
  -d '{
    "model": "gpt-image-2",
    "prompt": "Create a minimal headphone product poster on a white background",
    "size": "1024x1024",
    "quality": "low",
    "format": "jpeg",
    "n": 1
  }'
```

Image results may contain a URL or base64 data. Clients should support both forms.

## 5. Check usage

```bash
curl "https://kaienapi.com/v1/dashboard/billing/usage?start_date=2026-05-01&end_date=2026-05-06" \\
  -H "Authorization: Bearer <YOUR_API_KEY>"
```

Preserve the precision returned by the API when displaying charges.
