Set global and per-model context and output token limits that apply to every Cake Agents session in your organization.
Token limits cap the context window and output size, in tokens, that sessions use for each model. Administrators set them once, and every new session applies them automatically.Use token limits when you want to:
Constrain context growth to control cost per session.
Keep sessions within the context window a proxy or upstream provider actually supports.
Give specific models a larger or smaller budget than the rest.
When a session starts, Cake resolves the context and output limits for its model in this order:
A per-session override, if the user set one when creating the session. Admins can always set one. Other users can only set one when non-admin overrides are on.
A per-model override from the Token Limits settings.
The global limit from the Token Limits settings.
If none of these are set, the model runs without a configured limit. Cake passes the resolved values into the OpenCode model configuration as limit.context and limit.output.
A context limit is a spend control, so by default only administrators can override token limits for a single session. To let every user in your organization set per-session limits:
Open Settings → Organization → Providers and scroll to the Token Limits section.
Turn on Allow non-admin overrides. Cake saves the change immediately.
When the switch is off, users who are not admins don’t see the token limits control on the New Session page. If they pass a limits.context value to POST /api/sessions, Cake rejects the request with 403 Forbidden.
Limits are integers between 1 and 10,000,000 tokens.
If you set a context limit, you must also set an output limit.
A global limit must be defined before you can add per-model overrides.
Each model can have at most one override. An override can set context, output, or both; any value it omits falls back to the global limit.
Setting a context limit that exceeds what a model can actually handle can result in unpredictable behavior. Check the model’s documented context window before raising limits.
GET /api/settings/token-limits returns the current setting in the same shape. PUT replaces the whole setting and returns 400 with a validation message if any value is invalid, a model ID is unknown, or a model appears twice.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Cake Docs","colors":{"primary":"#2d8f39","light":"#a5ffb1","dark":"#0f711b"},"logo":"https://www.cake.ai/hubfs/Logos/cake-logo-dark.svg","favicon":"https://www.cake.ai/hubfs/favicon.png","appearance":{"default":"light","strict":true},"fonts":{"heading":{"family":"ABC Monument Grotesk","weight":500,"source":"https://www.cake.ai/hubfs/ABCMonumentGrotesk-Medium.woff","format":"woff"},"body":{"family":"Inter"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cake-57b50798","hasAudioNarration":false,"actualSubdomain":"cake-57b50798","customDomains":["docs.cake.ai"],"gitSource":{"type":"github","owner":"kflow-ai","repo":"public-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"agentFeedback":false,"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af1c47fe7b89d498acc1947","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"Agents","count":32},{"language":"default","tag":"Users","count":17},{"language":"default","tag":"Administration","count":11},{"language":"default","tag":"Getting Started","count":2},{"language":"default","tag":"Overview","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"admin/token-limits","slug":"/admin/token-limits","pageMetadata":{"title":"Configure token limits","description":"Set global and per-model context and output token limits that apply to every Cake Agents session in your organization.","href":"/admin/token-limits"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Set global and per-model context and output token limits that apply to every Cake Agents session in your organization.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Token limits cap the context window and output size, in tokens, that sessions use for each model. Administrators set them once, and every new session applies them automatically.`}),`\n`,_jsx(_components.p,{children:`Use token limits when you want to:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Constrain context growth to control cost per session.`}),`\n`,_jsx(_components.li,{children:`Keep sessions within the context window a proxy or upstream provider actually supports.`}),`\n`,_jsx(_components.li,{children:`Give specific models a larger or smaller budget than the rest.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-limits-are-resolved`,children:`How limits are resolved`}),`\n`,_jsx(_components.p,{children:`When a session starts, Cake resolves the context and output limits for its model in this order:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`A per-session override, if the user set one when creating the session. Admins can always set one. Other users can only set one when `,_jsx(_components.a,{href:`#allow-non-admin-overrides`,children:`non-admin overrides`}),` are on.`]}),`\n`,_jsx(_components.li,{children:`A per-model override from the Token Limits settings.`}),`\n`,_jsx(_components.li,{children:`The global limit from the Token Limits settings.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`If none of these are set, the model runs without a configured limit. Cake passes the resolved values into the OpenCode model configuration as `,_jsx(_components.code,{children:`limit.context`}),` and `,_jsx(_components.code,{children:`limit.output`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`set-limits-in-the-ui`,children:`Set limits in the UI`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Sign in to Cake Agents as an administrator.`}),`\n`,_jsxs(_components.li,{children:[`Open `,_jsx(_components.code,{children:`Settings → Organization → Providers`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Scroll to the `,_jsx(_components.code,{children:`Token Limits`}),` section.`]}),`\n`,_jsxs(_components.li,{children:[`Enter a global `,_jsx(_components.code,{children:`Context Limit`}),` and `,_jsx(_components.code,{children:`Output Limit`}),`.`]}),`\n`,_jsx(_components.li,{children:`Optionally add per-model overrides for models that need different values.`}),`\n`,_jsx(_components.li,{children:`Save the settings.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`allow-non-admin-overrides`,children:`Allow non-admin overrides`}),`\n`,_jsx(_components.p,{children:`A context limit is a spend control, so by default only administrators can override token limits for a single session. To let every user in your organization set per-session limits:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Open `,_jsx(_components.code,{children:`Settings → Organization → Providers`}),` and scroll to the `,_jsx(_components.code,{children:`Token Limits`}),` section.`]}),`\n`,_jsxs(_components.li,{children:[`Turn on `,_jsx(_components.strong,{children:`Allow non-admin overrides`}),`. Cake saves the change immediately.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`When the switch is off, users who are not admins don’t see the token limits control on the New Session page. If they pass a `,_jsx(_components.code,{children:`limits.context`}),` value to `,_jsx(_components.code,{children:`POST /api/sessions`}),`, Cake rejects the request with `,_jsx(_components.code,{children:`403 Forbidden`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`rules-and-validation`,children:`Rules and validation`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Limits are integers between 1 and 10,000,000 tokens.`}),`\n`,_jsx(_components.li,{children:`If you set a context limit, you must also set an output limit.`}),`\n`,_jsx(_components.li,{children:`A global limit must be defined before you can add per-model overrides.`}),`\n`,_jsx(_components.li,{children:`Each model can have at most one override. An override can set context, output, or both; any value it omits falls back to the global limit.`}),`\n`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Setting a context limit that exceeds what a model can actually handle can result in unpredictable behavior. Check the model’s documented context window before raising limits.`})}),`\n`,_jsx(Heading,{level:`2`,id:`api`,children:`API`}),`\n`,_jsx(_components.p,{children:`You can read and replace the organization’s token limits programmatically:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`PUT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` /api/settings/token-limits`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Content-Type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` application/json`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"global\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"context\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"output\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`32000`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"models\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"modelId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"anthropic/claude-sonnet-4-6\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"context\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`400000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"output\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`64000`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`GET /api/settings/token-limits`}),` returns the current setting in the same shape. `,_jsx(_components.code,{children:`PUT`}),` replaces the whole setting and returns `,_jsx(_components.code,{children:`400`}),` with a validation message if any value is invalid, a model ID is unknown, or a model appears twice.`]}),`\n`,_jsx(Heading,{level:`2`,id:`related-pages`,children:`Related pages`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/admin/model-providers`,children:`Configure Model Providers`}),` covers the provider and model definitions these limits apply to.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/user/session-token-limits`,children:`Override token limits for a session`}),` covers how users adjust limits for a single session.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Configure token limits","description":"Set global and per-model context and output token limits that apply to every Cake Agents session in your organization.","href":"/admin/token-limits"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How limits are resolved","slug":"how-limits-are-resolved","depth":2,"children":[]},{"title":"Set limits in the UI","slug":"set-limits-in-the-ui","depth":2,"children":[]},{"title":"Allow non-admin overrides","slug":"allow-non-admin-overrides","depth":2,"children":[]},{"title":"Rules and validation","slug":"rules-and-validation","depth":2,"children":[]},{"title":"API","slug":"api","depth":2,"children":[]},{"title":"Related pages","slug":"related-pages","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"cake-57b50798","siteName":"Cake Docs","title":"Configure token limits - Cake Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-09T13:02:59.021Z","originalFileLocation":"admin/token-limits.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Set global and per-model context and output token limits that apply to every Cake Agents session in your organization.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Cake Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://www.cake.ai/hubfs/favicon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://www.cake.ai/hubfs/favicon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://www.cake.ai/hubfs/favicon.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/png\" href=\"https://www.cake.ai/hubfs/favicon.png\">\u003cmeta data-mint-head property=\"og:title\" content=\"Configure token limits - Cake Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Set global and per-model context and output token limits that apply to every Cake Agents session in your organization.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Cake Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.cake.ai/admin/token-limits\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cake-57b50798.mintlify.site/_mintlify/api/og/v2?division=Administration\u0026amp;title=Configure+token+limits\u0026amp;description=Set+global+and+per-model+context+and+output+token+limits+that+apply+to+every+Cake+Agents+session+in+your+organization.\u0026amp;theme=0796e70d664a73c1a70653af\u0026amp;signature=c89c57f413c62be393c8dc2779f082b0a4ca898064c52e960d312e47ca579428\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Configure token limits - Cake Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Set global and per-model context and output token limits that apply to every Cake Agents session in your organization.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cake-57b50798.mintlify.site/_mintlify/api/og/v2?division=Administration\u0026amp;title=Configure+token+limits\u0026amp;description=Set+global+and+per-model+context+and+output+token+limits+that+apply+to+every+Cake+Agents+session+in+your+organization.\u0026amp;theme=0796e70d664a73c1a70653af\u0026amp;signature=c89c57f413c62be393c8dc2779f082b0a4ca898064c52e960d312e47ca579428\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/cake-57b50798/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Cake Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2d8f39\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.cake.ai/admin/token-limits\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/admin/token-limits.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.cake.ai/#organization\",\"name\":\"Cake Docs\",\"url\":\"https://docs.cake.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://www.cake.ai/hubfs/Logos/cake-logo-dark.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.cake.ai#website\",\"name\":\"Cake Docs\",\"url\":\"https://docs.cake.ai\",\"publisher\":{\"@id\":\"https://docs.cake.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.cake.ai/admin/token-limits#webpage\",\"url\":\"https://docs.cake.ai/admin/token-limits\",\"name\":\"Configure token limits\",\"description\":\"Set global and per-model context and output token limits that apply to every Cake Agents session in your organization.\",\"dateModified\":\"2026-11-09T13:02:59.021Z\",\"isPartOf\":{\"@id\":\"https://docs.cake.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.cake.ai/admin/token-limits#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.cake.ai/admin/token-limits#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Administration\",\"item\":\"https://docs.cake.ai/admin/aws-storage\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Configure token limits\",\"item\":\"https://docs.cake.ai/admin/token-limits\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.cake.ai/admin/token-limits#article\",\"headline\":\"Configure token limits\",\"name\":\"Configure token limits\",\"description\":\"Set global and per-model context and output token limits that apply to every Cake Agents session in your organization.\",\"url\":\"https://docs.cake.ai/admin/token-limits\",\"mainEntityOfPage\":{\"@id\":\"https://docs.cake.ai/admin/token-limits#webpage\"},\"dateModified\":\"2026-11-09T13:02:59.021Z\",\"publisher\":{\"@id\":\"https://docs.cake.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.cake.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Cake Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Cake Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/admin/token-limits.md","siteName":"Cake Docs","nav":{"global":null,"tabs":[{"tab":"Agents","groups":[{"group":"Overview","pages":[{"title":"Cake Agents","href":""},{"title":"Core Concepts","href":"/core-concepts"}]},{"group":"Getting Started","pages":[{"title":"Getting Started with the Console","href":"/admin/getting-started-console"},{"title":"Getting Started with Kubernetes","href":"/admin/getting-started-kubernetes"}]},{"group":"Administration","pages":[{"title":"S3 storage for archived sessions","href":"/admin/aws-storage"},{"title":"Set Up GitHub","href":"/admin/github-setup"},{"title":"Impersonate users to troubleshoot their Cake Agents view","href":"/admin/impersonate-users"},{"title":"Set up Jira","href":"/admin/jira-setup"},{"title":"Set up Linear","href":"/admin/linear-setup"},{"title":"Add MCP servers for your organization","href":"/admin/mcp-servers"},{"title":"Configure Model Providers","href":"/admin/model-providers"},{"title":"Session volume autoscaling","href":"/admin/session-volume-autoscaling"},{"title":"Configure the Small Model","description":"Select the lightweight model Cake Agents uses for background tasks like session title generation.","href":"/admin/small-model"},{"title":"Configure token limits","href":"/admin/token-limits"},{"title":"Keep a warm session ready for faster session starts","description":"Turn on the Keep a session warm setting so Cake Agents pre-provisions a spare session in the background and new sessions start faster.","href":"/admin/warm-sessions"}]},{"group":"Users","pages":[{"title":"Archive sessions","href":"/user/archive-sessions"},{"title":"Compact sessions","href":"/user/compact-sessions"},{"title":"Change the conversation font size in Cake Agents","href":"/user/conversation-size"},{"title":"Copy a session transcript","href":"/user/copy-transcript"},{"title":"Set default repositories for new sessions","href":"/user/default-repositories"},{"title":"Set environment variables for Cake agent sessions","href":"/user/environment-variables"},{"title":"Watch CI and GitHub events from Cake sessions","href":"/user/github-webhook-events"},{"title":"Keyboard shortcuts","href":"/user/keyboard-shortcuts"},{"title":"Link GitHub","href":"/user/link-github"},{"title":"Connect your account to MCP servers","href":"/user/mcp-connectors"},{"title":"Private sessions","href":"/user/private-sessions"},{"title":"Guide agents with AGENTS.md repository instructions","href":"/user/repository-instructions"},{"title":"Rename sessions","href":"/user/rename-sessions"},{"title":"Read session status indicators in the Cake Agents sidebar","href":"/user/session-status"},{"title":"Override token limits for a session","href":"/user/session-token-limits"},{"title":"Set Git Author Info","href":"/user/set-git-author-info"},{"title":"Slack thread verbosity","href":"/user/slack-verbosity"}]}]}]},"basePath":"","title":"Configure token limits - Cake Docs","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":[],"chunks":[]}