Skip to main content
POST
Finalize a prepared model after uploading its images
Passo due del flusso di upload con presigned URL. Dopo aver eseguito il PUT di ogni file agli URL forniti da POST /models/prepare, chiama questo endpoint con gli uploaded_keys (le chiavi R2 che hai caricato, in ordine — la prima = copertina). Samsa convalida le chiavi e avvia l’elaborazione, restituendo 202 Accepted. Interroga GET /models/{id}/status finché non è completed. Richiede lo scope models.write.
Passa qui un webhook_url per essere notificato quando il modello raggiunge uno stato terminale invece di interrogarlo. Vedi Webhook.

Autorizzazioni

Authorization
string
header
obbligatorio

Organization API key as a bearer token: Authorization: Bearer samsa_sk_....

Parametri del percorso

model_id
string<uuid>
obbligatorio

Corpo

application/json

POST /models/{id}/complete body — finalize after uploading to presigned URLs.

uploaded_keys
string[]
obbligatorio

The R2 keys you uploaded, in order (first = cover).

Required array length: 1 - 10 elements
webhook_url
string | null

Optional https webhook notified once on terminal status (signed per the webhook signature scheme; see the webhooks docs).

Esempio:

"https://example.com/webhooks/samsa"

Risposta

Successful Response

202 body for POST /models and POST /models/{id}/complete (ADR §7.1).

id
string<uuid>
obbligatorio

The created model's id — poll GET /models/{id}/status.

status
enum<string>
obbligatorio

Initial status: pending (create) or processing (complete).

Opzioni disponibili:
pending,
processing,
completed,
failed
Esempio:

"pending"

estimated_credits
integer
obbligatorio

Credits the finished job will cost (model creation is free = 0).

Esempio:

0