Current behavior
When calling generateImage with a reference image (via prompt.images) for any ByteDance Seedream model through the AI Gateway native /v3/ai protocol, the request reaches ByteDance but ByteDance returns HTTP 404. The same models work correctly for text-to-image (no files in the request body).
Expected behavior
Per the AI Gateway documentation and the Seedream model FAQ (“Does Seedream 4.5 support multi-image inputs? Yes.”), reference-image generation should succeed with the same generateImage call pattern that works for other supported models (e.g. openai/gpt-image-1, bfl/flux-kontext-pro).
Reproduction
import { experimental_generateImage as generateImage, createGateway } from 'ai';
const gateway = createGateway({ apiKey: process.env.VERCEL_AI_GATEWAY_KEY });
const { images } = await generateImage({
model: gateway.imageModel('bytedance/seedream-4.5'),
prompt: {
text: 'A marketing flyer using the provided logo',
images: ['data:image/png;base64,<base64>'],
},
});
Error response
{
"error": { "message": "Not Found", "statusCode": 404 },
"providerMetadata": {
"gateway": {
"routing": {
"originalModelId": "bytedance/seedream-4.5",
"resolvedProvider": "bytedance",
"providerAttempts": [{
"provider": "bytedance",
"credentialType": "system",
"success": false,
"error": "Not Found",
"statusCode": 404
}]
},
"generationId": "gen_01KS2DCZ3P24PRYVHW2KAYM36F"
}
}
}
The error originates from ByteDance (not the gateway itself), suggesting the gateway may be hitting the wrong ByteDance endpoint or sending an unexpected format when files are present in the request body.
Also tested: bytedance/seedream-5.0-lite — same result. Generation ID: gen_01KS2DHZ68XZ3PVY57X2W8EHTY.
What works
-
Text-to-image (no files): both Seedream models generate correctly
-
Reference images with other providers: openai/gpt-image-1,
bfl/flux-kontext-pro, xai/grok-imagine-image all work
Environment
-
SDK:
ai@6.0.185,@ai-sdk/gateway@3.0.116 -
Runtime: Deno (Supabase Edge Functions)
-
Gateway endpoint:
https://ai-gateway.vercel.sh/v3/ai/image-model
The same occurs for all ByteDance image models, even though almost all of them confirm in the Vercel AI Model docs that there is support for reference images.
Your assistance with this is greatly appreciated