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

# 推理模式

> 使用推理模型与 reasoning_effort

推理类模型在作答前会进行更深入的思考，适合数学、代码与多步推理任务。通过 `reasoning_effort` 控制思考力度（如 `low` / `medium` / `high`）。

<CodeGroup>
  ```bash curl theme={null}
  curl https://tokendog.io/v1/chat/completions \
    -H "Authorization: Bearer $TOKENDOG_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model":"gpt-5.1",
      "reasoning_effort":"high",
      "messages":[{"role":"user","content":"一个数加上它的一半等于 36，求这个数。"}]
    }'
  ```

  ```python Python theme={null}
  from openai import OpenAI
  client = OpenAI(base_url="https://tokendog.io/v1", api_key="YOUR_TOKENDOG_API_KEY")
  resp = client.chat.completions.create(
      model="gpt-5.1",
      reasoning_effort="high",
      messages=[{"role":"user","content":"一个数加上它的一半等于 36，求这个数。"}],
  )
  print(resp.choices[0].message.content)
  ```

  ```javascript Node theme={null}
  import OpenAI from "openai";
  const client = new OpenAI({ baseURL:"https://tokendog.io/v1", apiKey:"YOUR_TOKENDOG_API_KEY" });
  const resp = await client.chat.completions.create({
    model:"gpt-5.1",
    reasoning_effort:"high",
    messages:[{role:"user",content:"一个数加上它的一半等于 36，求这个数。"}],
  });
  console.log(resp.choices[0].message.content);
  ```
</CodeGroup>

<Tip>推理力度越高，思考越充分但耗时与成本也越高；简单任务用 `low` 即可。</Tip>
