{"record":{"id":"83d451878e2c3c03","repo":"vercel/ai","slug":"fireworks-image-generation-failed-with-status-s","errorCode":null,"errorMessage":"Fireworks image generation failed with status: ${status}","messagePattern":"Fireworks image generation failed with status: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/fireworks/src/fireworks-image-model.ts","lineNumber":373,"sourceCode":"        ),\n        abortSignal,\n        fetch: this.config.fetch,\n      });\n\n      const status = pollResponse.status;\n\n      if (status === 'Ready') {\n        const imageUrl = pollResponse.result?.sample;\n        if (typeof imageUrl === 'string') {\n          return imageUrl;\n        }\n        throw new Error(\n          'Fireworks poll response is Ready but missing result.sample',\n        );\n      }\n\n      if (status === 'Error' || status === 'Failed') {\n        throw new Error(\n          `Fireworks image generation failed with status: ${status}`,\n        );\n      }\n\n      // Wait before next poll attempt\n      await delay(pollIntervalMillis);\n    }\n\n    throw new Error(\n      `Fireworks image generation timed out after ${pollTimeoutMillis}ms`,\n    );\n  }\n}\n","sourceCodeStart":355,"sourceCodeEnd":387,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/fireworks/src/fireworks-image-model.ts#L355-L387","documentation":"During polling, if the Fireworks image request reports status 'Error' or 'Failed', the model throws an Error embedding that status string. The actual failure details live in the Fireworks request state, so the message only surfaces the terminal status.","triggerScenarios":"Calling `fireworks.image(...).doGenerate` where Fireworks transitions the generation request to `Error` or `Failed` — invalid model id, prompt rejected by safety filters, bad parameters (aspect ratio/size), or insufficient account quota/credits.","commonSituations":"Using a model id that doesn't exist on the account; prompts triggering content policy; exceeded rate limits or quota; invalid image size options for the chosen model.","solutions":["Check the Fireworks dashboard/logs for the underlying request error details","Verify the model id and generation options (size, aspect ratio, steps) are valid for that model","Confirm the Fireworks API key has quota/credits and isn't rate-limited","Adjust the prompt if it's being rejected by content filters"],"exampleFix":"// before\nconst model = fireworks.image('accounts/fireworks/models/typo-model');\n// after\nconst model = fireworks.image('accounts/fireworks/models/flux1-dev-fp8');","handlingStrategy":"try-catch","validationCode":"// validate inputs before submitting\nif (!modelId.includes('/models/')) throw new Error('invalid Fireworks model id');\nif (!prompt || prompt.length > 4000) throw new Error('prompt missing or too long');","typeGuard":"function isFireworksStatusFailure(e: unknown): boolean {\n  return e instanceof Error && e.message.startsWith('Fireworks image generation failed with status:');\n}","tryCatchPattern":"try {\n  return await generateImage({ model: fireworks.image(modelId), prompt });\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Fireworks image generation failed with status:')) {\n    // check Fireworks console/logs for the underlying request error, then fix inputs\n  }\n  throw e;\n}","preventionTips":["Validate the Fireworks model id (accounts/fireworks/models/...) before submitting","Pre-check prompts against content policy and keep options within the model's supported sizes/steps","Monitor API key quota and rate limits","Read the underlying Fireworks request state via their dashboard for root cause"],"tags":["image-generation","polling","fireworks","provider-error"],"backgroundTag":"provider-job-failed","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}