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

# chat

Chat completions are the core of Askr's text API. It follows the OpenAI format, so any OpenAI-compatible library works.

## Basic request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.heyaskr.ai/chat/completions \
    -H "Authorization: Bearer ASKR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-5.5",
      "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain quantum computing in one line."}
      ]
    }'
  ```

  ```python Python theme={null}
  from openai import OpenAI
  client = OpenAI(base_url="https://api.heyaskr.ai", api_key="ASKR_API_KEY")

  resp = client.chat.completions.create(
      model="gpt-5.5",
      messages=[
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Explain quantum computing in one line."},
      ],
  )
  print(resp.choices[0].message.content)
  ```
</CodeGroup>

## Messages

The `messages` array holds the conversation. Each message has a `role` and `content`.

| Role        | Purpose                                                   |
| ----------- | --------------------------------------------------------- |
| `system`    | Sets behaviour and context for the assistant.             |
| `user`      | A message from the end user.                              |
| `assistant` | A previous reply from the model (for multi-turn context). |

To continue a conversation, append the assistant's reply and the next user message, then send the whole array again.

## Common parameters

<ParamField body="temperature" default="1" type="number">
  Higher is more creative, lower is more focused. Range 0–2.
</ParamField>

<ParamField body="max_tokens" type="integer">
  Maximum tokens to generate in the reply.
</ParamField>

<ParamField body="stream" default="false" type="boolean">
  Stream tokens as they are generated. See [Streaming](/capabilities/streaming).
</ParamField>

See the full list in [Chat completions](/api-reference/chat-completions).
