---
title: "Send a chat request to an LLM"
method: POST
path: "/api/llm/v1/chat"
tags: ["LLM Proxy"]
---

# Send a chat request to an LLM

`POST /api/llm/v1/chat`

Proxies a chat completion request to the specified LLM provider and model. Supports tool definitions for function calling.

## Request body

- LLMChatRequest
  - `max_tokens` integer
  - `messages` LLMMessage[], required
    - `content` LLMContentBlock[], required
      - `is_error` boolean — Populated when type=tool_result
      - `text` string
      - `tool_use` object — Populated when type=tool_use
        - `id` string
        - `input` object
        - `name` string
      - `tool_use_id` string — Populated when type=tool_result
      - `type` 'text' | 'image' | 'document' | 'tool_use' | 'tool_result', required
    - `role` 'user' | 'assistant' | 'system' | 'tool', required
  - `model` string — Override default model
  - `provider` string — Override default provider
  - `stop_sequences` string[]
  - `system_prompt` string
  - `temperature` number
  - `tools` LLMTool[]
    - `description` string, required
    - `input_schema` object, required
    - `name` string, required

## Response `200`

LLM chat completion response.

- LLMChatResponse
  - `content` LLMContentBlock[], required
    - `is_error` boolean — Populated when type=tool_result
    - `text` string
    - `tool_use` object — Populated when type=tool_use
      - `id` string
      - `input` object
      - `name` string
    - `tool_use_id` string — Populated when type=tool_result
    - `type` 'text' | 'image' | 'document' | 'tool_use' | 'tool_result', required
  - `stop_reason` 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | 'content_filter' | 'error', required
  - `usage` LLMTokenUsage
    - `completion_tokens` integer
    - `prompt_tokens` integer
    - `total_tokens` integer

## Other responses

- `401` — Missing or invalid authentication token.
- `403` — Insufficient permissions.

## Changes

- **2026-07-30** `6912d69b744f` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/pgedge/apis/pgedge-postgres-mcp-server-api/changes/api/llm/v1/chat/post.md)

---

[API](https://skmtc.dev/pgedge/apis/pgedge-postgres-mcp-server-api.md) · [All operations](https://skmtc.dev/pgedge/apis/pgedge-postgres-mcp-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pgedge/pgedge-postgres-mcp-server-api/revisions/6084bab46b1e/schema)
