Skip to main content
POST
/
models
/
{model_id}
/
complete
Finalize a prepared model after uploading its images
curl --request POST \
  --url https://api.samsa.ai/public/v1/models/{model_id}/complete \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "uploaded_keys": [
    "<string>"
  ],
  "webhook_url": "https://example.com/webhooks/samsa"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "estimated_credits": 123
}
Step two of the presigned upload flow. After PUT-ing each file to the URLs from POST /models/prepare, call this endpoint with the uploaded_keys (the R2 keys you uploaded, in order — first = cover). Samsa validates the keys and starts processing, returning 202 Accepted. Poll GET /models/{id}/status until completed. Requires the models.write scope.
Pass a webhook_url here to be notified when the model reaches a terminal status instead of polling. See Webhooks.

Authorizations

Authorization
string
header
required

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

Headers

authorization
string | null

Path Parameters

model_id
string<uuid>
required

Body

application/json

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

uploaded_keys
string[]
required

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).

Example:

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

Response

Successful Response

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

id
string<uuid>
required

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

status
enum<string>
required

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

Available options:
pending,
processing,
completed,
failed
Example:

"pending"

estimated_credits
integer
required

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

Example:

0