Skip to main content
POST
Vectorize an image to SVG (Art. 50(2) scope-out)
Vettorizza una image sorgente in un SVG. La chiamata restituisce 202 Accepted con un id del job; interroga GET /images/vectorizations/{id} per il risultato. L’image prende esattamente uno tra image_id, url o base64 + mime_type. Non c’è alcun parametro di modello. Richiede lo scope images.transform.
L’SVG è un’esclusione di ambito ai sensi dell’art. 50(2) del EU AI Act. Un SVG non può contenere né un manifesto C2PA né una filigrana incorporata, quindi gli output vettoriali sono consegnati non firmati e senza filigrana. La consegna è vincolata a svg_acceptance — un riconoscimento esplicito di questo. Il riconoscimento è una prova di divulgazione / audit, non una rinuncia alla conformità.

Esempio: una sorgente per modalità

svg_acceptance deve essere il booleano letterale true a ogni richiesta:
Il percorso normale (addebitato) restituisce un job pending:
202 Accepted
Costo = 5 credits su un miss; 0 su un cache hit. Quando la sorgente è un image_id che possiedi e per esso esiste già un risultato vettoriale, l’invio restituisce immediatamente 202 con status: "completed" e estimated_credits: 0 — nessun nuovo job viene messo in coda e il limite di concorrenza della tua organizzazione non viene consumato.

Gate di accettazione

La vettorizzazione ha due gate di consegna indipendenti, entrambi applicati senza addebito in caso di errore:
  • svg_acceptance deve essere il booleano letterale true. Un valore mancante, false o altro è rifiutato con 422 svg_acceptance_required.
  • È richiesta anche un’accettazione ToS/AUP attuale e verificata lato server — il flag della richiesta non è mai considerato come questo fatto. Un’accettazione mancante o scaduta è rifiutata con 403 svg_phase1_scope_out_required; accetta gli attuali ToS/AUP e riprova.

Errori

Autorizzazioni

Authorization
string
header
obbligatorio

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

Corpo

application/json

POST /images/vectorizations body (SAM-821 / S8.9 — Art. 50(2) scope-out).

Vectorize ONE source image into an SVG (Recraft; 5 credits flat). The source is exactly one of image_id (an image in your organization's context), an https url, or base64+mime_type. There is NO model parameter.

SVG is a documented EU AI Act Art. 50(2) scope-out: an SVG cannot carry a C2PA manifest or an embedded watermark, so vector outputs are delivered unsigned. Delivery is therefore gated on svg_acceptance — an explicit acknowledgment that the SVG is an unsigned, unwatermarked scope-out output. This acknowledgment is disclosure / audit evidence, NOT a compliance waiver. svg_acceptance must be the literal boolean true; a missing, false, or any other value is rejected 422 svg_acceptance_required with no charge. Delivery ALSO requires a current, server-verified ToS/AUP acceptance (the request flag is never trusted as that fact); a missing / stale acceptance is 403 svg_phase1_scope_out_required with no charge.

Cost = 5 credits on a miss; 0 on a cache HIT. When the source is an image_id you own and a vector result already exists for it, the submit returns 202 with status: "completed" and estimated_credits: 0 immediately (no new job is queued and the org's concurrency cap is not consumed).

image
PublicImageEditSource · object
obbligatorio

The source image: exactly one of image_id, an https url, or base64+mime_type.

svg_acceptance
boolean
obbligatorio

Must be the literal boolean true: an explicit acknowledgment that SVG (vector) output is an EU AI Act Art. 50(2) scope-out delivered UNSIGNED and UNWATERMARKED. This acknowledgment is disclosure / audit evidence, NOT a compliance waiver. Any other value (missing / false) is rejected 422 svg_acceptance_required with no charge.

Esempio:

true

webhook_url
string | null

Optional https webhook notified once on terminal status (signed per the webhook signature scheme; see the webhooks docs). On a cache hit the completed event fires immediately.

Esempio:

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

Risposta

Successful Response

Shared 202 body for the transform-op submits (SAM-813 / S8 wave).

Every POST /images/<op> returns the async job handle {id, status, estimated_credits}. The initial status is pending (the job is queued), with ONE exception: background-removals and vectorizations answer an owned-image_id cache hit (a ready result already exists for that image) with status: "completed" and estimated_credits: 0 — no new job is queued, the completed webhook event is emitted immediately for a supplied webhook_url, and the result is already available from the op's GET .../{id} endpoint. The other transform ops (img2img, variations, resizes, upscales) always start pending.

id
string<uuid>
obbligatorio

The job id — poll the op's GET .../{id} endpoint.

status
enum<string>
obbligatorio

Initial status: pending (job queued — enter the polling flow), or completed with estimated_credits: 0 when background-removals / vectorizations serve an owned-image cache hit (the result is immediately available).

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

"pending"

estimated_credits
integer
obbligatorio

Credits this job is expected to cost — 0 on a cache-hit completed response.

Esempio:

5