---
title: "Create Chat Completion (thinking inline)"
method: POST
path: "/v1thinking/chat/completions"
---

# Create Chat Completion (thinking inline)

`POST /v1thinking/chat/completions`

## Request

- Base URL: `https://api.electronhub.ai/v1`
- URL: `https://api.electronhub.ai/v1/v1thinking/chat/completions`
- Auth: HTTP bearer

Same request/response shape as `/v1/chat/completions`, but the model's reasoning is merged into the normal `content` stream wrapped in `<think>...</think>` tags instead of a separate field.

## Request body

- ChatCompletionRequest
  - `model` string, required: Model to use for completion
  - `messages` ChatMessage[], required: List of messages
    - `role` 'system' | 'user' | 'assistant' | 'tool', required
    - `content` union, required: May be null in assistant deltas/responses when only reasoning is being emitted.
      - string
      - ContentPart[]
        - union
          - TextContentPart
            - `type` 'text', required
            - `text` string, required
          - ImageContentPart
            - `type` 'image_url', required
            - `image_url` union, required
              - …
    - `reasoning` string, nullable: (Assistant only) The model's thinking/reasoning output, returned alongside `content` by `/v1/chat/completions`. Omitted when the model does not produce reasoning or when reasoning is excluded.
    - `reasoning_content` string, nullable: (Assistant only) Legacy field name for `reasoning`. Populated by `/v1legacy/chat/completions` or when `reasoning_content_compat=true` / `reasoning.delta_field="reasoning_content"` is set.
    - `name` string: Name of the message author
    - `tool_calls` ToolCall[]
      - `id` string, required
      - `type` 'function', required
      - `function` object, required
        - `name` string, required
        - `arguments` string
  - `stream` boolean: Enable streaming
  - `max_tokens` integer: Maximum tokens to generate
  - `temperature` number: Sampling temperature
  - `top_p` number: Nucleus sampling
  - `top_k` integer: Top-k sampling
  - `frequency_penalty` number
  - `presence_penalty` number
  - `tools` Tool[]: List of tools
    - `type` 'function', required
    - `function` FunctionDefinition, required
      - `name` string, required
      - `description` string
      - `parameters` object
  - `tool_choice` union
    - 'none' | 'auto'
    - ToolChoice
      - `type` 'function', required
      - `function` object, required
        - `name` string, required
  - `web_search` boolean: Enable web search
  - `thinking` union
    - object
      - `type` 'enabled', required
      - `budget_tokens` integer, required: Token budget for thinking
      - `display` 'summarized' | 'omitted'
    - object
      - `type` 'adaptive' | 'disabled', required
      - `display` 'summarized' | 'omitted'
  - `reasoning_effort` 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh': Reasoning effort level. Silently ignored for models that do not support reasoning_effort, so clients can send a single shared request across providers.
  - `reasoning` object: Reasoning configuration. Per-request override for reasoning output behavior.
    - `effort` 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh': Same enum as `reasoning_effort`.
    - `exclude` boolean: If true, strip the reasoning stream from the response entirely. The model still computes (and is billed for) reasoning tokens.
    - `delta_field` 'reasoning' | 'reasoning_content': Override the streaming/non-streaming field name regardless of which endpoint variant was hit.
  - `reasoning_delta_field` 'reasoning' | 'reasoning_content': Shorthand for `reasoning.delta_field`.
  - `reasoning_content_compat` boolean: Shorthand: set to `true` to force the legacy `reasoning_content` field, equivalent to `reasoning.delta_field = "reasoning_content"`.

## Response `200`

Success

- ChatCompletionResponse
  - `id` string, required
  - `object` string, required
  - `created` integer, required
  - `model` string, required
  - `choices` ChatChoice[], required
    - `index` integer, required
    - `message` ChatMessage, required
      - `role` 'system' | 'user' | 'assistant' | 'tool', required
      - `content` union, required: May be null in assistant deltas/responses when only reasoning is being emitted.
        - string
        - ContentPart[]
          - union
            - TextContentPart
              - …
            - ImageContentPart
              - …
      - `reasoning` string, nullable: (Assistant only) The model's thinking/reasoning output, returned alongside `content` by `/v1/chat/completions`. Omitted when the model does not produce reasoning or when reasoning is excluded.
      - `reasoning_content` string, nullable: (Assistant only) Legacy field name for `reasoning`. Populated by `/v1legacy/chat/completions` or when `reasoning_content_compat=true` / `reasoning.delta_field="reasoning_content"` is set.
      - `name` string: Name of the message author
      - `tool_calls` ToolCall[]
        - `id` string, required
        - `type` 'function', required
        - `function` object, required
          - `name` string, required
          - `arguments` string
    - `finish_reason` 'stop' | 'length' | 'content_filter' | 'tool_calls' | 'function_call'
  - `usage` Usage
    - `prompt_tokens` integer, required
    - `completion_tokens` integer, required
    - `total_tokens` integer, required

## Changes

- **2026-11-03** `a4ddf2e02571`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/electronhub/apis/electron-hub-api/changes/v1thinking/chat/completions/post.md)

---

[API](https://skmtc.dev/electronhub/apis/electron-hub-api.md) - [All operations](https://skmtc.dev/electronhub/apis/electron-hub-api/llms.txt) - [OpenAPI document](https://skmtc.dev/electronhub/apis/electron-hub-api/revisions/a4ddf2e02571?raw)
