Crea un modello
Crea un modello da 1–10 immagini di riferimento fornite come URL o base64 inline.
202 Accepted con un id del modello; interroga
GET /models/{id}/status finché non è completed.
Ciascuna delle 1–10 images è o un url https (scaricato lato server
con protezioni SSRF) oppure base64 inline + mime_type (image/jpeg, image/png
o image/webp, ≤ 10 MB ciascuna). L’instruction facoltativa è la guida sempre applicata del modello —
iniettata come direttiva obbligatoria (“MUST FOLLOW”) in ogni generazione che compone il modello, non una
semplice nota d’uso (modificala in seguito con PATCH /models/{id}).
Richiede lo scope models.write.
Esempio: crea un modello di stile da URL
url oppure base64 + mime_type, non entrambi. Per file
di grandi dimensioni, usa invece il flusso di upload con presigned URL.
category è uno tra style, object, person, setting.Autorizzazioni
Organization API key as a bearer token: Authorization: Bearer samsa_sk_....
Corpo
POST /models body — inline base64 and/or https-URL reference images.
1 - 100"Acme Brand Style"
Model category — one of style, object, person, setting.
style, object, person, setting "style"
1-10 reference images, each a url or inline base64+mime_type.
1 - 10 elementsOptional free-text guidance for how to use the model.
8000"Use for hero banners and social posts."
Optional https webhook notified once on terminal status (signed per the webhook signature scheme; see the webhooks docs).
"https://example.com/webhooks/samsa"
Risposta
Successful Response
202 body for POST /models and POST /models/{id}/complete (ADR §7.1).
The created model's id — poll GET /models/{id}/status.
Initial status: pending (create) or processing (complete).
pending, processing, completed, failed "pending"
Credits the finished job will cost (model creation is free = 0).
0

