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

# Quickstart

> Set a key and model, check access, and make your first chat request.

Use Bash and cURL to verify a complete request. If you use a ready-made application, start with the [client guides](https://apione.ai/docs/en/guides/clients.md).

## 1. Create an API key

Create a key on the [API Keys page](https://apione.ai/en/app/api-keys), select an available group and model permissions, and save the full key. These commands work in macOS, Linux, or another Bash environment.

![APIONE API Keys overview](https://mintcdn.com/apione/pAFvFGkbmcRZirTZ/images/ui/api-keys-overview.png?fit=max\&auto=format\&n=pAFvFGkbmcRZirTZ\&q=85\&s=286a882ab53c81ad3bd16d56c6487dc9)

APIONE API Keys overview

```bash theme={null}
export APIONE_API_KEY="YOUR_APIONE_KEY"
```

Replace `YOUR_APIONE_KEY` with your key and keep it in your own terminal or server environment.

## 2. List and select a model

```bash theme={null}
curl --fail-with-body --max-time 120 https://api.apione.ai/v1/models \
  -H "Authorization: Bearer $APIONE_API_KEY"
```

Copy an ID from `data[].id` for a model that supports Chat Completions. Check protocols and parameters in the [model directory](https://apione.ai/en/models).

```bash theme={null}
export APIONE_MODEL="YOUR_APIONE_MODEL_ID"
```

Replace `YOUR_APIONE_MODEL_ID` with the actual case-sensitive ID. If a model is missing from your key's list, check the key's permissions and group.

## 3. Send the first request

```bash theme={null}
curl --fail-with-body --max-time 120 https://api.apione.ai/v1/chat/completions \
  -H "Authorization: Bearer $APIONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"model\":\"$APIONE_MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain an API gateway in one sentence.\"}]}"
```

## Windows PowerShell quick check

Windows users can run the steps below in PowerShell. First confirm available balance in the [APIONE console](https://apione.ai/en/app), then create a key.

```powershell theme={null}
$env:APIONE_API_KEY = "YOUR_APIONE_KEY"
$apioneHeaders = @{ Authorization = "Bearer $env:APIONE_API_KEY" }
$apioneModels = Invoke-RestMethod `
  -Uri "https://api.apione.ai/v1/models" `
  -Headers $apioneHeaders -TimeoutSec 30
$apioneModels.data | Select-Object id
```

Copy a Chat Completions model ID from the list, replace the placeholder below, and then send the request.

```powershell theme={null}
$env:APIONE_MODEL = "YOUR_APIONE_MODEL_ID"
$apioneBody = @{
  model = $env:APIONE_MODEL
  messages = @(
    @{ role = "user"; content = "Reply only OK." }
  )
  stream = $false
} | ConvertTo-Json -Depth 6

$apioneReply = Invoke-RestMethod `
  -Uri "https://api.apione.ai/v1/chat/completions" `
  -Method Post -Headers $apioneHeaders `
  -ContentType "application/json; charset=utf-8" `
  -Body ([System.Text.Encoding]::UTF8.GetBytes($apioneBody)) `
  -TimeoutSec 120
$apioneReply.choices[0].message.content
$apioneReply.usage
```

If you see the model list first and then the reply, both requests succeeded. A client still needs separate verification for streaming, tool calls, and other production capabilities. Keep the HTTP status code and response body when an error occurs, and handle it according to [troubleshooting](https://apione.ai/docs/en/support/errors.md).

## 4. Check the response and usage

Read the reply from `choices[0].message.content` and token usage from `usage`. This example shows only part of the response; text and numbers depend on the actual request:

```json theme={null}
{
  "choices": [{"message": {"role": "assistant", "content": "Text returned by the model"}}],
  "usage": {"prompt_tokens": 20, "completion_tokens": 30, "total_tokens": 50}
}
```

Review the request details and charges in the [console](https://apione.ai/en/app). API usage fields alone do not replace the bill.

| Problem | Check first |
| - | - |
| 401 | The complete, valid key and a single authentication method |
| 403 or unavailable model | Model ID, key permissions, and billing group |
| 404 | Whether the full request URL duplicates `/v1` |
| 402 / 429 | [Balance, costs, and concurrency limits](https://apione.ai/docs/en/account/usage.md) |

Next: [Python and Node.js](https://apione.ai/docs/en/guides/sdks.md), [streaming](https://apione.ai/docs/en/models/streaming.md), and [troubleshooting](https://apione.ai/docs/en/support/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.