Required API changes for GPT-5.x reasoning models

Required API changes for o1 / GPT-5.x reasoning models

I’ve updated my PopClip extension today to work with the newer reasoning models, and wanted to share the necessary changes for anyone else planning to migrate.

Important deprecation timeline:

  • chatgpt-4o-latest will be shut down on February 17, 2026 (replacement: gpt-5.1-chat-latest)
  • o1-preview will be shut down on July 28, 2025 (replacement: o3)
  • o1-mini will be shut down on October 27, 2025 (replacement: o4-mini)

The existing parameter configuration no longer works with the o1-series and GPT-5.x models and requires specific adjustments.

Key Changes

1. Token limit: max_tokensmax_completion_tokens

const { data } = await openai.post("chat/completions", {
    model: "gpt-5.1"
    max_completion_tokens: 1048,  // Replaces max_tokens
    reasoning_effort: "low",      // New: Controls reasoning depth
    messages: [...]
});

2. Reasoning control: The new reasoning_effort parameter controls thinking depth:

  • "none" – No reasoning
  • "low" – Minimal reasoning (fast, cost-effective)
  • "medium" – Balanced (default)
  • "high" – Maximum reasoning (slower, more expensive)

Additional Optional Parameters

{
    model: "gpt-5.1",
    max_completion_tokens: 1048,
    reasoning_effort: "low",
    temperature: 1.0,              // Creativity (0-2)
    top_p: 1.0,                    // Nucleus sampling
    presence_penalty: 0.0,         // Topic diversity (-2 to 2)
    frequency_penalty: 0.0,        // Word repetition (-2 to 2)
    stream: false,                 // Streaming responses
    n: 1,                          // Number of responses
    store: true,                   // Store for evaluation
    metadata: {}                   // Custom tracking data
}

Important: The o1-series models do not support system messages in the traditional sense. Prompts must be integrated into the user message.

Documentation

Hope this helps anyone else migrating their extensions!

2 Likes

Thanks for this helpful post @konfluenzpunkt !

What is the name of this extension? Is it available in the PopClip extensions Directory or GitHub or ?? I saw two AI related extensions in the Directory but none showing a recent update.

Thank you.