curl --request POST \
--url https://api.samsa.ai/public/v1/images/vectorizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": {
"image_id": "123e4567-e89b-12d3-a456-426614174000"
},
"svg_acceptance": true
}
'import requests
url = "https://api.samsa.ai/public/v1/images/vectorizations"
payload = {
"image": { "image_id": "123e4567-e89b-12d3-a456-426614174000" },
"svg_acceptance": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image: {image_id: '123e4567-e89b-12d3-a456-426614174000'},
svg_acceptance: true
})
};
fetch('https://api.samsa.ai/public/v1/images/vectorizations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.samsa.ai/public/v1/images/vectorizations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image' => [
'image_id' => '123e4567-e89b-12d3-a456-426614174000'
],
'svg_acceptance' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.samsa.ai/public/v1/images/vectorizations"
payload := strings.NewReader("{\n \"image\": {\n \"image_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"svg_acceptance\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.samsa.ai/public/v1/images/vectorizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image\": {\n \"image_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"svg_acceptance\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.samsa.ai/public/v1/images/vectorizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image\": {\n \"image_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"svg_acceptance\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"estimated_credits": 5
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}Ein Bild vektorisieren
Reiche einen Vektorisierungs-Job ein — ein Quellbild zu SVG — und erhalte eine Job-id zurück.
curl --request POST \
--url https://api.samsa.ai/public/v1/images/vectorizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": {
"image_id": "123e4567-e89b-12d3-a456-426614174000"
},
"svg_acceptance": true
}
'import requests
url = "https://api.samsa.ai/public/v1/images/vectorizations"
payload = {
"image": { "image_id": "123e4567-e89b-12d3-a456-426614174000" },
"svg_acceptance": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image: {image_id: '123e4567-e89b-12d3-a456-426614174000'},
svg_acceptance: true
})
};
fetch('https://api.samsa.ai/public/v1/images/vectorizations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.samsa.ai/public/v1/images/vectorizations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image' => [
'image_id' => '123e4567-e89b-12d3-a456-426614174000'
],
'svg_acceptance' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.samsa.ai/public/v1/images/vectorizations"
payload := strings.NewReader("{\n \"image\": {\n \"image_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"svg_acceptance\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.samsa.ai/public/v1/images/vectorizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image\": {\n \"image_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"svg_acceptance\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.samsa.ai/public/v1/images/vectorizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image\": {\n \"image_id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n \"svg_acceptance\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"estimated_credits": 5
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}image in ein SVG. Der Aufruf gibt 202 Accepted mit
einer Job-id zurück; frage
GET /images/vectorizations/{id}
nach dem Ergebnis ab. Das image nimmt genau eines von image_id, url oder
base64 + mime_type. Es gibt keinen Modell-Parameter. Erfordert den
images.transform-Scope.
svg_acceptance
gebunden — eine ausdrückliche Bestätigung dessen. Die Bestätigung ist
Offenlegungs-/Prüfnachweis, kein Compliance-Verzicht.Beispiel: eine Quelle pro Modus
svg_acceptance muss bei jeder Anfrage der literale Boolean true sein:
curl -X POST https://api.samsa.ai/public/v1/images/vectorizations \
-H "Authorization: Bearer $SAMSA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": { "image_id": "123e4567-e89b-12d3-a456-426614174000" },
"svg_acceptance": true
}'
curl -X POST https://api.samsa.ai/public/v1/images/vectorizations \
-H "Authorization: Bearer $SAMSA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": { "url": "https://cdn.example.com/logo.png" },
"svg_acceptance": true,
"webhook_url": "https://example.com/webhooks/samsa"
}'
curl -X POST https://api.samsa.ai/public/v1/images/vectorizations \
-H "Authorization: Bearer $SAMSA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": { "base64": "iVBORw0KGgoAAAANSUhEUg...", "mime_type": "image/png" },
"svg_acceptance": true
}'
pending-Job zurück:
{
"id": "a8b9c0d1-2e3f-4a4b-5c6d-7e8f9a0b1c2d",
"status": "pending",
"estimated_credits": 5
}
image_id ist, die du besitzt, und bereits ein Vektorergebnis dafür
existiert, gibt die Einreichung sofort 202 mit status: "completed" und
estimated_credits: 0 zurück — es wird kein neuer Job eingereiht und das
Concurrency-Limit deiner Organisation wird nicht belegt.Freigabe-Gates
Die Vektorisierung hat zwei unabhängige Auslieferungs-Gates, beide bei einem Fehler ohne Abrechnung durchgesetzt:svg_acceptancemuss der literale Booleantruesein. Ein fehlender,false- oder anderer Wert wird mit422 svg_acceptance_requiredabgelehnt.- Eine aktuelle, serverseitig verifizierte ToS/AUP-Zustimmung ist ebenfalls
erforderlich — das Anfrage-Flag wird niemals als dieser Fakt vertraut. Eine
fehlende oder veraltete Zustimmung wird mit
403 svg_phase1_scope_out_requiredabgelehnt; akzeptiere die aktuellen ToS/AUP und versuche es erneut.
Fehler
| Status | Code | Wann |
|---|---|---|
402 | insufficient_credits / insufficient_team_credits / insufficient_unallocated_credits | Der Stand, den dieses Credential ausgeben kann, liegt unter den Job-Kosten. Organisationen mit mindestens einem aktiven Team erhalten statt insufficient_credits die team-bezogenen Codes (ausgenommen vom Team-Budgeting befreite System-Organisationen). Ein operativer Fehler in der Abbuchung selbst kann dennoch das generische insufficient_credits liefern, unabhängig vom Regime. |
402 | subscription_inactive | Die Organisation hat kein nutzbares Abonnement. |
403 | missing_scope | Dem Schlüssel fehlt der images.transform-Scope. |
403 | svg_phase1_scope_out_required | Die serverseitig verifizierte ToS/AUP-Scope-out-Zustimmung fehlt oder ist veraltet (keine Abrechnung). |
404 | not_found | Die Quell-image_id ist unbekannt oder gehört nicht dem Key-Ersteller — auch ein Bild, das ein anderes Mitglied deiner Organisation erstellt hat, ist ein 404. |
422 | validation_error | Null oder mehrere Quellmodi angegeben. |
422 | svg_acceptance_required | svg_acceptance ist nicht der literale Boolean true (keine Abrechnung). |
429 | rate_limited / too_many_active_jobs | Pro-Schlüssel-Ratenfenster oder pro-Organisation-Concurrency-Limit überschritten. |
Autorisierungen
Organization API key as a bearer token: Authorization: Bearer samsa_sk_....
Body
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).
The source image: exactly one of image_id, an https url, or base64+mime_type.
Show child attributes
Show child attributes
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.
true
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.
"https://example.com/webhooks/samsa"
Antwort
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.
The job id — poll the op's GET .../{id} endpoint.
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).
pending, processing, completed, failed, cancelled "pending"
Credits this job is expected to cost — 0 on a cache-hit completed response.
5

