Skip to main content
This guide creates a sandbox enhancement, then polls it until the result is available. Sandbox requests validate authentication, payloads, idempotency, status polling, and webhook handling without consuming paid credits.

1. Create a sandbox API key

Open the AI Gen Studio dashboard and create a sandbox key. Sandbox keys start with aigen_test_. Store the full key immediately. It is displayed only once.

2. List presets

curl https://aigenstudio.app/api/v1/product-image-enhancement-presets
For a first test, use single_product_white_background.

3. Create an enhancement

Send a public image URL and a unique Idempotency-Key.
curl -X POST https://aigenstudio.app/api/v1/product-image-enhancements \
  -H "Authorization: Bearer aigen_test_xxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: catalog-import-001" \
  -d '{
    "preset": "single_product_white_background",
    "preservation_level": "strict",
    "images": [
      {
        "external_id": "product-001",
        "source_url": "https://example.com/product.jpg"
      }
    ]
  }'
Example response:
{
  "enhancement": {
    "id": "f693e677-51e0-4ebe-80a0-ad06acbc4443",
    "status": "queued",
    "total_items": 1,
    "credits_reserved": 0,
    "sandbox": true
  },
  "remaining_paid_credits": 0,
  "request_id": "req_..."
}
Save enhancement.id. It is the enhancement id used for status polling.

4. Poll status

curl https://aigenstudio.app/api/v1/product-image-enhancements/f693e677-51e0-4ebe-80a0-ad06acbc4443 \
  -H "Authorization: Bearer aigen_test_xxxxxxxxx"
When an item completes, the response includes result_url and thumbnail_url.

5. Move to live

Create a live key when you are ready for production processing. Live keys start with aigen_live_ and consume paid API credits. Before switching traffic to live:
  • use a unique Idempotency-Key per catalog batch;
  • store external_id so results can be mapped back to your products;
  • verify webhook signatures if you use webhooks;
  • handle 429 with Retry-After;
  • confirm the account has API-eligible paid credits.