docs: maxTokens is a model property, not a tool property - #1208
Closed
chiranjeet-vapi wants to merge 1 commit into
Closed
docs: maxTokens is a model property, not a tool property#1208chiranjeet-vapi wants to merge 1 commit into
chiranjeet-vapi wants to merge 1 commit into
Conversation
The custom tools troubleshooting page told readers to set maxTokens on a tool, in three code blocks and the debugging table. The API has no such field: 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. Copying the example back returns 400 Bad Request with "assistant.model.each value in tools.function.property maxTokens should not exist". maxTokens is defined on the model schemas only, 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 in the API. The same section fixes two other copy-paste failures on the page: async is a tool property rather than a function property, and the complete tool configuration template was missing the type, function and server nesting, so it was not a payload the API would accept either. Verified against https://api.vapi.ai/api-json on 2026-09-10. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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: |
Contributor
Author
|
Closing in favour of #1209. This PR reached beyond the reported issue and two of its claims were wrong. I tested them against
The maxTokens finding holds and reproduces verbatim. #1209 carries only that, with the reproduction included. |
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:maxTokensis not a tool field. Checked againsthttps://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.Two further copy-paste failures in the same examples, same class of defect:
asyncas a sibling ofname, which is the function object.asyncis a tool property;nameis a function property. Both examples now show the real nesting.type, nofunctionwrapper and noserver, so it was not a payload the API would accept. It now is.Verification
Every claim above comes from
https://api.vapi.ai/api-jsonfetched 2026-09-10.fern checkvalidates the API definition and is unaffected by an mdx change.🤖 Generated with Claude Code