{"record":{"id":"7360492ea4917cd8","repo":"vercel/ai","slug":"anthropic-batch-request-ids-must-be-unique-duplic","errorCode":null,"errorMessage":"Anthropic batch request IDs must be unique; duplicate ID \"${request.id}\".","messagePattern":"Anthropic batch request IDs must be unique; duplicate ID \"(.+?)\"\\.","errorType":"validation","errorClass":"InvalidArgumentError","httpStatus":null,"severity":"error","filePath":"packages/anthropic/src/anthropic-messages-batch.ts","lineNumber":438,"sourceCode":"\n  return anthropicOptions.anthropicBeta ?? [];\n}\n\nfunction validateRequestIds(requests: ReadonlyArray<AnthropicBatchRequest>) {\n  const ids = new Set<string>();\n\n  for (const request of requests) {\n    if (!anthropicBatchRequestIdPattern.test(request.id)) {\n      throw new InvalidArgumentError({\n        argument: 'requests',\n        message:\n          `Anthropic batch request ID \"${request.id}\" must match ` +\n          '^[A-Za-z0-9_-]{1,64}$.',\n      });\n    }\n\n    if (ids.has(request.id)) {\n      throw new InvalidArgumentError({\n        argument: 'requests',\n        message: `Anthropic batch request IDs must be unique; duplicate ID \"${request.id}\".`,\n      });\n    }\n\n    ids.add(request.id);\n  }\n}\n\nfunction validateAnthropicBatchBody({\n  body,\n  requestId,\n}: {\n  body: Record<string, unknown>;\n  requestId: string;\n}) {\n  if (body.speed != null) {\n    throw new UnsupportedFunctionalityError({","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/anthropic/src/anthropic-messages-batch.ts#L420-L456","documentation":"Error \"Anthropic batch request IDs must be unique; duplicate ID \"${request.id}\".\" thrown in vercel/ai.","triggerScenarios":"Thrown at packages/anthropic/src/anthropic-messages-batch.ts:438 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"}