---
title: "API di foto prodotto con IA per moda ed e-commerce | Herofab"
description: "L’API di Herofab esegue gli strumenti per foto prodotto dal proprio sistema: caricamento della foto, creazione del job, verifica o webhook firmato, download."
url: https://herofab.app/it/api
language: it
updated: 2026-09-30
---

# Lo studio di foto prodotto, come API.

L’API di Herofab riceve una foto prodotto e il nome di uno strumento ed elabora il job in background; l’interrogazione del job o un webhook firmato segnala quando l’immagine finale è pronta per il download.

[Vedi i prezzi](https://herofab.app/it/pricing)

- Chiavi API Bearer
- Webhook firmati
- Fino a 100 job per batch
- OpenAPI 3.1 e llms.txt

```
curl https://app.herofab.app/api/v1/jobs -H "Authorization: Bearer $HEROFAB_API_KEY" -H "Idempotency-Key: $(uuidgen)" --json '{"tool": "ghost_mannequin", "inputs": {"garment": "ASSET_ID"}}'
```

## Dalla foto all’immagine finale.

### Invio

Caricare la foto prodotto e creare un job con uno strumento e le sue impostazioni; il job riserva i propri crediti.

`POST /api/v1/assets` · `POST /api/v1/jobs`

### Verifica

Interrogare il job finché non è completato, oppure ricevere un webhook firmato al termine.

`GET /api/v1/jobs/{id}`

### Download

Scaricare l’immagine finale tramite l’ID asset dell’output del job.

`GET /api/v1/assets/{id}/content`

**Esempio completo: carica la foto, crea il lavoro, attendi, scarica**

```
API=https://app.herofab.app/api/v1
AUTH="Authorization: Bearer $HEROFAB_API_KEY"

# 1 · Upload the product photo
ASSET_ID=$(curl -s "$API/assets" \
  -H "$AUTH" \
  -F file=@shirt.jpg | jq -r .id)

# 2 · Create the job
BODY=$(jq -n --arg garment "$ASSET_ID" '{tool: "ghost_mannequin",
  inputs: {garment: $garment}, params: {style: "3d", backdrop: "white"}}')
JOB_ID=$(curl -s "$API/jobs" \
  -H "$AUTH" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d "$BODY" | jq -r .id)

# 3 · Poll until the job is finished
while :; do
  JOB=$(curl -s "$API/jobs/$JOB_ID" -H "$AUTH")
  STATE=$(jq -r .state <<<"$JOB")
  [ "$STATE" = queued ] || [ "$STATE" = running ] || break
  sleep 2
done
[ "$STATE" = succeeded ] || { jq -r .failure.code <<<"$JOB"; exit 1; }

# 4 · Download the image
OUTPUT_ID=$(jq -r '.outputs[0].asset_id' <<<"$JOB")
EXT=$(jq -r '.outputs[0].content_type | ltrimstr("image/")' <<<"$JOB")
curl -sL "$API/assets/$OUTPUT_ID/content" -H "$AUTH" -o "result.$EXT"
```
