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

# Using OpenAI o1 and o3 Reasoning Models on KiosAPI

> Use o1-mini, o1-preview, o3, o3-mini via POST /v1/chat/completions. Note: streaming is not supported and only user role messages are accepted.

KiosAPI supports OpenAI's o1 and o3 reasoning model series through the standard `POST /v1/chat/completions` endpoint. These models are built for complex, multi-step reasoning tasks, but they come with two key behavioural differences from regular chat models: streaming is not supported, and the `system` role is not accepted — you must structure your conversation using `user` and `assistant` messages only.

<Warning>
  **Streaming is not supported** for o1 and o3 series models. Always set `stream: false` (or omit it entirely) in your request body, otherwise the request will fail.

  **The `system` role is not supported.** Only `user` and `assistant` roles are accepted in the `messages` array.
</Warning>

## Request

**`POST https://kiosapi.com/v1/chat/completions`**

### Headers

| Header          | Required | Description        |
| --------------- | -------- | ------------------ |
| `Content-Type`  | Yes      | `application/json` |
| `Authorization` | Yes      | `Bearer sk-xxx`    |

### Request Body

<ParamField body="model" type="string" required>
  The reasoning model to use. Supported values include `o1-mini`, `o1-preview`, `o3`, and `o3-mini`.
</ParamField>

<ParamField body="messages" type="array" required>
  An array of message objects forming the conversation. Only `user` and `assistant` roles are supported.

  <Expandable title="messages[] properties">
    <ParamField body="messages[].role" type="string" required>
      The role of the message author. Accepted values are `"user"` and `"assistant"`. The `"system"` role is not supported by o1/o3 models.
    </ParamField>

    <ParamField body="messages[].content" type="string" required>
      The text content of the message.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="max_completion_tokens" type="number">
  The maximum number of tokens the model is allowed to generate in its response, including reasoning tokens consumed internally.
</ParamField>

<ParamField body="stream" type="boolean">
  Whether to stream the response. Must be `false` — streaming is not supported for o1/o3 models.
</ParamField>

### Example Request

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl https://kiosapi.com/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-xxx" \
      -d '{
        "model": "o1-mini",
        "messages": [
          {
            "role": "user",
            "content": "Explain quantum computing in simple terms"
          }
        ],
        "max_completion_tokens": 1688,
        "stream": false
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import openai

    openai.api_key = "sk-xxx"
    openai.base_url = "https://kiosapi.com/v1/"

    response = openai.chat.completions.create(
        model="o1-mini",
        messages=[
            {"role": "user", "content": "Explain quantum computing in simple terms"}
        ],
        max_completion_tokens=1688,
        stream=False
    )

    print(response.choices[0].message.content)
    ```
  </Tab>
</Tabs>

## Response

The response follows the standard chat completions shape. The `finish_reason` will be `"stop"` when the model has completed its reasoning and produced a final answer.

```json theme={null}
{
  "id": "chatcmpl-A1iMgDLzZtUJ9QDpfqDLxKH0zfUnp",
  "object": "chat.completion",
  "created": 1724972230,
  "model": "o1-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Quantum computing is a type of computation...",
        "refusal": null
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 150,
    "total_tokens": 159
  },
  "system_fingerprint": "fp_157b3831f5"
}
```

### Response Fields

<ResponseField name="choices[].message.content" type="string">
  The model's final text response after completing its internal reasoning process.
</ResponseField>

<ResponseField name="choices[].finish_reason" type="string">
  The reason the model stopped generating. Typically `"stop"` when a complete response has been produced.
</ResponseField>

<ResponseField name="usage.completion_tokens" type="number">
  Total completion tokens used, which may include tokens consumed during the model's internal reasoning steps.
</ResponseField>
