---
title: "Send a chat completion request through LedgerBeaver's unified AI gateway. Automatically routes to the best available provider based on company routing rules. Falls back through the provider chain if the primary is unavailable."
method: POST
path: "/api/v1/provider-chat"
---

# Send a chat completion request through LedgerBeaver's unified AI gateway. Automatically routes to the best available provider based on company routing rules. Falls back through the provider chain if the primary is unavailable.

`POST /api/v1/provider-chat`

## Request

- Base URL: `https://app.ledgerbeaver.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.ledgerbeaver.com/api/v1/provider-chat`
- Auth: API key in header `X-API-Key`

## Request body

- object
  - `companyId` string, required
  - `messages` string, required
  - `role` string, required
  - `content` string, required
  - `model` string, required
  - `taskType` string, required
  - `maxTokens` number, required
  - `temperature` number, required

## Response `200`

Successful response

- object
  - `content` object[]
    - `type` string
    - `text` string

## Other responses

- `401`: Unauthorized
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/ledgerbeaver/apis/ledgerbeaver-ai-api.md) · [All operations](https://skmtc.dev/ledgerbeaver/apis/ledgerbeaver-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ledgerbeaver/apis/ledgerbeaver-ai-api/revisions/cfd673927c46?raw)
