Trabajos de IA
Crea imágenes y SVG y aplica estilos con IA. Son trabajos asíncronos: POST /jobs responde 202 con el trabajo y la cabecera Location, y lo consultas hasta que termina (o recibes un webhook). El resultado se guarda en tu biblioteca. Envía Idempotency-Key para reintentar sin pagar dos veces.
| Endpoint | Descripción |
|---|---|
GET /image-styles | Listar estilos de imagen |
POST /jobs | Crear una imagen |
POST /jobs | Aplicar un estilo |
POST /jobs | Crear un SVG |
GET /jobs/{id} | Consultar un trabajo |
Listar estilos de imagen
/image-stylesDevuelve los estilos que acepta un trabajo restyle_image (input.style).
Parámetros de consulta
| Nombre | Tipo | Descripción |
|---|---|---|
page | entero | Página, desde 1. |
page_size | entero | Resultados por página (24 por defecto, máximo 100). |
Ejemplo
curl "https://creavibe.app/api/v1/image-styles?page_size=3" \
-H "Authorization: Bearer cv_TU_TOKEN"const respuesta = await fetch('https://creavibe.app/api/v1/image-styles?page_size=3', {
method: 'GET',
headers: {
Authorization: 'Bearer cv_TU_TOKEN',
},
});
const datos = await respuesta.json();import requests
respuesta = requests.get(
"https://creavibe.app/api/v1/image-styles?page_size=3",
headers={"Authorization": "Bearer cv_TU_TOKEN"},
)
datos = respuesta.json(){
"count": 23,
"next": "https://creavibe.app/api/v1/image-styles?page_size=3&page=2",
"previous": null,
"results": [
{
"slug": "minimal",
"name": "Minimal",
"image_url": "https://creavibe.app/media/estilos/estilo-minimal.webp"
},
{
"slug": "maximalista",
"name": "Maximalista",
"image_url": "https://creavibe.app/media/estilos/estilo-maximalista.webp"
},
{
"slug": "sci-fi",
"name": "Sci-fi",
"image_url": "https://creavibe.app/media/estilos/estilo-sci-fi.webp"
}
]
}Errores: 401
Crear una imagen
Trabajo generate_image: crea una imagen a partir de una descripción.
Cuerpo (JSON)
| Nombre | Tipo | Descripción |
|---|---|---|
typeobligatorio | texto | generate_image. |
input.promptobligatorio | texto | Qué quieres ver (se usan los 500 primeros caracteres). |
input.aspect_ratio | texto | Proporción: 1:1 (por defecto), 4:5, 3:4, 2:3, 9:16, 16:9, 3:2, 4:3, 5:4, 21:9 o 9:21. |
webhook_url | texto | URL https que recibe el aviso al terminar (ver Webhooks). |
Ejemplo
curl -X POST "https://creavibe.app/api/v1/jobs" \
-H "Authorization: Bearer cv_TU_TOKEN" \
-H 'Idempotency-Key: f3b1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d' \
-H "Content-Type: application/json" \
-d '{"type":"generate_image","input":{"prompt":"A red apple on a wooden table, soft daylight","aspect_ratio":"4:5"}}'const respuesta = await fetch('https://creavibe.app/api/v1/jobs', {
method: 'POST',
headers: {
Authorization: 'Bearer cv_TU_TOKEN',
'Idempotency-Key': 'f3b1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"type": "generate_image",
"input": {
"prompt": "A red apple on a wooden table, soft daylight",
"aspect_ratio": "4:5"
}
}),
});
const datos = await respuesta.json();import requests
respuesta = requests.post(
"https://creavibe.app/api/v1/jobs",
headers={"Authorization": "Bearer cv_TU_TOKEN", "Idempotency-Key": 'f3b1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d'},
json={
"type": "generate_image",
"input": {
"prompt": "A red apple on a wooden table, soft daylight",
"aspect_ratio": "4:5"
}
},
)
datos = respuesta.json()Location: /api/v1/jobs/394730eb-3747-4fd2-9e06-9a945e9f12fb{
"id": "394730eb-3747-4fd2-9e06-9a945e9f12fb",
"type": "generate_image",
"status": "queued",
"style": null,
"asset": null,
"reply": null,
"error": null,
"credits_remaining": 19,
"webhook_url": null,
"created_at": "2026-10-12T10:10:32.061Z",
"updated_at": "2026-10-12T10:10:32.061Z"
}Aplicar un estilo
Trabajo restyle_image: aplica un estilo, o un cambio descrito, a una imagen de tu biblioteca. El resultado es una imagen nueva; la original no cambia.
Cuerpo (JSON)
| Nombre | Tipo | Descripción |
|---|---|---|
typeobligatorio | texto | restyle_image. |
input.asset_idobligatorio | uuid | Imagen de tu biblioteca (o input.image_url, su URL). |
input.style | texto | Slug de un estilo de Listar estilos de imagen. |
input.prompt | texto | Cambio descrito, si no usas style. |
webhook_url | texto | URL https que recibe el aviso al terminar. |
Ejemplo
curl -X POST "https://creavibe.app/api/v1/jobs" \
-H "Authorization: Bearer cv_TU_TOKEN" \
-H 'Idempotency-Key: f3b1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d' \
-H "Content-Type: application/json" \
-d '{"type":"restyle_image","input":{"asset_id":"cb901a12-c1cb-4537-9d7f-ac405cee99fc","style":"retro"}}'const respuesta = await fetch('https://creavibe.app/api/v1/jobs', {
method: 'POST',
headers: {
Authorization: 'Bearer cv_TU_TOKEN',
'Idempotency-Key': 'f3b1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"type": "restyle_image",
"input": {
"asset_id": "cb901a12-c1cb-4537-9d7f-ac405cee99fc",
"style": "retro"
}
}),
});
const datos = await respuesta.json();import requests
respuesta = requests.post(
"https://creavibe.app/api/v1/jobs",
headers={"Authorization": "Bearer cv_TU_TOKEN", "Idempotency-Key": 'f3b1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d'},
json={
"type": "restyle_image",
"input": {
"asset_id": "cb901a12-c1cb-4537-9d7f-ac405cee99fc",
"style": "retro"
}
},
)
datos = respuesta.json()Location: /api/v1/jobs/cf9c2935-7137-42cb-af91-e44af5e3c1c5{
"id": "cf9c2935-7137-42cb-af91-e44af5e3c1c5",
"type": "restyle_image",
"status": "queued",
"style": "retro",
"asset": null,
"reply": null,
"error": null,
"credits_remaining": 18,
"webhook_url": null,
"created_at": "2026-10-12T10:10:32.070Z",
"updated_at": "2026-10-12T10:10:32.070Z"
}Crear un SVG
Trabajo generate_svg: crea un SVG a partir de una descripción, suelto o un sprite (un solo archivo con 2 a 6 iconos del mismo estilo en rejilla). Cuesta 1 crédito por icono; si salen menos, se devuelve la diferencia.
Cuerpo (JSON)
| Nombre | Tipo | Descripción |
|---|---|---|
typeobligatorio | texto | generate_svg. |
input.promptobligatorio | texto | Qué dibujar. |
input.icon_count | entero | De 1 (por defecto) a 6. |
webhook_url | texto | URL https que recibe el aviso al terminar. |
Ejemplo
curl -X POST "https://creavibe.app/api/v1/jobs" \
-H "Authorization: Bearer cv_TU_TOKEN" \
-H 'Idempotency-Key: f3b1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d' \
-H "Content-Type: application/json" \
-d '{"type":"generate_svg","input":{"prompt":"Coffee shop icons: cup, bean, croissant","icon_count":3}}'const respuesta = await fetch('https://creavibe.app/api/v1/jobs', {
method: 'POST',
headers: {
Authorization: 'Bearer cv_TU_TOKEN',
'Idempotency-Key': 'f3b1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"type": "generate_svg",
"input": {
"prompt": "Coffee shop icons: cup, bean, croissant",
"icon_count": 3
}
}),
});
const datos = await respuesta.json();import requests
respuesta = requests.post(
"https://creavibe.app/api/v1/jobs",
headers={"Authorization": "Bearer cv_TU_TOKEN", "Idempotency-Key": 'f3b1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d'},
json={
"type": "generate_svg",
"input": {
"prompt": "Coffee shop icons: cup, bean, croissant",
"icon_count": 3
}
},
)
datos = respuesta.json()Location: /api/v1/jobs/974c1661-3528-4099-9406-9688f1248f78{
"id": "974c1661-3528-4099-9406-9688f1248f78",
"type": "generate_svg",
"status": "queued",
"style": null,
"asset": null,
"reply": null,
"error": null,
"credits_remaining": 15,
"webhook_url": null,
"created_at": "2026-10-12T10:10:32.074Z",
"updated_at": "2026-10-12T10:10:32.074Z"
}Consultar un trabajo
/jobs/{id}Devuelve el estado de un trabajo: queued, processing, succeeded (con asset) o failed (con error.code; los créditos se devuelven). Tiene su propio límite: consultarlo no gasta el general.
Parámetros de la ruta
| Nombre | Tipo | Descripción |
|---|---|---|
idobligatorio | uuid | Id del trabajo. |
Ejemplo
curl "https://creavibe.app/api/v1/jobs/394730eb-3747-4fd2-9e06-9a945e9f12fb" \
-H "Authorization: Bearer cv_TU_TOKEN"const respuesta = await fetch('https://creavibe.app/api/v1/jobs/394730eb-3747-4fd2-9e06-9a945e9f12fb', {
method: 'GET',
headers: {
Authorization: 'Bearer cv_TU_TOKEN',
},
});
const datos = await respuesta.json();import requests
respuesta = requests.get(
"https://creavibe.app/api/v1/jobs/394730eb-3747-4fd2-9e06-9a945e9f12fb",
headers={"Authorization": "Bearer cv_TU_TOKEN"},
)
datos = respuesta.json(){
"id": "394730eb-3747-4fd2-9e06-9a945e9f12fb",
"type": "generate_image",
"status": "succeeded",
"style": null,
"asset": {
"id": "ba0f0e44-38f6-497a-86d7-0fa26638ef4f",
"url": "https://creavibe.app/media/recursos/017dfef2-eaf5-429a-86f3-307b8bf36189/fe9c605529e44f34b85de1305c39c239.png",
"thumbnail_url": "https://creavibe.app/media/miniaturas/recurso/51a5e906ffa3464f874b1156cc35212e.webp",
"type": "image",
"source": "generated",
"name": "A red apple on a wooden table, soft daylight",
"font_family": null,
"width": 896,
"height": 1152,
"size_bytes": 1181799,
"created_at": "2026-10-12T10:10:40.432Z"
},
"reply": null,
"error": null,
"credits_remaining": 15,
"webhook_url": null,
"created_at": "2026-10-12T10:10:32.061Z",
"updated_at": "2026-10-12T10:10:32.084Z"
}