POST
Generación de Imágenes (Seedream)
Genera imágenes mediante el modelo doubao-seedream de Volcengine. Formato compatible con OpenAI Images API. doubao-seedream-5-0-260128 soporta texto a imagen y guía por imagen de referencia. Resolución mínima 3,686,400 píxeles (ej. 2048x2048).
Cuerpo de la solicitud
modelstringRequiredNombre del modelo, ej. doubao-seedream-5-0-260128.
promptstringRequiredTexto de descripción de la imagen (prompt).
sizestringOptionalResolución de salida, mín. 3,686,400 píxeles (ej. 2048x2048, 2496x1664).
nintegerOptionalNúmero de imágenes a generar, predeterminado 1.
response_formatstringOptionalFormato de retorno, soporta url o b64_json.
Autenticación
AuthorizationstringRequiredPasa un token Bearer en el encabezado.
POST
| 1 | curl ${HY_API_BASE}/v1/images/generations \ |
| 2 | -H "Authorization: Bearer $HY_API_KEY" \ |
| 3 | -H "Content-Type: application/json" \ |
| 4 | -d '{ |
| 5 | "model": "doubao-seedream-5-0-260128", |
| 6 | "prompt": "一只在樱花树下打盹的柴犬,浮世绘风格", |
| 7 | "size": "2048x2048", |
| 8 | "n": 1 |
| 9 | }' |
POST
Authorization
Obtener API Key →🔑
REQUEST
| 1 | const response = await fetch("https://apiclaw.cc/v1/images/generations", { |
| 2 | method: "POST", |
| 3 | headers: { |
| 4 | "Authorization": "Bearer YOUR_API_KEY", |
| 5 | "Content-Type": "application/json", |
| 6 | }, |
| 7 | }); |
| 8 | const data = await response.json(); |
| 9 | console.log(data); |
RESPONSE
◎
Haz clic en Send request para ver la respuesta
Response
| 1 | { |
| 2 | "data": [ |
| 3 | { |
| 4 | "url": "https://ark-acg-cn-beijing.tos-cn-beijing.volces.com/..." |
| 5 | } |
| 6 | ], |
| 7 | "usage": { |
| 8 | "generated_images": 1, |
| 9 | "output_tokens": 16384, |
| 10 | "total_tokens": 16384 |
| 11 | } |
| 12 | } |
Referencia · Documentación oficial de Volcengine Seedream ↗

