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

# Completions

> Create a text completion (legacy).

<Warning>
  This endpoint is legacy. Use [Chat Completions](/api-reference/chat-completions) instead for better results.
</Warning>

## Create Completion

```bash theme={null}
POST https://api.redpill.ai/v1/completions
```

## Request

```json theme={null}
{
  "model": "gpt-3.5-turbo-instruct",
  "prompt": "Say this is a test",
  "max_tokens": 7,
  "temperature": 0
}
```

## Response

```json theme={null}
{
  "id": "cmpl-123",
  "object": "text_completion",
  "created": 1677652288,
  "model": "gpt-3.5-turbo-instruct",
  "choices": [{
    "text": "\n\nThis is a test.",
    "index": 0,
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 5,
    "completion_tokens": 7,
    "total_tokens": 12
  }
}
```

Use Chat Completions API for modern applications.
