POST
/
v1
/
chat
/
completions
Chat Completions Reasoning Control
curl --request POST \
  --url https://api.example.com/v1/chat/completions \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "messages": [
    {}
  ],
  "reasoning_effort": "<string>",
  "max_completion_tokens": 123
}
'
Control how much effort reasoning models spend on thinking before responding.

Overview

For reasoning models like o1, you can control the amount of reasoning effort the model applies. Higher effort levels result in more thorough reasoning but take longer and use more tokens.

Authentication

All requests require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Request Parameters

model
string
required
ID of the reasoning model to use. Example: o1, o1-mini, o1-preview
messages
array
required
A list of messages comprising the conversation so far.
reasoning_effort
string
default:"medium"
Controls reasoning effort level. Options: low, medium, high
max_completion_tokens
integer
Maximum number of tokens for both reasoning and response.

Request Example

curl -X POST https://api.example.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "o1",
    "messages": [
      {"role": "user", "content": "Solve this math problem step by step: What is the integral of x^2 * e^x?"}
    ],
    "reasoning_effort": "high",
    "max_completion_tokens": 4096
  }'

Response Example

{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "o1",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "To solve the integral of x^2 * e^x, we'll use integration by parts...\n\nThe final answer is: (x^2 - 2x + 2) * e^x + C"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 350,
    "reasoning_tokens": 280,
    "total_tokens": 375
  }
}

Reasoning Effort Levels

LevelDescriptionUse Case
lowMinimal reasoning, faster responseSimple questions, quick tasks
mediumBalanced reasoning (default)General purpose tasks
highMaximum reasoning effortComplex problems, math, coding

Available Models

  • o1
  • o1-mini
  • o1-preview