vercel/ai · error · InvalidResponseDataError

Anthropic batch "${options.batchId}" completed without batch

Error message

Anthropic batch "${options.batchId}" completed without batch output.

What it means

Error "Anthropic batch "${options.batchId}" completed without batch output." thrown in vercel/ai.

Source

Thrown at packages/anthropic/src/anthropic-messages-batch.ts:312

  ): Promise<ReadableStream<BatchV4ItemResult<LanguageModelV4GenerateResult>>> {
    const batch = await this.retrieveBatch(options);

    if (convertAnthropicBatchStatus(batch).status === 'pending') {
      throw new InvalidArgumentError({
        argument: 'batchId',
        message: `Anthropic batch "${options.batchId}" is not complete.`,
      });
    }

    if (batch.archived_at != null) {
      throw new InvalidArgumentError({
        argument: 'batchId',
        message: `Anthropic batch "${options.batchId}" results are no longer available.`,
      });
    }

    if (batch.results_url == null) {
      throw new InvalidResponseDataError({
        data: batch,
        message: `Anthropic batch "${options.batchId}" completed without batch output.`,
      });
    }

    const { value: lines } = await getFromApi({
      url: batch.results_url,
      validateUrl: true,
      credentialedOrigin: this.config.baseURL,
      trustedOrigin: this.config.baseURL,
      headers: await this.getBatchHeaders(options.headers),
      failedResponseHandler: anthropicFailedResponseHandler,
      successfulResponseHandler: createJsonLinesResponseHandler(
        anthropicBatchResultLineSchema,
      ),
      abortSignal: options.abortSignal,
      fetch: this.config.fetch,
    });

View on GitHub (pinned to 69428b1f8b)

When it happens

Trigger: Thrown at packages/anthropic/src/anthropic-messages-batch.ts:312 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/bbccb4074361901d. Report an issue: GitHub.