---
title: "Chat Completions"
operation_id: "api.v1.ai.chat-completions"
method: POST
path: "/api/v1/ai/chat/completions"
group: "Ai"
api_version: "v1"
authenticated: true
canonical: "https://fature.al/api-reference/endpoints/api-v1-ai-chat-completions.html"
---

# Chat Completions

Pjesë e dokumentacionit [fature.al API](/api-reference/index.html).

## POST /api/v1/ai/chat/completions

URL-ja e plotë: `https://fature.al/api/v1/ai/chat/completions`

Versioni i API-t: `v1`.

Identifikimi: i detyrueshëm (bearer token, plus the `X-Client-Id` and `X-Client-Secret` headers).

### Fushat e body-t

| Fusha | Tipi | E detyrueshme | Përshkrimi |
| --- | --- | --- | --- |
| `model` | string, maxLength 64 | po |  |
| `messages` | array | po |  |
| `stream` | boolean | jo |  |

### Shembull kërkese

```bash
curl -X POST 'https://fature.al/api/v1/ai/chat/completions' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'X-Client-Id: YOUR_CLIENT_ID' \
  -H 'X-Client-Secret: YOUR_CLIENT_SECRET' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "model",
    "messages": [
        "Hello there"
    ],
    "stream": true
}'
```

### Përgjigjet

**201**: Created

| Fusha | Tipi | Përshkrimi |
| --- | --- | --- |
| `error` | object |  |
| `error.message` | any |  |
| `error.type` | any |  |
| `error.param` | any, nullable |  |
| `error.code` | any, nullable |  |

```json
{
    "error": {
        "message": "Hello there",
        "type": "type",
        "param": "param",
        "code": "code"
    }
}
```

**401**: Unauthenticated

| Fusha | Tipi | Përshkrimi |
| --- | --- | --- |
| `message` | string |  |

```json
{
    "message": "Unauthenticated."
}
```
