---
title: "Interact with various LLMs models"
method: POST
path: "/v1/chat/completions"
tags: ["AIs"]
---

# Interact with various LLMs models

`POST /v1/chat/completions`

## Request

- Base URL: `https://api.paxsenix.org`
- URL: `https://api.paxsenix.org/v1/chat/completions`
- Auth: none declared

## Request body

- object
  - `model` string: The LLM model of the AI, see /v1/models for more
  - `messages` object[]
    - `role` 'user' | 'assistant' | 'system': The role of the entity in the conversation
    - `content` string: The actual message content

## Response `200`

Success - AI response retrieved successfully.

- object
  - `choices` object[]
    - `index` integer: The position of this choice in the response array
    - `message` object
      - `role` 'user' | 'assistant' | 'system': The role of the entity in the conversation
      - `content` string: The actual message content
    - `logprobs` unknown
    - `finish_reason` string: Indicates why the response was stopped, e.g., 'stop' for normal completion
  - `usage` object
    - `prompt_tokens` integer: Count tokens in the prompt/message
    - `completion_tokens` integer: Count tokens on completion/response
    - `total_tokens` integer: Total tokens

## Other responses

- `400`: Bad Request - Invalid or missing parameters.
- `500`: Server Error - Unable to process the request.

## Changes

- **2026-06-24** `53aa20d15d0e`: 2 warning
  - removed the optional property `creator` from the response with the `200` status
  - removed the optional property `ok` from the response with the `200` status

[Operation history](https://skmtc.dev/paxsenix/apis/paxsenix-api/changes/v1/chat/completions/post.md)

---

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