Retrieve an img2img job's status and results
curl --request GET \
--url https://api.samsa.ai/public/v1/images/img2img/{img2img_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.samsa.ai/public/v1/images/img2img/{img2img_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.samsa.ai/public/v1/images/img2img/{img2img_id}', 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/img2img/{img2img_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.samsa.ai/public/v1/images/img2img/{img2img_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.samsa.ai/public/v1/images/img2img/{img2img_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.samsa.ai/public/v1/images/img2img/{img2img_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"created_at": "2023-11-07T05:31:56Z",
"credits_used": 5,
"images": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "https://cdn.samsa.ai/user-.../abc.png?X-Amz-Signature=...",
"thumbnail_url": "<string>",
"width": 123,
"height": 123,
"seed": 123
}
],
"error": "<string>"
}{
"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"
}
}Opérations d'images
Récupérer un job img2img
Interroge un job img2img pour son statut et, une fois terminé, les images produites.
GET
/
images
/
img2img
/
{img2img_id}
Retrieve an img2img job's status and results
curl --request GET \
--url https://api.samsa.ai/public/v1/images/img2img/{img2img_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.samsa.ai/public/v1/images/img2img/{img2img_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.samsa.ai/public/v1/images/img2img/{img2img_id}', 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/img2img/{img2img_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.samsa.ai/public/v1/images/img2img/{img2img_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.samsa.ai/public/v1/images/img2img/{img2img_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.samsa.ai/public/v1/images/img2img/{img2img_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "completed",
"created_at": "2023-11-07T05:31:56Z",
"credits_used": 5,
"images": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "https://cdn.samsa.ai/user-.../abc.png?X-Amz-Signature=...",
"thumbnail_url": "<string>",
"width": 123,
"height": 123,
"seed": 123
}
],
"error": "<string>"
}{
"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"
}
}Récupère le statut d’un job img2img. Tant qu’il est
pending ou processing,
continue d’interroger ; une fois completed, la réponse porte les images
produites, chacune avec une presigned url valable 24 heures — télécharge les
assets avant leur expiration. Seuls les jobs créés par ton organisation sont
visibles ; tout autre id renvoie 404 not_found.
Requiert le scope images.edit.
Exemple : job terminé
200 OK
{
"id": "b3f1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"status": "completed",
"created_at": "2026-07-18T10:12:00Z",
"credits_used": 5,
"images": [
{
"id": "9a8b7c6d-5e4f-4a3b-2c1d-0e1f2a3b4c5d",
"url": "https://cdn.samsa.ai/user-.../abc.png?X-Amz-Signature=...",
"thumbnail_url": "https://cdn.samsa.ai/user-.../abc-thumb.png?X-Amz-Signature=...",
"width": 1024,
"height": 1024,
"seed": 42
}
],
"error": null
}
Tu préfères le push au polling ? Passe un
webhook_url sur la
requête img2img d’origine pour recevoir un
callback signé quand le job est completed ou failed. Un job cancelled n’émet
aucun webhook — repasse au polling dans ce cas. Voir
Webhooks.Autorisations
Organization API key as a bearer token: Authorization: Bearer samsa_sk_....
Paramètres de chemin
Réponse
Successful Response
GET /images/img2img/{id} body — same contract as image generation.
Backed by image_generation_tasks like the other image jobs; a distinct
component name for the docs.
pending, processing, completed, failed, or cancelled.
Options disponibles:
pending, processing, completed, failed, cancelled Exemple:
"completed"
When the job was submitted.
Net credits charged for this job, after any refunds.
Exemple:
5
Produced images (presigned URLs); empty until completed.
Show child attributes
Show child attributes
Failure detail when status is failed; otherwise null.

