docs: maxTokens is a model property, not a tool property - #1209
Open
chiranjeet-vapi wants to merge 1 commit into
Open
docs: maxTokens is a model property, not a tool property#1209chiranjeet-vapi wants to merge 1 commit into
chiranjeet-vapi wants to merge 1 commit into
Conversation
Lightsage docs evalsWaiting for the staging docs URL before running evals. Lightsage will start the selected PR evals automatically when GitHub reports a successful docs deployment for this PR. This usually happens within 15 minutes. Commit: |
The custom tools troubleshooting page told readers to set maxTokens on a tool, in three code blocks and in the debugging table. The API has no such field, so pasting the page's own example back returns 400: POST https://api.vapi.ai/assistant {"message":["model.each value in tools.function.property maxTokens should not exist"],"error":"Bad Request","statusCode":400} Reproduced 2026-09-10. A report of this arrives with an assistant.model prefix when the payload is nested under an assistant key; a direct POST roots at model. Same validator. Per https://api.vapi.ai/api-json, OpenAIFunction accepts only name, strict, description and parameters, and JsonSchema, used for each property, accepts only type, items, properties, description, pattern, format, required, enum and title. maxTokens is defined on the model schemas alone, with a range of 50 to 10000 and a default of 250, so the token truncation section now points at model.maxTokens and states the real default. The page previously said the default was 100, which is not a value the API has anywhere. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
chiranjeet-vapi
force-pushed
the
docs/maxtokens-is-a-model-property
branch
from
September 10, 2026 03:09
2d39aae to
c5c4729
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
fern/tools/custom-tools-troubleshooting.mdxtells readers to setmaxTokenson a tool, in three code blocks and in the debugging table. A customer followed the "Increase token limits" section and got:Reproduced
Posting the page's own example back to
POST https://api.vapi.ai/assistanton 2026-09-10:Same validator. The report reads
assistant.modelbecause it was nested under an assistant key; a direct POST to/assistantroots atmodel.Why
Checked against
https://api.vapi.ai/api-jsonon 2026-09-10:maxTokensis defined on the model schemas only (OpenAIModel, AnthropicModel, GoogleModel and the rest), withminimum: 50,maximum: 10000and a documented default of 250. The page said the default was 100, which is not a value the API has anywhere.What changed
All in
fern/tools/custom-tools-troubleshooting.mdx. No other page in the repo placesmaxTokensoutsidemodel.model.maxTokens, gives the real range and default, and carries a warning with the verbatim 400 so the error string is searchable."maxTokens": 500removed from the schema validation example and from the complete tool configuration template.model.maxTokens.Not in this PR
The "Complete tool configuration" template is separately broken: pasted as a tool it returns
tools.type must be one of ..., and withtypeadded it returnstools.property name should not exist, becausename,description,strictandparametersbelong inside afunctionwrapper. Left alone here to keep this PR to the reported issue. Happy to raise it separately.🤖 Generated with Claude Code