# Finalize gateway billing group

```http
POST /ai/gateway/billing/finalize
```

Finalize gateway billing group.

## Parameters

| Name                            | In     | Required | Description |
| ------------------------------- | ------ | -------- | ----------- |
| `x-veryfront-project-reference` | header |          |             |
| `x-veryfront-project-id`        | header |          |             |
| `x-veryfront-project-slug`      | header |          |             |

## Request body

| Field              | Type   | Required | Description |
| ------------------ | ------ | -------- | ----------- |
| `billing_group_id` | string | Yes      |             |

## Responses

| Status | Description                                                                                     |
| ------ | ----------------------------------------------------------------------------------------------- |
| 200    | Direct gateway charges for the user-facing billing group, reconciled from server-recorded usage |
| 400    | Invalid billing group request                                                                   |
| 401    | Unauthorized                                                                                    |
| 402    | Insufficient AI credits for reconciliation                                                      |
| 403    | Project access denied                                                                           |
| 404    | Billing group not found                                                                         |
| 409    | Billing group usage is not ready to finalize                                                    |
