---
title: "Create a Text Completion"
method: POST
path: "/v1/complete"
tags: ["Completions", "Completions"]
---

# Create a Text Completion

`POST /v1/complete`

Create a Text Completion

## Request body

- CompletionInput — Anthropic completion request payload.
  - `model` string, required — Model identifier or alias.
  - `prompt` string, required — Legacy completion prompt in Human/Assistant format.
  - `max_tokens_to_sample` integer, required — Maximum number of tokens to sample.
  - `metadata` CompletionMetadata — CompletionMetadata schema.
    - `user_id` string, nullable — Opaque user identifier for request attribution.
  - `stop_sequences` string[], nullable — Stop generation if any sequence is encountered.
  - `stream` boolean — Whether to stream the response.
  - `temperature` number, nullable — Sampling temperature between 0 and 1.
  - `top_k` integer, nullable — Top-k sampling parameter.
  - `top_p` number, nullable — Top-p sampling parameter.

## Response `200`

Successful Response

- CompletionOutput — Anthropic completion response payload.
  - `id` string, required — Completion identifier
  - `type` 'completion', required — Object type. Always "completion".
  - `completion` string, required — Generated completion text.
  - `stop_reason` string, nullable, required — Reason the generation stopped.
  - `model` string, required — Resolved model identifier.

## Other responses

- `401` — Unauthorized
- `422` — Validation Error

## Changes

- **2026-06-02** `c711b911f68e` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/zylon-ai/apis/private-gpt-api/changes/v1/complete/post.md)

---

[API](https://skmtc.dev/zylon-ai/apis/private-gpt-api.md) · [All operations](https://skmtc.dev/zylon-ai/apis/private-gpt-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zylon-ai/private-gpt-api/revisions/4e828cf153c4/schema)
