# Unable to pass maxTokens and extract Resoning Summary in AzureChatOpenAI

**URL:** <https://forum.langchain.com/t/unable-to-pass-maxtokens-and-extract-resoning-summary-in-azurechatopenai/1843>\
**Category:** LangChain\
**Tags:** js-help\
**Created:** [October 16, 2025, 1:53pm UTC](https://forum.langchain.com/t/unable-to-pass-maxtokens-and-extract-resoning-summary-in-azurechatopenai/1843 "2025-10-16T13:53:59Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pawel-twardziak](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pawel-twardziak/32/960_2.png) [@pawel-twardziak](https://forum.langchain.com/u/pawel-twardziak)\
**Post date:** [October 17, 2025, 6:12pm UTC](https://forum.langchain.com/t/unable-to-pass-maxtokens-and-extract-resoning-summary-in-azurechatopenai/1843/4 "2025-10-17T18:12:31Z")

</div>

Hi @Nikfury

try this:

```js
const ai = await llm.invoke(messages, {
    reasoning: {
        effort: "high",
        summary: "auto" /* summary config if desired */,
    },
});

```

Your issue might be related to that [How to extract GPT-5 reasoning summaries with @langchain/openai? - #15 by pawel-twardziak](https://forum.langchain.com/t/how-to-extract-gpt-5-reasoning-summaries-with-langchain-openai/1802/15) since it is still OpenAI class that is being exetended.

---

_[View the full topic](https://forum.langchain.com/t/unable-to-pass-maxtokens-and-extract-resoning-summary-in-azurechatopenai/1843)._
