fix(ai): remove hard max_tokens gate for Vercel AI Gateway
Vercel AI Gateway is a pass-through proxy: docs list max_tokens only
but upstream OpenAI reasoning models (gpt-5/o1/o3) require
max_completion_tokens (vercel/ai#7863, #11828). Forcing max_tokens for
provider vercel-ai-gateway breaks that. Leave to compatibility override
/ default max_completion_tokens instead.
Loading branch information
Uh oh!
There was an error while loading. Please reload this page.
"body": "{\"model\": \"anthropic/claude-sonnet-4.6\", \"messages\": [{\"role\": \"system\", \"content\": \"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}, {\"role\": \"user\", \"content\": \"What is the weather in Paris?\"}], \"tools\": [{\"type\": \"function\", \"function\": {\"name\": \"get_weather\", \"description\": \"Get current weather for a city.\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}}, \"required\": [\"city\"], \"additionalProperties\": false}, \"strict\": false}}], \"stream\": true, \"stream_options\": {\"include_usage\": true}, \"max_tokens\": 1536, \"reasoning\": {\"enabled\": true, \"max_tokens\": 1024}}"
"body": "{\"model\": \"anthropic/claude-sonnet-4.6\", \"messages\": [{\"role\": \"system\", \"content\": \"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}, {\"role\": \"user\", \"content\": \"What is the weather in Paris?\"}], \"tools\": [{\"type\": \"function\", \"function\": {\"name\": \"get_weather\", \"description\": \"Get current weather for a city.\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}}, \"required\": [\"city\"], \"additionalProperties\": false}, \"strict\": false}}], \"stream\": true, \"stream_options\": {\"include_usage\": true}, \"reasoning\": {\"enabled\": true, \"max_tokens\": 1024}, \"max_completion_tokens\": 1536}"
},
"response": {
"status": 200,
Expand All
@@ -41,7 +41,7 @@
"headers": {
"content-type": "application/json"
},
"body": "{\"model\": \"anthropic/claude-sonnet-4.6\", \"messages\": [{\"role\": \"system\", \"content\": \"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}, {\"role\": \"user\", \"content\": \"What is the weather in Paris?\"}, {\"role\": \"assistant\", \"content\": \"Sure! Let me check the weather in Paris for you!\", \"tool_calls\": [{\"id\": \"toolu_01KBCTV7MS4TY6U2zSTF2K2n\", \"type\": \"function\", \"function\": {\"name\": \"get_weather\", \"arguments\": \"{\\\"city\\\":\\\"Paris\\\"}\"}}], \"reasoning\": \"The user wants to know the weather in Paris. I'll use the get_weather tool.\", \"reasoning_details\": [{\"type\": \"reasoning.text\", \"text\": \"The user wants to know the weather in Paris. I'll use the get_weather tool.\", \"signature\": \"ErkCCosBCA8YAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDNiOTNhNWRkLTczMDItNDgzZi1hZWFlLTM2MjA3NTU0OGFlMRIMM48xcuzdqvMYIVj0GgzNLyWlqYpowmh/ekwiMNJ+av0MqXkfQP9JJBuSQzhxreyzG6b3V4o6WMG4AkUForVcNy8B6FU3LLmarZghWCpbMd005YC11uuZgsB10K00Rc2RYIfbL13mm3KLNj/iImbEkB6E/7OqxcbQjG3rM6JJrcmRhQk+wWk26tlenw/upR99KkrILrAv22RFK5sxzqOkdWz8t4qzVPKfVxgB\", \"format\": \"anthropic-claude-v1\", \"index\": 0}]}, {\"role\": \"tool\", \"tool_call_id\": \"toolu_01KBCTV7MS4TY6U2zSTF2K2n\", \"content\": \"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}], \"tools\": [{\"type\": \"function\", \"function\": {\"name\": \"get_weather\", \"description\": \"Get current weather for a city.\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}}, \"required\": [\"city\"], \"additionalProperties\": false}, \"strict\": false}}], \"stream\": true, \"stream_options\": {\"include_usage\": true}, \"max_tokens\": 1536, \"reasoning\": {\"enabled\": true, \"max_tokens\": 1024}}"
"body": "{\"model\": \"anthropic/claude-sonnet-4.6\", \"messages\": [{\"role\": \"system\", \"content\": \"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}, {\"role\": \"user\", \"content\": \"What is the weather in Paris?\"}, {\"role\": \"assistant\", \"content\": \"Sure! Let me check the weather in Paris for you!\", \"tool_calls\": [{\"id\": \"toolu_01KBCTV7MS4TY6U2zSTF2K2n\", \"type\": \"function\", \"function\": {\"name\": \"get_weather\", \"arguments\": \"{\\\"city\\\":\\\"Paris\\\"}\"}}], \"reasoning\": \"The user wants to know the weather in Paris. I'll use the get_weather tool.\", \"reasoning_details\": [{\"type\": \"reasoning.text\", \"text\": \"The user wants to know the weather in Paris. I'll use the get_weather tool.\", \"signature\": \"ErkCCosBCA8YAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDNiOTNhNWRkLTczMDItNDgzZi1hZWFlLTM2MjA3NTU0OGFlMRIMM48xcuzdqvMYIVj0GgzNLyWlqYpowmh/ekwiMNJ+av0MqXkfQP9JJBuSQzhxreyzG6b3V4o6WMG4AkUForVcNy8B6FU3LLmarZghWCpbMd005YC11uuZgsB10K00Rc2RYIfbL13mm3KLNj/iImbEkB6E/7OqxcbQjG3rM6JJrcmRhQk+wWk26tlenw/upR99KkrILrAv22RFK5sxzqOkdWz8t4qzVPKfVxgB\", \"format\": \"anthropic-claude-v1\", \"index\": 0}]}, {\"role\": \"tool\", \"tool_call_id\": \"toolu_01KBCTV7MS4TY6U2zSTF2K2n\", \"content\": \"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}], \"tools\": [{\"type\": \"function\", \"function\": {\"name\": \"get_weather\", \"description\": \"Get current weather for a city.\", \"parameters\": {\"type\": \"object\", \"properties\": {\"city\": {\"type\": \"string\"}}, \"required\": [\"city\"], \"additionalProperties\": false}, \"strict\": false}}], \"stream\": true, \"stream_options\": {\"include_usage\": true}, \"reasoning\": {\"enabled\": true, \"max_tokens\": 1024}, \"max_completion_tokens\": 1536}"
"body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Think through the arithmetic, then reply with only the final integer.\"},{\"role\":\"user\",\"content\":\"What is 173 multiplied by 219?\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_tokens\":1536,\"temperature\":0,\"reasoning\":{\"enabled\":true,\"max_tokens\":1024}}"
"body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Think through the arithmetic, then reply with only the final integer.\"},{\"role\":\"user\",\"content\":\"What is 173 multiplied by 219?\"}],\"stream\":true,\"stream_options\":{\"include_usage\":true}, \"temperature\": 0, \"reasoning\":{\"enabled\":true,\"max_tokens\":1024}, \"max_completion_tokens\": 1536}"
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.