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

# API reference

> Use the verified Pareto API endpoints.

# API reference

The Pareto application programming interface (API) sends JavaScript Object Notation (JSON).

| Setting        | Value                                |
| -------------- | ------------------------------------ |
| Base URL       | `https://api.paretoinference.com/v1` |
| Authentication | `Authorization: Bearer <API_KEY>`    |

The `Authorization` header carries the API key. The word `Bearer` tells the API to use the next value as the key.

## List models

<Badge color="green">GET</Badge> `/models`

The response contains a `data` list. The list shows the model IDs available to the key.

```bash theme={null}
curl https://api.paretoinference.com/v1/models \
  -H "Authorization: Bearer $PARETO_API_KEY"
```

## Create a chat completion

<Badge color="green">POST</Badge> `/chat/completions`

Replace `MODEL_ID` with an `id` from `GET /models`. The request body must contain:

* `model`: the model ID.
* `messages`: the input messages.

```bash theme={null}
curl https://api.paretoinference.com/v1/chat/completions \
  -H "Authorization: Bearer $PARETO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

A successful response contains a `choices` list. Read the answer from `choices[0].message.content`.
