{"record":{"id":"7ed0056ba0d9dafc","repo":"vercel/ai","slug":"anthropic-message-batches-cannot-decode-the-json-t","errorCode":null,"errorMessage":"Anthropic Message Batches cannot decode the JSON-tool structured-output fallback (request \"${request.id}\") because batch results are retrieved independently of the start call. Use a model that supports native output_format structured outputs.","messagePattern":"Anthropic Message Batches cannot decode the JSON-tool structured-output fallback \\(request \"(.+?)\"\\) because batch results are retrieved independently of the start call\\. Use a model that supports native output_format structured outputs\\.","errorType":"exception","errorClass":"UnsupportedFunctionalityError","httpStatus":null,"severity":"error","filePath":"packages/anthropic/src/anthropic-messages-batch.ts","lineNumber":230,"sourceCode":"        providerOptions: request.options.providerOptions,\n      });\n      if (requestBetas.length > 0) {\n        throw new UnsupportedFunctionalityError({\n          functionality: 'per-request providerOptions.anthropic.anthropicBeta',\n          message:\n            `Anthropic Message Batches do not support per-request betas ` +\n            `(request \"${request.id}\"). Set providerOptions.anthropic.anthropicBeta ` +\n            `on startTextBatch instead.`,\n        });\n      }\n\n      const prepared = await this.getArgs({\n        ...request.options,\n        stream: false,\n        userSuppliedBetas: new Set(explicitBatchBetas),\n      });\n      if (prepared.usesJsonResponseTool) {\n        throw new UnsupportedFunctionalityError({\n          functionality: 'batch responseFormat JSON-tool fallback',\n          message:\n            `Anthropic Message Batches cannot decode the JSON-tool structured-output fallback ` +\n            `(request \"${request.id}\") because batch results are retrieved independently of the start call. ` +\n            `Use a model that supports native output_format structured outputs.`,\n        });\n      }\n      const aliasedProviderTool = request.options.tools?.find(\n        tool =>\n          tool.type === 'provider' &&\n          prepared.toolNameMapping.toProviderToolName(tool.name) !== tool.name,\n      );\n      if (aliasedProviderTool != null) {\n        throw new UnsupportedFunctionalityError({\n          functionality: 'aliased provider tool names in batches',\n          message:\n            `Anthropic Message Batches cannot restore the custom provider-tool name ` +\n            `\"${aliasedProviderTool.name}\" when results are retrieved independently of the start call ` +","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/anthropic/src/anthropic-messages-batch.ts#L212-L248","documentation":"Error \"Anthropic Message Batches cannot decode the JSON-tool structured-output fallback (request \"${request.id}\") because batch results are retrieved independently of the start call. Use a model that supports native output_format structured outputs.\" thrown in vercel/ai.","triggerScenarios":"Thrown at packages/anthropic/src/anthropic-messages-batch.ts:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}