HedaAI Product Images API
Generate 12 professional e-commerce images (8 main images + 4 A+ banners) plus complete listing copy from product photos — programmatically, or straight from your AI agent via MCP.
https://hedaai.com/api/v1 · Docs mirrors for agents: /developers/api.md · /developers/llms.txtAuthentication
Create an API key at hedaai.com/settings/api-keys (any account works; new accounts get a $2.00 signup bonus ≈ 2 free tasks). The full key (hda_live_…) and its webhook secret (whsec_…) are shown once at creation — store them securely. Keys can be named, spend-capped, and revoked at any time.
Authorization: Bearer hda_live_...
Keys are stored hashed and are bound to your account only — an API key can never read another account's data.
GET /v1/account reports "mode": "sandbox_watermarked"). Your first payment removes watermarks from all previously generated products automatically.Spend caps: each key has an optional spend_cap_cents (default: unlimited). When reached, task creation fails with spend_cap_exceeded (403).
Response envelope
{ "status": 200, "code": 200, "message": "", "data": { … } }
Errors add an error_code for programmatic matching. Transport errors vs task failures: HTTP 4xx/5xx means the request failed. A task that fails during generation is not an HTTP error — polling returns 200 with status: "failed" and an error field, and you are not charged.
Quickstart
# 1. Create a task
curl -X POST https://hedaai.com/api/v1/tasks \
-H "Authorization: Bearer $HEDAAI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-12345-attempt-1" \
-d '{
"product_name": "stainless steel insulated water bottle",
"images": ["https://your-cdn.example.com/bottle-front.jpg"],
"aspect_ratio": "1:1",
"category": "insulated water bottle 750ml",
"target_market": "amazon_us"
}'
# → data.task_id = "3f8a…", data.status = "queued"
# 2. Poll every 15–30s until terminal
curl -H "Authorization: Bearer $HEDAAI_API_KEY" https://hedaai.com/api/v1/tasks/3f8a…
# → data.status = "succeeded", data.product_id = "9c1b…"
# 3. Fetch the finished product (12 image URLs + listing copy)
curl -H "Authorization: Bearer $HEDAAI_API_KEY" https://hedaai.com/api/v1/products/9c1b…
POST/v1/tasks
Creates a generation task. Optional header: Idempotency-Key (≤64 chars, see below).
| Field | Type | Required | Notes |
|---|---|---|---|
product_name | string | yes | Short product name. Strong grounding signal — be specific. |
images | string[1–8] | yes | Photo URLs (public http/https, ≤15MB each) and/or base64 / data-URIs. Multi-angle photos improve fidelity. |
aspect_ratio | string | yes | 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9. Amazon main images use 1:1. |
category | string | no | Concrete category, e.g. "vacuum cleaner replacement filter". Recommended. |
brand_name | string | no | Feeds brand-story imagery and listing copy. |
key_features | string[≤10] | no | Must-show selling points. |
specs | object | no | {material, colorway, key_components[], usage_context, use_scenarios[], dimensions[], scale}. Recommended — the API has no interactive review step, grounding comes from what you send. |
target_market | string | no | amazon_us (default) · shopify · ebay |
copy_language | string | no | Listing copy locale (en-US, de-DE, ja-JP, …). Defaults from target market. |
aplus_format | string | no | banner (16:9, default) · aplus_3_4 · aplus_9_16 · standard_aplus/premium (Amazon only) |
no_human_models | bool | no | true = no people in any image. |
supplementary_text | string ≤5000 | no | Free-text specs / manual excerpts for the AI to read. |
callback_url | string | no | Webhook for terminal status (Webhooks). |
Returns a task object:
{
"task_id": "3f8a…", "status": "queued", "progress": 0,
"queue_position": 2, "eta_seconds": 840, "cost_cents": 0,
"created_at": "2026-07-17T08:00:00Z",
"urls": { "get": "/api/v1/tasks/3f8a…", "cancel": "/api/v1/tasks/3f8a…/cancel" }
}
GET/v1/tasks/{task_id}
Status lifecycle: queued → processing → succeeded | partial_failed | failed | canceled.
- succeeded — all 12 images done;
product_idset;cost_cents: 100charged. - partial_failed — some images failed; the product with successful images is still saved; not charged.
- failed / canceled — not charged;
errorexplains why.
Poll every 15–30 seconds. queue_position / eta_seconds are populated while queued.
POST/v1/tasks/{task_id}/cancel
Cancels a task. Free while queued; already-finished tasks are unaffected (idempotent).
GET/v1/products/{product_id}
{
"product_id": "9c1b…", "name": "stainless steel insulated water bottle",
"target_market": "amazon_us", "aspect_ratio": "1:1", "watermarked": false,
"listing_copy": {
"title": "…", "bullet_points": ["…","…","…","…","…"], "description": "…",
"search_terms": "…", "meta_title": "…", "meta_description": "…", "language": "en"
},
"images": [
{ "slice_id": "M1", "section": "main", "url": "https://images.hedaai.com/…",
"url_2k": "https://images.hedaai.com/…", "width": 2048, "height": 2048, "sort_order": 1 }
],
"created_at": "2026-07-17T08:11:32Z"
}
M1–M8are the 8 main images,A1–A4the A+ banners.url_2kappears for paid accounts once the async 2K upscale finishes (main images only) — it can lagsucceededby a couple of minutes.- Immediately after
succeeded, an image row can briefly be pending — re-fetch after a few seconds if you see fewer than 12 images. - URLs are permanent (served from our CDN); hotlinking and copying are both fine.
GET/v1/account
{
"balance_cents": 1250, "paid_balance_cents": 1000, "bonus_balance_cents": 250,
"has_paid": true, "mode": "live", "price_per_task_cents": 100,
"key": { "name": "prod-integration", "key_prefix": "hda_live_ab12…cd34",
"spend_cap_cents": null, "spent_cents": 700 }
}
Idempotency
Pass an Idempotency-Key header (≤64 chars) on POST /v1/tasks. Retrying with the same key and same body returns the original task instead of creating (and eventually charging) a duplicate. The same key with a different body returns 409 idempotency_conflict. Strongly recommended for agents and automation — network retries become double-spend-safe.
Webhooks
Set callback_url on task creation to receive a POST at terminal status. Events: task.succeeded, task.partial_failed, task.failed, task.canceled.
{ "id": "evt_…", "type": "task.succeeded", "created_at": "2026-07-17T08:11:35Z",
"data": { /* task object — same shape as GET /v1/tasks/{id} */ } }
Signatures follow the Standard Webhooks spec — headers webhook-id, webhook-timestamp, webhook-signature: v1,<base64>. Verify with your key's webhook_secret:
import hmac, hashlib, base64
def verify(secret, msg_id, timestamp, body: bytes, signature_header):
key = base64.b64decode(secret.removeprefix("whsec_"))
expected = base64.b64encode(hmac.new(key, f"{msg_id}.{timestamp}.".encode() + body,
hashlib.sha256).digest()).decode()
return any(hmac.compare_digest(expected, s.split(",", 1)[1])
for s in signature_header.split() if s.startswith("v1,"))
Respond with any 2xx quickly (do heavy work async). Delivery: one immediate attempt, retries after 3s / 6s / 12s, then marked failed (polling still works). Reject stale timestamps (>5 min) and de-duplicate by id. callback_url must be a public http(s) endpoint — private/internal addresses are rejected.
Rate limits & concurrency
| Limit | Value | On exceed |
|---|---|---|
| Requests per key | 120 / min (all endpoints) | 429 rate_limited — check RateLimit-Limit / -Remaining / -Reset headers |
| In-flight tasks per key | 2 (queued + processing) | 429 concurrency_limit — wait for a task to finish |
| Platform API capacity | dynamic | 429 api_capacity — retry in a few minutes |
Generation is heavy (13–20 AI image calls per task), so throughput is governed by in-flight task slots rather than request rate. Need more concurrency? Contact us.
Errors
| error_code | HTTP | Meaning |
|---|---|---|
bad_request | 400 | Invalid parameters — message pinpoints the field (e.g. images[2]: image download failed with HTTP 403). |
unauthorized | 401 | Missing/invalid API key, or key revoked. |
insufficient_credits | 402 | Balance too low; data.balance_cents included. |
spend_cap_exceeded | 403 | This key's spend cap is exhausted. |
account_disabled / email_not_verified / email_bounced | 403 | Account-level gates. |
not_found | 404 | Task/product doesn't exist or belongs to another account. |
idempotency_conflict | 409 | Same Idempotency-Key, different body. |
concurrency_limit / api_capacity / rate_limited | 429 | See limits. |
generation_failed / internal_error | 500 | Server-side failure; safe to retry with an idempotency key. |
Code examples
The full flow — create a task, poll until terminal, fetch the finished product — in the language of your choice.
API=https://hedaai.com/api/v1
# 1. Create a task
TASK_ID=$(curl -sS -X POST "$API/tasks" \
-H "Authorization: Bearer $HEDAAI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: sku-8842-v1" \
-d '{"product_name":"stainless steel insulated water bottle",
"images":["https://your-cdn.example.com/bottle.jpg"],
"aspect_ratio":"1:1"}' | jq -r .data.task_id)
# 2. Poll until terminal
while :; do
TASK=$(curl -sS -H "Authorization: Bearer $HEDAAI_API_KEY" "$API/tasks/$TASK_ID")
STATUS=$(echo "$TASK" | jq -r .data.status)
[ "$STATUS" = "queued" ] || [ "$STATUS" = "processing" ] || break
sleep 20
done
# 3. Fetch images + listing copy
if [ "$STATUS" = "succeeded" ]; then
PRODUCT_ID=$(echo "$TASK" | jq -r .data.product_id)
curl -sS -H "Authorization: Bearer $HEDAAI_API_KEY" "$API/products/$PRODUCT_ID" \
| jq -r '.data.images[].url, .data.listing_copy.title'
fi
import time, requests
API = "https://hedaai.com/api/v1"
H = {"Authorization": "Bearer hda_live_..."}
# 1. Create a task
task = requests.post(f"{API}/tasks",
headers={**H, "Idempotency-Key": "sku-8842-v1"},
json={"product_name": "stainless steel insulated water bottle",
"images": ["https://your-cdn.example.com/bottle.jpg"],
"aspect_ratio": "1:1"}).json()["data"]
# 2. Poll until terminal
while task["status"] in ("queued", "processing"):
time.sleep(20)
task = requests.get(f"{API}/tasks/{task['task_id']}", headers=H).json()["data"]
# 3. Fetch images + listing copy
if task["status"] == "succeeded":
product = requests.get(f"{API}/products/{task['product_id']}", headers=H).json()["data"]
print([img["url"] for img in product["images"]])
print(product["listing_copy"]["title"])
const API = "https://hedaai.com/api/v1";
const H = { Authorization: "Bearer hda_live_...", "Content-Type": "application/json" };
// 1. Create a task
let { data: task } = await (await fetch(`${API}/tasks`, {
method: "POST",
headers: { ...H, "Idempotency-Key": "sku-8842-v1" },
body: JSON.stringify({
product_name: "stainless steel insulated water bottle",
images: ["https://your-cdn.example.com/bottle.jpg"],
aspect_ratio: "1:1",
}),
})).json();
// 2. Poll until terminal
while (["queued", "processing"].includes(task.status)) {
await new Promise(r => setTimeout(r, 20000));
({ data: task } = await (await fetch(`${API}/tasks/${task.task_id}`, { headers: H })).json());
}
// 3. Fetch images + listing copy
if (task.status === "succeeded") {
const { data: product } = await (await fetch(`${API}/products/${task.product_id}`, { headers: H })).json();
console.log(product.images.map(i => i.url), product.listing_copy.title);
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"time"
)
const api = "https://hedaai.com/api/v1"
type envelope struct {
Data struct {
TaskID string `json:"task_id"`
Status string `json:"status"`
ProductID string `json:"product_id"`
Images []struct {
URL string `json:"url"`
} `json:"images"`
ListingCopy struct {
Title string `json:"title"`
} `json:"listing_copy"`
} `json:"data"`
}
func call(method, url string, body []byte, extra map[string]string) (envelope, error) {
var out envelope
var rdr *bytes.Reader
if body != nil {
rdr = bytes.NewReader(body)
} else {
rdr = bytes.NewReader(nil)
}
req, err := http.NewRequest(method, url, rdr)
if err != nil {
return out, err
}
req.Header.Set("Authorization", "Bearer hda_live_...")
req.Header.Set("Content-Type", "application/json")
for k, v := range extra {
req.Header.Set(k, v)
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
return out, err
}
defer resp.Body.Close()
return out, json.NewDecoder(resp.Body).Decode(&out)
}
func main() {
// 1. Create a task
payload, _ := json.Marshal(map[string]any{
"product_name": "stainless steel insulated water bottle",
"images": []string{"https://your-cdn.example.com/bottle.jpg"},
"aspect_ratio": "1:1",
})
task, err := call("POST", api+"/tasks", payload,
map[string]string{"Idempotency-Key": "sku-8842-v1"})
if err != nil {
panic(err)
}
// 2. Poll until terminal
for task.Data.Status == "queued" || task.Data.Status == "processing" {
time.Sleep(20 * time.Second)
if task, err = call("GET", api+"/tasks/"+task.Data.TaskID, nil, nil); err != nil {
panic(err)
}
}
// 3. Fetch images + listing copy
if task.Data.Status == "succeeded" {
product, err := call("GET", api+"/products/"+task.Data.ProductID, nil, nil)
if err != nil {
panic(err)
}
for _, img := range product.Data.Images {
fmt.Println(img.URL)
}
fmt.Println(product.Data.ListingCopy.Title)
}
}
import java.net.URI;
import java.net.http.*;
import java.time.Duration;
import com.fasterxml.jackson.databind.*; // any JSON library works
public class HedaAI {
static final String API = "https://hedaai.com/api/v1";
static final HttpClient CLIENT = HttpClient.newHttpClient();
static final ObjectMapper MAPPER = new ObjectMapper();
static JsonNode call(HttpRequest.Builder b) throws Exception {
HttpRequest req = b.header("Authorization", "Bearer hda_live_...")
.header("Content-Type", "application/json")
.build();
String body = CLIENT.send(req, HttpResponse.BodyHandlers.ofString()).body();
return MAPPER.readTree(body).path("data");
}
public static void main(String[] args) throws Exception {
// 1. Create a task
JsonNode task = call(HttpRequest.newBuilder(URI.create(API + "/tasks"))
.header("Idempotency-Key", "sku-8842-v1")
.POST(HttpRequest.BodyPublishers.ofString("""
{"product_name":"stainless steel insulated water bottle",
"images":["https://your-cdn.example.com/bottle.jpg"],
"aspect_ratio":"1:1"}""")));
// 2. Poll until terminal
String status = task.path("status").asText();
while (status.equals("queued") || status.equals("processing")) {
Thread.sleep(Duration.ofSeconds(20));
task = call(HttpRequest.newBuilder(
URI.create(API + "/tasks/" + task.path("task_id").asText())).GET());
status = task.path("status").asText();
}
// 3. Fetch images + listing copy
if (status.equals("succeeded")) {
JsonNode product = call(HttpRequest.newBuilder(
URI.create(API + "/products/" + task.path("product_id").asText())).GET());
product.path("images").forEach(img -> System.out.println(img.path("url").asText()));
System.out.println(product.path("listing_copy").path("title").asText());
}
}
}
<?php
$api = "https://hedaai.com/api/v1";
$headers = ["Authorization: Bearer hda_live_...", "Content-Type: application/json"];
function call($method, $url, $headers, $body = null) {
$ch = curl_init($url);
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => $method, CURLOPT_HTTPHEADER => $headers]);
if ($body !== null) curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
$res = json_decode(curl_exec($ch), true); curl_close($ch);
return $res["data"];
}
// 1. Create a task
$task = call("POST", "$api/tasks", array_merge($headers, ["Idempotency-Key: sku-8842-v1"]), [
"product_name" => "stainless steel insulated water bottle",
"images" => ["https://your-cdn.example.com/bottle.jpg"],
"aspect_ratio" => "1:1",
]);
// 2. Poll until terminal
while (in_array($task["status"], ["queued", "processing"])) {
sleep(20);
$task = call("GET", "$api/tasks/{$task['task_id']}", $headers);
}
// 3. Fetch images + listing copy
if ($task["status"] === "succeeded") {
$product = call("GET", "$api/products/{$task['product_id']}", $headers);
foreach ($product["images"] as $img) echo $img["url"], "\n";
echo $product["listing_copy"]["title"], "\n";
}
MCP server (for AI agents)
HedaAI ships a hosted Model Context Protocol server so agents can generate product images directly:
- Endpoint:
https://hedaai.com/api/v1/mcp(Streamable HTTP, stateless) - Auth: the same
Authorization: Bearer hda_live_…header - Tools:
create_product_shoot·get_task·get_product·get_balance
claude mcp add --transport http hedaai https://hedaai.com/api/v1/mcp \
--header "Authorization: Bearer $HEDAAI_API_KEY"
{
"mcpServers": {
"hedaai": {
"url": "https://hedaai.com/api/v1/mcp",
"headers": { "Authorization": "Bearer hda_live_..." }
}
}
}
Generation is asynchronous: agents call create_product_shoot (optionally with an idempotency_key), poll get_task every 30–60s until terminal, then get_product for image URLs and listing copy. Clients that require OAuth (e.g. claude.ai custom connectors) are not supported yet — use API-key-capable clients such as Claude Code, Cursor, or agent SDKs.
Pricing
| Item | Price |
|---|---|
| Product shoot — 12 images + listing copy | $1.00, charged on success only |
| Signup bonus | $2.00 (≈ 2 free tasks, watermarked until first payment) |
| Balance top-up | $10–$1000 at hedaai.com; ≥$50 +5% bonus, ≥$100 +10% |
Balance never expires. No subscription. The live price is always available at GET /v1/account (price_per_task_cents).