Structured-output schema support for the output_schema request field
Use output_schema when you want TinyFish to return the final run result in a predictable JSON shape.The same rules apply across the REST API, SDKs, CLI, Playground, and MCP integrations as they all forward to the same API validator.
output_schema defines the exact shape of the result. When your schema and your prompt
disagree about whether to return a single object or a list, the schema wins — the
result is shaped to match the schema, not the wording of the prompt.A schema that describes a single object returns a single object, even if the prompt asks
for “10 results”. To return a list, the schema must say so explicitly (see below).
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"TinyFish Web Agent","colors":{"primary":"#D74B28","light":"#D74B28","dark":"#D74B28"},"logo":{"light":"https://mintcdn.com/tinyfish/SAWuKzAHuR-ZMRAB/logo/TF_Horizontal.svg?fit=max\u0026auto=format\u0026n=SAWuKzAHuR-ZMRAB\u0026q=85\u0026s=3ff7a57ebbe744005f4f984e986f16b9","dark":"https://mintcdn.com/tinyfish/VrMSbq950IKhOmzd/logo/dark.svg?fit=max\u0026auto=format\u0026n=VrMSbq950IKhOmzd\u0026q=85\u0026s=78303ae67f6f601a47cdfd79f978f941","href":"https://agent.tinyfish.ai"},"favicon":"https://mintcdn.com/tinyfish/SAWuKzAHuR-ZMRAB/logo/TF_ICON.svg?fit=max\u0026auto=format\u0026n=SAWuKzAHuR-ZMRAB\u0026q=85\u0026s=9151d20cf17b84686c03e299a8997a32","navbar":{"primary":{"type":"button","label":"Get API Key","href":"https://agent.tinyfish.ai/api-keys"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/tinyfish-ai","x":"https://x.com/Tiny_Fish","discord":"https://discord.gg/tinyfish","youtube":"https://www.youtube.com/@TinyFish-AI"}},"integrations":{"ga4":{"measurementId":"G-P52K96QP6R"},"posthog":{"apiKey":"phc_NJaHVgJntoRghYPq3Q92cniMBBbLRh4cE2S5xX1XVyL"}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tinyfish","hasAudioNarration":false,"actualSubdomain":"tinyfish","customDomains":["docs.tinyfish.ai"],"gitSource":{"type":"github","owner":"tinyfish-io","repo":"ux-labs","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adc0ebdbfa14b4ae8dcc153","collectionId":"140f5da7-47b9-4bbd-adcf-5eceb15bcd35","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adc0ebdbfa14b4ae8dcc153"},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6adc0ebdbfa14b4ae8dcc153","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"default","tag":"API Reference","count":66},{"language":"default","tag":"Documentation","count":50},{"language":"default","tag":"Agent \u0026 Runs","count":28},{"language":"default","tag":"Browser Context Profiles","count":10},{"language":"default","tag":"Agent API","count":8},{"language":"default","tag":"Monitor","count":8},{"language":"default","tag":"Tools \u0026 Integrations","count":7},{"language":"default","tag":"Capabilities","count":7},{"language":"default","tag":"Runs","count":7},{"language":"default","tag":"Research","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","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":"editor-v7-file-tree","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":"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":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"key-concepts/structured-output","slug":"/key-concepts/structured-output","pageMetadata":{"title":"Structured Output","sidebarTitle":"Structured Output","description":"Structured-output schema support for the output_schema request field","href":"/key-concepts/structured-output"},"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: \"Structured-output schema support for the output_schema request field\"\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`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`output_schema`}),` when you want TinyFish to return the final run result in a predictable JSON shape.`]}),`\n`,_jsx(_components.p,{children:`The same rules apply across the REST API, SDKs, CLI, Playground, and MCP integrations as they all forward to the same API validator.`}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`21`,children:[_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:` \"output_schema\"`}),_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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`}),_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:` \"properties\"`}),_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:` \"title\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_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:` \"price\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"number\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"minimum\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_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:` \"published_at\"`}),_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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_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:` \"format\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"date-time\"`}),_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:` \"nullable\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\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:` \"tags\"`}),_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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"array\"`}),_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:` \"items\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_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:` \"maxItems\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`})]}),`\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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"required\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"title\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"price\"`}),_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:` \"propertyOrdering\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"title\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"price\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"published_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tags\"`}),_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`,_jsx(Heading,{level:`2`,id:`the-schema-is-the-contract`,children:`The Schema Is the Contract`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`output_schema`}),` defines the exact shape of the result. When your schema and your prompt\ndisagree about whether to return a single object or a list, `,_jsx(_components.strong,{children:`the schema wins`}),` — the\nresult is shaped to match the schema, not the wording of the prompt.`]}),`\n`,_jsx(_components.p,{children:`A schema that describes a single object returns a single object, even if the prompt asks\nfor “10 results”. To return a list, the schema must say so explicitly (see below).`}),`\n`,_jsx(Heading,{level:`2`,id:`returning-a-list-of-items`,children:`Returning a List of Items`}),`\n`,_jsx(_components.p,{children:`The top level must always be an object, so a list of results goes in an array field:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`19`,children:[_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:` \"output_schema\"`}),_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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`}),_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:` \"properties\"`}),_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:` \"results\"`}),_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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"array\"`}),_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:` \"items\"`}),_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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`}),_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:` \"properties\"`}),_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:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_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:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_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:` \"required\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"url\"`}),_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`,_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:` \"required\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"results\"`}),_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`,_jsx(_components.p,{children:`Without the array field, a prompt like “list 10 tools” returns only the first match,\nbecause the schema describes a single object.`}),`\n`,_jsx(Heading,{level:`2`,id:`top-level-constraints`,children:`Top-Level Constraints`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Constraint`}),_jsx(_components.th,{children:`Rule`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Top-level shape`}),_jsxs(_components.td,{children:[`Must be a JSON object. If `,_jsx(_components.code,{children:`type`}),` is present, it must be `,_jsx(_components.code,{children:`object`})]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Top-level `,_jsx(_components.code,{children:`anyOf`})]}),_jsx(_components.td,{children:`Not supported. Put composition inside object fields instead`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Size limit`}),_jsx(_components.td,{children:`Serialized schema must be 64KB or smaller`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Nesting depth`}),_jsx(_components.td,{children:`Maximum depth is 10`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Boolean schema nodes`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),` and `,_jsx(_components.code,{children:`false`}),` schemas are not supported`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Nullable values`}),_jsxs(_components.td,{children:[`Use `,_jsx(_components.code,{children:`nullable: true`}),`, not `,_jsx(_components.code,{children:`type: [\"string\", \"null\"]`})]})]})]})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`type: \"boolean\"`}),` is supported for fields in your result. What is not supported is using a schema node that is itself\nthe literal boolean `,_jsx(_components.code,{children:`true`}),` or `,_jsx(_components.code,{children:`false`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`supported-types`,children:`Supported Types`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`object`})}),_jsxs(_components.td,{children:[`Supports `,_jsx(_components.code,{children:`properties`}),`, `,_jsx(_components.code,{children:`required`}),`, and `,_jsx(_components.code,{children:`propertyOrdering`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`array`})}),_jsxs(_components.td,{children:[`Supports `,_jsx(_components.code,{children:`items`}),`, `,_jsx(_components.code,{children:`minItems`}),`, and `,_jsx(_components.code,{children:`maxItems`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsxs(_components.td,{children:[`Supports `,_jsx(_components.code,{children:`enum`}),` and `,_jsx(_components.code,{children:`format`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsxs(_components.td,{children:[`Supports `,_jsx(_components.code,{children:`minimum`}),` and `,_jsx(_components.code,{children:`maximum`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`integer`})}),_jsxs(_components.td,{children:[`Supports `,_jsx(_components.code,{children:`minimum`}),` and `,_jsx(_components.code,{children:`maximum`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`boolean`})}),_jsx(_components.td,{children:`Supported as a field type`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-keywords`,children:`Supported Keywords`}),`\n`,_jsx(_components.p,{children:`Any keyword outside this allowlist is rejected:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`anyOf`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`enum`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`format`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`items`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`maxItems`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`maximum`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`minItems`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`minimum`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`nullable`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`properties`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`propertyOrdering`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`required`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`type`})}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`important-rules`,children:`Important Rules`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Use `,_jsx(_components.code,{children:`anyOf`}),` for composition. `,_jsx(_components.code,{children:`oneOf`}),` is not supported.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`enum`}),` requires `,_jsx(_components.code,{children:`type: \"string\"`}),`, and every enum value must be a string.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`format`}),` requires `,_jsx(_components.code,{children:`type: \"string\"`}),`. Supported formats are `,_jsx(_components.code,{children:`date`}),`, `,_jsx(_components.code,{children:`date-time`}),`, `,_jsx(_components.code,{children:`duration`}),`, and `,_jsx(_components.code,{children:`time`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`items`}),`, `,_jsx(_components.code,{children:`minItems`}),`, and `,_jsx(_components.code,{children:`maxItems`}),` require `,_jsx(_components.code,{children:`type: \"array\"`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`minimum`}),` and `,_jsx(_components.code,{children:`maximum`}),` require `,_jsx(_components.code,{children:`type: \"number\"`}),` or `,_jsx(_components.code,{children:`type: \"integer\"`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`propertyOrdering`}),` requires `,_jsx(_components.code,{children:`properties`}),`, values must be unique, and every referenced field must exist in\n`,_jsx(_components.code,{children:`properties`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`required`}),` fields must also exist in `,_jsx(_components.code,{children:`properties`}),`, unless the requirement is being expressed inside an `,_jsx(_components.code,{children:`anyOf`}),` branch.`]}),`\n`,_jsxs(_components.li,{children:[`Stored runs include the requested schema as `,_jsx(_components.code,{children:`output_schema`}),` on `,_jsx(_components.code,{children:`GET /v1/runs/{id}`}),` and `,_jsx(_components.code,{children:`runs.list()`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`common-rewrites`,children:`Common Rewrites`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Instead of`}),_jsx(_components.th,{children:`Use`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`oneOf`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`anyOf`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`const: \"ready\"`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`type: \"string\", enum: [\"ready\"]`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`type: [\"string\", \"null\"]`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`type: \"string\", nullable: true`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`type: [\"number\", \"null\"]`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`type: \"number\", nullable: true`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`type: [\"integer\", \"null\"]`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`type: \"integer\", nullable: true`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`commonly-rejected-keywords`,children:`Commonly Rejected Keywords`}),`\n`,_jsxs(_components.p,{children:[`These are not supported in `,_jsx(_components.code,{children:`output_schema`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`additionalProperties`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`const`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`example`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`examples`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`oneOf`})}),`\n`]}),`\n`,_jsx(_components.p,{children:`Any other keyword outside the supported allowlist is also rejected.`}),`\n`,_jsx(Heading,{level:`2`,id:`example-errors`,children:`Example Errors`}),`\n`,_jsxs(_components.p,{children:[`The API returns a `,_jsx(_components.code,{children:`400`}),` error before execution when the schema is invalid. Common validation messages include:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`output_schema field \"oneOf\" is not supported at #. Use \"anyOf\" instead.`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`output_schema top-level \"anyOf\" is not supported at #. Top-level schema must declare \"type\": \"object\".`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`output_schema type arrays are not supported at #/properties/title. Use 'type: \"string\", nullable: true' instead.`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`output_schema field \"additionalProperties\" is not supported at #.`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`output_schema exceeds the maximum nesting depth of 10.`})}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/agent-api/reference`,children:`Agent API Reference`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/quick-start`,children:`Quick Start`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/cli/commands`,children:`CLI Commands`})}),`\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":"Structured Output","sidebarTitle":"Structured Output","description":"Structured-output schema support for the output_schema request field","href":"/key-concepts/structured-output"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Example","slug":"example","depth":2,"children":[]},{"title":"The Schema Is the Contract","slug":"the-schema-is-the-contract","depth":2,"children":[]},{"title":"Returning a List of Items","slug":"returning-a-list-of-items","depth":2,"children":[]},{"title":"Top-Level Constraints","slug":"top-level-constraints","depth":2,"children":[]},{"title":"Supported Types","slug":"supported-types","depth":2,"children":[]},{"title":"Supported Keywords","slug":"supported-keywords","depth":2,"children":[]},{"title":"Important Rules","slug":"important-rules","depth":2,"children":[]},{"title":"Common Rewrites","slug":"common-rewrites","depth":2,"children":[]},{"title":"Commonly Rejected Keywords","slug":"commonly-rejected-keywords","depth":2,"children":[]},{"title":"Example Errors","slug":"example-errors","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"tinyfish","siteName":"TinyFish Web Agent","title":"Structured Output - TinyFish Web Agent","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-22T21:45:53.339Z","originalFileLocation":"key-concepts/structured-output.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;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=\"system\"}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=\"Structured-output schema support for the output_schema request field\">\u003cmeta data-mint-head name=\"application-name\" content=\"TinyFish Web Agent\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Structured Output - TinyFish Web Agent\">\u003cmeta data-mint-head property=\"og:description\" content=\"Structured-output schema support for the output_schema request field\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"TinyFish Web Agent\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.tinyfish.ai/key-concepts/structured-output\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://tinyfish.mintlify.app/_mintlify/api/og/v2?division=Agent+API\u0026amp;title=Structured+Output\u0026amp;description=Structured-output+schema+support+for+the+output_schema+request+field\u0026amp;theme=619f6727a66ef17f9efad127\u0026amp;signature=3d31e677ebf41c7a30986d6b6579aa4b874e58858776fd64251e36b797abf28a\">\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=\"Structured Output - TinyFish Web Agent\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Structured-output schema support for the output_schema request field\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tinyfish.mintlify.app/_mintlify/api/og/v2?division=Agent+API\u0026amp;title=Structured+Output\u0026amp;description=Structured-output+schema+support+for+the+output_schema+request+field\u0026amp;theme=619f6727a66ef17f9efad127\u0026amp;signature=3d31e677ebf41c7a30986d6b6579aa4b874e58858776fd64251e36b797abf28a\">\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=\"/mintlify-assets/_mintlify/favicons/tinyfish/05k5zsm6ySkMI6wO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"TinyFish Web Agent\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#D74B28\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.tinyfish.ai/key-concepts/structured-output\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/key-concepts/structured-output.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.tinyfish.ai/#organization\",\"name\":\"TinyFish Web Agent\",\"url\":\"https://docs.tinyfish.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tinyfish/SAWuKzAHuR-ZMRAB/logo/TF_Horizontal.svg?fit=max\u0026auto=format\u0026n=SAWuKzAHuR-ZMRAB\u0026q=85\u0026s=3ff7a57ebbe744005f4f984e986f16b9\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.tinyfish.ai#website\",\"name\":\"TinyFish Web Agent\",\"url\":\"https://docs.tinyfish.ai\",\"publisher\":{\"@id\":\"https://docs.tinyfish.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.tinyfish.ai/key-concepts/structured-output#webpage\",\"url\":\"https://docs.tinyfish.ai/key-concepts/structured-output\",\"name\":\"Structured Output\",\"description\":\"Structured-output schema support for the output_schema request field\",\"dateModified\":\"2026-06-22T21:45:53.339Z\",\"isPartOf\":{\"@id\":\"https://docs.tinyfish.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.tinyfish.ai/key-concepts/structured-output#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.tinyfish.ai/key-concepts/structured-output#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Agent API\",\"item\":\"https://docs.tinyfish.ai/agent-api/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Structured Output\",\"item\":\"https://docs.tinyfish.ai/key-concepts/structured-output\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.tinyfish.ai/key-concepts/structured-output#article\",\"headline\":\"Structured Output\",\"name\":\"Structured Output\",\"description\":\"Structured-output schema support for the output_schema request field\",\"url\":\"https://docs.tinyfish.ai/key-concepts/structured-output\",\"mainEntityOfPage\":{\"@id\":\"https://docs.tinyfish.ai/key-concepts/structured-output#webpage\"},\"dateModified\":\"2026-06-22T21:45:53.339Z\",\"publisher\":{\"@id\":\"https://docs.tinyfish.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.tinyfish.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"TinyFish Web Agent\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"TinyFish Web Agent","nav":{"global":null,"tabs":[{"tab":"Documentation","icon":"book-open","groups":[{"group":"Start Here","icon":"rocket","pages":[{"title":"TinyFish Developer Documentation","sidebarTitle":"Overview","href":""},{"title":"Quick Start","sidebarTitle":"Quickstart","mode":"wide","href":"/quick-start"},{"title":"Authentication","sidebarTitle":"Authentication","href":"/authentication"},{"title":"For Coding Agents","sidebarTitle":"For coding agents","href":"/for-coding-agents"}]},{"group":"Agent API","icon":"sparkles","pages":[{"title":"Agent API","sidebarTitle":"Overview","href":"/agent-api/index"},{"title":"Agent API Reference","sidebarTitle":"Reference","href":"/agent-api/reference"},{"title":"Browser Context Profiles API","sidebarTitle":"Browser Context Profiles","href":"/agent-api/browser-context-profiles"},{"title":"Agent Endpoints","href":"/key-concepts/endpoints"},{"title":"Runs","href":"/key-concepts/runs"},{"title":"The Goal Parameter","description":"Natural language instructions that tell TinyFish Web Agent what to do","href":"/key-concepts/goals"},{"title":"Structured Output","sidebarTitle":"Structured Output","href":"/key-concepts/structured-output"},{"title":"Goal Prompting Guide","description":"Write goals that make TinyFish Web Agent work like magic","href":"/prompting-guide"}]},{"group":"Search API","icon":"magnifying-glass","pages":[{"title":"Search API","sidebarTitle":"Overview","href":"/search-api/index"},{"title":"Search API Reference","sidebarTitle":"Reference","href":"/search-api/reference"},{"title":"Search Examples","sidebarTitle":"Examples","href":"/search-api/examples"}]},{"group":"Monitor","icon":"eye","pages":[{"title":"Monitor","sidebarTitle":"Overview","href":"/monitor/index"},{"title":"Monitor API Reference","sidebarTitle":"API Reference","href":"/monitor/api-reference"}]},{"group":"Fetch API","icon":"bolt","pages":[{"title":"Fetch API","sidebarTitle":"Overview","href":"/fetch-api/index"},{"title":"Fetch API Reference","sidebarTitle":"Reference","href":"/fetch-api/reference"},{"title":"Fetch Examples","sidebarTitle":"Examples","href":"/fetch-api/examples"}]},{"group":"Browser API","icon":"browser","pages":[{"title":"Browser API","sidebarTitle":"Overview","href":"/browser-api/index"},{"title":"Browser API Reference","sidebarTitle":"Reference","href":"/browser-api/reference"},{"title":"Browser Examples","sidebarTitle":"Examples","href":"/browser-api/examples"}]},{"group":"Research API","icon":"telescope","pages":[{"title":"Research API","sidebarTitle":"Overview","href":"/research-api/index"},{"title":"Research API Reference","sidebarTitle":"Reference","href":"/research-api/reference"},{"title":"Research Examples","sidebarTitle":"Examples","href":"/research-api/examples"}]},{"group":"Capabilities","icon":"wand-magic-sparkles","pages":[{"group":"Vault \u0026 Credentials","icon":"lock","pages":[{"title":"Connect Your Vault","href":"/vault-setup"},{"title":"Vault Credentials","href":"/key-concepts/credentials"}]},{"title":"Browser Context Profiles","sidebarTitle":"Browser Context Profiles","href":"/key-concepts/browser-context-profiles"},{"title":"Browser Profiles","href":"/key-concepts/browser-profiles"},{"title":"Proxies","href":"/key-concepts/proxies"},{"title":"Organizations","href":"/key-concepts/organizations"},{"title":"Live Browser Preview","href":"/live-preview"}]},{"group":"Tools \u0026 Integrations","icon":"puzzle-piece","pages":[{"title":"Build with AI","sidebarTitle":"Build with AI","href":"/using-with-ai"},{"title":"Plugins","href":"/plugins/index"},{"title":"CLI","href":"/cli/index"},{"title":"CLI Commands","href":"/cli/commands"},{"title":"MCP Integration","href":"/mcp-integration/index"},{"title":"n8n","icon":"share-nodes","href":"/integrations/n8n"},{"title":"Dify","icon":"wand-magic-sparkles","href":"/integrations/dify"}]},{"group":"Guides","icon":"book","pages":[{"title":"Common Patterns","href":"/common-patterns"},{"title":"Anti-Bot Guide","href":"/anti-bot-guide"},{"title":"Webhooks","href":"/webhooks"},{"title":"Agent Payments","sidebarTitle":"Agent Payments","href":"/agent-payments"}]},{"group":"Use Cases","icon":"code","pages":[{"title":"Web Scraping","href":"/examples/scraping"},{"title":"Form Filling","href":"/examples/form-filling"},{"title":"Concurrent Requests","href":"/examples/bulk-requests-sync"},{"title":"Async Bulk Requests","href":"/examples/bulk-requests-async"}]},{"group":"Reference","icon":"circle-question","pages":[{"title":"Error Codes","href":"/error-codes"},{"title":"Frequently Asked Questions","href":"/faq"}]}]},{"tab":"API Reference","icon":"code","pages":[{"title":"API Reference","href":"/api-reference/automation/run-browser-automation-with-sse-streaming"}]},{"tab":"Cookbook","icon":"utensils","href":"https://github.com/tinyfish-io/tinyfish-cookbook"}]},"title":"Structured Output - TinyFish Web Agent","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":[],"chunks":[]}