vercel/ai · error · AISDKError

BYTEDANCE_VIDEO_GENERATION_ERROR

BYTEDANCE_VIDEO_GENERATION_ERROR

Error message

No task ID returned from API

What it means

After POSTing a video generation request, doStart reads createResponse.id as the task ID. If the API response has no id, the model cannot poll for status later, so it throws an AISDKError named BYTEDANCE_VIDEO_GENERATION_ERROR. This indicates the API responded but not with the expected creation payload (often an error body that still returned HTTP 200, or a schema change).

Source

Thrown at packages/bytedance/src/bytedance-video-model.ts:370

    const { value: createResponse, responseHeaders } = await postJsonToApi({
      url: `${this.config.baseURL}/contents/generations/tasks`,
      headers: combineHeaders(
        await resolve(this.config.headers),
        options.headers,
      ),
      body,
      failedResponseHandler: byteDanceFailedResponseHandler,
      successfulResponseHandler: createJsonResponseHandler(
        byteDanceTaskResponseSchema,
      ),
      abortSignal: options.abortSignal,
      fetch: this.config.fetch,
    });

    const taskId = createResponse.id;

    if (!taskId) {
      throw new AISDKError({
        name: 'BYTEDANCE_VIDEO_GENERATION_ERROR',
        message: 'No task ID returned from API',
      });
    }

    return {
      operation: { taskId },
      warnings,
      response: {
        timestamp: currentDate,
        modelId: this.modelId,
        headers: responseHeaders,
      },
    };
  }

  async doStatus(
    options: Parameters<NonNullable<VideoModelV4['doStatus']>>[0],

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Log the raw create response (enable fetch debugging or intercept) to see what the API actually returned instead of a task id.
  2. Verify your ARK/ByteDance API key and account quota; auth failures can surface as unexpected payloads.
  3. Confirm the requested model ID is valid for video generation on your account.
  4. Update @ai-sdk/bytedance in case the provider needs to handle a changed API response schema.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await videoModel.doGenerateVideo(request);
} catch (e) {
  if (AISDKError.isInstance(e) && e.name === 'BYTEDANCE_VIDEO_GENERATION_ERROR') {
    // inspect request/response via logging; treat as failed generation
    console.error('Video start failed: no task id returned', e.message);
  }
  throw e;
}

Prevention

When it happens

Trigger: bytedance.video(modelId).doStart(...) where the create-video API response JSON lacks the id field — e.g. auth/quota error payloads, malformed request, or an upstream API response format change.

Common situations: Invalid or expired ByteDance/Volcano API key returning a 200 with an error body; hit rate limits; using an old model ID that the API silently rejects; ByteDance changing the response schema.

Related errors


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