> ## Documentation Index
> Fetch the complete documentation index at: https://docs.darkbloom.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Text completions — POST /v1/completions

> POST /v1/completions — legacy text completion endpoint. Accepts model, prompt, max_tokens, temperature, and stream. Returns a completion object or SSE stream.

The text completions endpoint is a legacy OpenAI-compatible endpoint that generates a continuation of a raw text prompt rather than a structured message history. It is routed through the same provider dispatch pipeline as [chat completions](https://docs.darkbloom.dev/reference/chat-completions.md), so the same attestation headers and streaming format apply.

For most use cases, prefer [POST /v1/chat/completions](https://docs.darkbloom.dev/reference/chat-completions.md), which is the actively developed endpoint with full tool-call and response-format support.

## Authentication

All inference endpoints require a Bearer token:

```
Authorization: Bearer sk-db-...
```

## Request

**model** `string` *required*

The model ID to use. See [Models](https://docs.darkbloom.dev/reference/models.md) for the list of available IDs.

**prompt** `string` *required*

The input text to complete.

**max\_tokens** `integer`

Maximum number of tokens to generate. If you omit it, the coordinator uses the model's `max_output_length`, cut to what the prompt leaves of `context_length`.

**temperature** `number`

Sampling temperature between 0 and 2.

**stream** `boolean` (default: false)

When `true`, returns the response as SSE chunks ending with `data: [DONE]`.

## Example

```bash cURL theme={null}
curl https://api.darkbloom.dev/v1/completions \
  -H "Authorization: Bearer sk-db-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-4-26b",
    "prompt": "The capital of France is",
    "max_tokens": 16
  }'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.