> For the complete documentation index, see [llms.txt](https://ohana-1.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ohana-1.gitbook.io/docs/implementation/completions.md).

# Completions

This api call accepts a single prompt and returns a single text. It is used in places that do not need context.&#x20;

## Completion API

<mark style="color:green;">`POST`</mark> `/api/chat/completions`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| API-Key      | `<token>`          |

**Body**

| Name                       | Type   | Description                                                                                |
| -------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| `prompt`                   | string | <p>The prompt you are passing to the LLM<br><code>Who is the president of Kenya</code></p> |
| `systemPrompt`  (optional) | string | <p>Set default system message<br><code>You are a professional researcher</code></p>        |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "success": true,
  "text": "The president of Kenya is ...",
}
```

{% endtab %}

{% tab title="401" %}

```json
{
  "success": false,
  "error": "Unauthenticated: Api Key Missing"
}
```

{% endtab %}
{% endtabs %}
