> For the complete documentation index, see [llms.txt](https://docs.float16.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.float16.cloud/getting-started/llm-as-a-service/api-reference.md).

# API Reference

## Chat Completions

<mark style="color:green;">`POST`</mark> `https://api.float16.cloud/v1/chat/completions`

#### Headers

| Name                                            | Type   | Description                                                  |
| ----------------------------------------------- | ------ | ------------------------------------------------------------ |
| authorization<mark style="color:red;">\*</mark> | string | Examples: `float16-api-123e4567-e89b-12d3-a456-426655440000` |

#### Request Body

| Name                                      | Type            | Description                                                                                                                                    |
| ----------------------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| model<mark style="color:red;">\*</mark>   | string          | Enum (`"SeaLLM-7B-v2.5"`, `"SeaLLM-7B-v3"`, `"SQLCoder-7B-v2"`)                                                                                |
| message<mark style="color:red;">\*</mark> | array of object | <p>role (required) : Enum (<code>"system"</code>, <code>"user"</code>, <code>"assistant"</code>) </p><p></p><p>content (required) : String</p> |
| stream                                    | boolean         | default : false                                                                                                                                |
| max\_tokens                               | integer or null | Max Tokens (integer) or Max Tokens (null)                                                                                                      |

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

```json
{
  "id": "string",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "string",
        "role": "assistant",
      },
      "text": "string"
    }
  ],
  "created": 0,
  "model": "string",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 0,
    "prompt_tokens": 0,
    "total_tokens": 0
  }
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity " %}

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

{% endtab %}
{% endtabs %}
