---
title: "Send a chat message"
method: POST
path: "/chat"
---

# Send a chat message

`POST /chat`

Sends a message payload to a specific character and receives a response containing the generated text, usage stats, and triggered tools.

## Request body

- ChatRequest
  - `character` string, uuid, required — The UUID of the target character.
  - `messages` Message[], required — The conversation history/messages payload.
    - `role` 'user' | 'character', required — The role of the message sender (user or character).
    - `content` ContentPart[], required
      - `type` 'text' | 'image_url', required — The type of content block.
      - `text` string, required — The actual text content of the message.
      - `image_url` object, nullable — Image attachment content block, if applicable.
        - `url` string — Base64-encoded bytes URL for an image content block, if applicable.

## Response `200`

Successful response from the character

- ChatResponse
  - `id` string — Unique identifier for the chat response.
  - `created` integer — Unix timestamp (in milliseconds) of when the response was created.
  - `character` string, uuid — The UUID of the character that generated the response.
  - `text` string — The generated text response from the AI.
  - `tools_used` string[] — A list of tools the AI triggered to generate the response.
  - `selfie` string, nullable — Bytes for an attached selfie, if applicable.
  - `voice_message` string, nullable — Bytes for an attached voice message, if applicable.
  - `usage` number, float — Token or compute usage for the request.

## Other responses

- `401` — Unauthorized (missing or invalid Authorization header)
- `402` — Payment Required (user has no credits left)
- `403` — Forbidden (user is banned)
- `404` — Character not found

---

[API](https://skmtc.dev/aicordapp/apis/aicord-chat-api.md) · [All operations](https://skmtc.dev/aicordapp/apis/aicord-chat-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/aicordapp/aicord-chat-api/revisions/9c5c8e677b11/schema)
