A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
Hi Billy Zhou & thx for join me at Q&A platform,
an interesting reproduction, and the 10-character difference between a successful request and HTTP 422 makes it particularly useful for investigating the limit. I agree that the reported usage.input_tokens doesn't explain the rejection. Your successful request reports 16,354 input tokens, which is roughly half the advertised 32,768-token context window.
One possibility worth investigating is that the endpoint's request validation and its reported token usage aren't using exactly the same counting method. There's a numerical clue here. Your 130,040 repeated characters correspond to approximately 32,510 tokens if a conservative four-characters-per-token estimate is being used. That's very close to the 32,768 limit once the fixed question instructions, criteria, and internal formatting are included.
Meanwhile, the successful response reports around 16,354 actual input tokens. That could indicate a difference between an estimated pre-validation token count and the tokenizer used for execution or usage reporting. However, this is a hypothesis, not confirmed Microsoft-Decision-1 behavior. Another possibility is that the service constructs an expanded internal question prompt or reserves additional context that isn't reflected in usage.input_tokens.
The error's reference to the decision token doesn't, by itself, explain a difference of approximately 16,000 tokens.
I'd suggest two targeted comparisons before escalating further. First, keep the total character count approximately the same but replace the repeated A characters with ordinary natural-language text or less repetitive content. If the failure threshold stays near the same character count while reported token usage changes substantially, that would support the possibility of a character-based or estimated-token validation limit.
Second, keep the same repeated text but move it from questions.parity.instructions into state, leaving the question instructions short. If the acceptance threshold changes significantly, that would suggest the endpoint applies additional processing or limits specifically to question prompts.
Neither test requires changing the deployment or region. The public Microsoft-Decision-1 documentation describes the Decision API and its token usage response, but I couldn't find a documented explanation of how the 32,768-token validation limit relates to internal prompt construction or usage.input_tokens.
I'd raise this with Microsoft Foundry model support and include the three exact payloads, deployment and model version, UTC timestamps, and request IDs. The specific engineering question should be whether context validation uses a different tokenizer or token estimate from usage accounting, and whether additional internal tokens are included in the context limit but excluded from the reported input usage.
Until Microsoft confirms the implementation, I wouldn't assume that usage.input_tokens can be used to predict the maximum accepted request size for this model.
Ur test provides a good, reproducible case for either clarifying the documented limit or identifying an inconsistency in the endpoint's validation logic.
rgds,
Alex
p.s. if my answer is help - pls mark it as an answer