---
title: "Generate Message Completions"
method: POST
path: "/api/message/generate_message_completions"
tags: ["Message"]
---

# Generate Message Completions

`POST /api/message/generate_message_completions`

Uses `openai` to generate a message completion for a given prompt.

## Headers

- `TR-Dataset` string, uuid, required

## Request body

- GenerateMessageCompletionsReqPayload
  - `system_message` string, required — The system message to use for the message completion.
  - `user_message` string, required — The user message to use for the message completion.

## Response `200`

The generated message completion

## Other responses

- `400` — Service error relating to generating a message completion

## Changes

> 50 revisions in range; 1 could not be searched.

- **2025-05-28** `55b5d716b370` — 1 info
  - endpoint added
- **2025-04-24** `661f8d6f359b` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/devflowinc/apis/trieve-api/changes/api/message/generate_message_completions/post.md)

---

[API](https://skmtc.dev/devflowinc/apis/trieve-api.md) · [All operations](https://skmtc.dev/devflowinc/apis/trieve-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/devflowinc/trieve-api/revisions/84583e7c9fc1/schema)
