Skip to content

Commit 2cee073

Browse files
Merge pull request #6203 from mrbullwinkle/mrb_07_25_2025_token_issue
[Azure OpenAI] GPT 4.1 Tool definition > 300 K Tokens issue
2 parents d46c46e + a019672 commit 2cee073

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

articles/ai-foundry/openai/concepts/models.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn about the different model capabilities that are available wit
55
author: mrbullwinkle #ChrisHMSFT
66
ms.author: mbullwin #chrhoder#
77
manager: nitinme
8-
ms.date: 06/25/2025
8+
ms.date: 07/24/2025
99
ms.service: azure-ai-openai
1010
ms.topic: conceptual
1111
ms.custom:
@@ -46,6 +46,21 @@ Azure OpenAI is powered by a diverse set of models with different capabilities a
4646

4747
### Capabilities
4848

49+
> [!IMPORTANT]
50+
> There is a known issue impacting all GPT 4.1 series models where large tool/function call definitions exceeding 300,000 tokens will result in failures even though the 1 million token context limit of the models has not been reached.
51+
>
52+
> The errors can vary based on API call as well as underlying payload characteristics.
53+
>
54+
> **Chat Completions API error messages**:
55+
>
56+
> - `Error code: 400 - {'error': {'message': "This model's maximum context length is 300000 tokens. However, your messages resulted in 350564 tokens (100 in the messages, 350464 in the functions). Please reduce the length of the messages or functions.", 'type': 'invalid_request_error', 'param': 'messages', 'code': 'context_length_exceeded'}}`
57+
>
58+
> - `Error code: 400 - {'error': {'message': "Invalid 'tools[0].function.description': string too long. Expected a string with maximum length 1048576, but got a string with length 2778531 instead.", 'type': 'invalid_request_error', 'param': 'tools[0].function.description', 'code': 'string_above_max_length'}}`
59+
>
60+
> **Responses API error message:**
61+
>
62+
> - `Error code: 500 - {'error': {'message': 'The server had an error processing your request. Sorry about that! You can retry your request, or contact us through an Azure support request at: https://go.microsoft.com/fwlink/?linkid=2213926 if you keep seeing this error. (Please include the request ID d2008353-291d-428f-adc1-defb5d9fb109 in your email.)', 'type': 'server_error', 'param': None, 'code': None}}`
63+
4964
| Model ID | Description | Context Window | Max Output Tokens | Training Data (up to) |
5065
| --- | :--- |:--- |:---|:---: |
5166
| `gpt-4.1` (2025-04-14) | - Text & image input <br> - Text output <br> - Chat completions API <br>- Responses API <br> - Streaming <br> - Function calling <br> Structured outputs (chat completions) | - 1,047,576 <br> - 128,000 (provisioned managed deployments) <br> - 300,000 (batch deployments) | 32,768 | May 31, 2024 |

0 commit comments

Comments
 (0)