v1 REST API Production Ready openapi.json

FlashShot Developer API Reference

Programmatically authenticate, submit product photos for AI studio relighting, perform iterative prompt adjustments, and scale e-commerce listings with sub-8-second synchronous edge responses.

Live Console

Overview & Base URL

The FlashShot Developer API enables e-commerce marketplaces, inventory systems, and automated pipelines to submit raw smartphone photos, execute AI studio relighting, and iteratively fine-tune specular reflections and shadows. All endpoints are hosted on Cloudflare Workers edge nodes globally and return high-resolution renders persisted directly on Cloudflare R2 CDN.

Production Base URL
https://api.flashshot.io/v1
Format JSON REST
Edge Latency 5–8s Synchronous
CORS Policy Universal Origin (*)

Authentication & Security

API requests require an active API key generated in your Customer Account settings. The API supports both standard Authorization: Bearer headers and x-api-key request headers.

Option 1: Bearer Authorization Header
Authorization: Bearer fs_live_a1b2c3d4e5f6...
Option 2: x-api-key Header
x-api-key: fs_live_a1b2c3d4e5f6...

Zero Plaintext Storage Architecture

FlashShot never stores secret keys in plain text. Keys are generated with 16 bytes of secure entropy (fs_live_[32_hex_chars]), hashed with SHA-256 before writing to Cloudflare D1, and verified via constant-time cryptographic hash comparisons. Plain-text keys are only shown once at creation.

Credit Verification Engine & Atomic Deductions

Every transformation and refinement attempt consumes exactly 1 account credit. To support high-throughput e-commerce catalog ingestion, the backend implements atomic conditional deductions preventing overdrafts or race conditions under parallel concurrency.

1. Fail-Fast Check

HTTP 402 Payment Required

If your credit balance is 0, the API returns HTTP 402 in <400ms without calling upstream AI models.

2. Atomic Deduction

Zero Race Conditions

Client systems can fire 10–20 concurrent parallel calls. Each deduction executes atomically in SQLite.

3. Compensatory Rollback

Zero Outage Penalties

If an external AI inference model cascade fails, your credit is automatically refunded in the same lifecycle.

E-Commerce Architectural Dual-Image Workflow

Designed in collaboration with e-commerce retailers (such as JRG Electronics), this workflow solves customer trust while optimizing catalog conversion. Retailers preserve authentic smartphone photos of product condition while showcasing studio-lit hero shots.

1

Upload & Preserve Authentic Raw Photo

Capture raw photos on mobile devices. Store the authentic unedited image on your server or CDN to serve as proof-of-condition in secondary trust galleries.

2

Programmatic Relighting via POST /v1/transform

Send raw photo via Base64 or image URL to /v1/transform with studio theme pro_white. The API isolates subject geometry, recalculates specular bounce, and returns the high-res CDN render within 5–8 seconds.

3

Iterative Fine-Tuning via POST /v1/refine

If the studio render needs minor adjustments (e.g. softer shadows, reduced dial reflection), call /v1/refine with the returned job_id as parent_job_id. FlashShot fetches the parent render directly from R2 at edge speed.

4

Storefront Dual-Image Presentation

Publish the FlashShot studio render as the high-converting primary listing thumbnail, and display the unedited raw phone photo alongside it as authentic condition verification.

POST

/v1/transform

1 Credit

Transforms a raw product image into a studio-lit photo using your selected lighting theme and aspect ratio. Returns the persistent Cloudflare R2 CDN URL.

Field Type Required Description
image string Yes Base64 data URI (data:image/png;base64,...), raw Base64, or public HTTPS URL.
theme_key string Yes Lighting preset (e.g. "pro_white", "natural_wood", "clean_marble").
format_key string No Target aspect ratio: "square" (1:1), "portrait" (4:5), "story" (9:16). Default: "square".
original_filename string No Used for SEO-friendly semantic URL slugging on R2 CDN.
Code Examples
curl -X POST https://api.flashshot.io/v1/transform \
  -H "Authorization: Bearer fs_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://jrgelectronics.co.za/uploads/raw/watch.jpg",
    "theme_key": "pro_white",
    "format_key": "square",
    "original_filename": "garmin-fenix-7.png"
  }'
const response = await fetch('https://api.flashshot.io/v1/transform', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer fs_live_YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    image: 'https://jrgelectronics.co.za/uploads/raw/watch.jpg',
    theme_key: 'pro_white',
    format_key: 'square',
    original_filename: 'garmin-fenix-7.png'
  })
});

const result = await response.json();
console.log('CDN URL:', result.output_url);
console.log('Job ID:', result.job_id);
import requests

url = "https://api.flashshot.io/v1/transform"
headers = {
    "Authorization": "Bearer fs_live_YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "image": "https://jrgelectronics.co.za/uploads/raw/watch.jpg",
    "theme_key": "pro_white",
    "format_key": "square",
    "original_filename": "garmin-fenix-7.png"
}

res = requests.post(url, json=payload, headers=headers)
print(res.json())
Response (200 OK)
{
  "success": true,
  "job_id": "job_1788770854344_9a0891c8",
  "jobId": "job_1788770854344_9a0891c8",
  "output_url": "https://images.flashshot.io/renders/job_1788770854344_9a0891c8-garmin-fenix-7-flashshot-io.png",
  "credits_remaining": 42,
  "theme_used": "pro_white",
  "format_used": "square",
  "created_at": 1788770854344
}
POST

/v1/refine

1 Credit

Fine-tunes a previously transformed photo by applying natural language instructions (e.g. lighting temperature, specular gloss, rim shadows) without re-uploading the source image or altering product geometry.

Field Type Required Description
parent_job_id string Yes Job ID returned from /v1/transform or prior /v1/refine. Must belong to your account.
custom_prompt string Yes Natural language adjustments (e.g. "Soften the highlight glare on the watch bezel dial").
Code Examples
curl -X POST https://api.flashshot.io/v1/refine \
  -H "Authorization: Bearer fs_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "parent_job_id": "job_1788770854344_9a0891c8",
    "custom_prompt": "Soften the white specular highlight on the metal bezel and warm the rim light slightly."
  }'
const response = await fetch('https://api.flashshot.io/v1/refine', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer fs_live_YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    parent_job_id: 'job_1788770854344_9a0891c8',
    custom_prompt: 'Soften the white specular highlight on the metal bezel and warm the rim light slightly.'
  })
});

const result = await response.json();
console.log('Refined CDN URL:', result.output_url);
console.log('Job ID:', result.job_id);
import requests

url = "https://api.flashshot.io/v1/refine"
headers = {
    "Authorization": "Bearer fs_live_YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "parent_job_id": "job_1788770854344_9a0891c8",
    "custom_prompt": "Soften the white specular highlight on the metal bezel and warm the rim light slightly."
}

res = requests.post(url, json=payload, headers=headers)
print(res.json())
Response (200 OK)
{
  "success": true,
  "job_id": "job_1788770885665_94ba9a49",
  "jobId": "job_1788770885665_94ba9a49",
  "parent_job_id": "job_1788770854344_9a0891c8",
  "output_url": "https://images.flashshot.io/renders/job_1788770885665_94ba9a49-refine-flashshot-io.png",
  "credits_remaining": 41,
  "created_at": 1788770885665
}
GET

/v1/jobs/:id

0 Credits (Free)

Fetches the status, timestamp, theme used, format aspect ratio, and CDN output URL of any historical transformation or refinement job.

Code Examples
curl https://api.flashshot.io/v1/jobs/job_1788770854344_9a0891c8 \
  -H "Authorization: Bearer fs_live_YOUR_API_KEY"
const jobId = 'job_1788770854344_9a0891c8';
const response = await fetch(`https://api.flashshot.io/v1/jobs/${jobId}`, {
  headers: {
    'Authorization': 'Bearer fs_live_YOUR_API_KEY'
  }
});

const result = await response.json();
console.log('Status:', result.job.status);
console.log('Render URL:', result.job.output_url);
import requests

job_id = "job_1788770854344_9a0891c8"
url = f"https://api.flashshot.io/v1/jobs/{job_id}"
headers = {
    "Authorization": "Bearer fs_live_YOUR_API_KEY"
}

res = requests.get(url, headers=headers)
print(res.json())
Response (200 OK)
{
  "success": true,
  "job": {
    "id": "job_1788770854344_9a0891c8",
    "status": "completed",
    "theme_used": "pro_white",
    "format_used": "square",
    "output_url": "https://images.flashshot.io/renders/job_1788770854344_9a0891c8-garmin-fenix-7-flashshot-io.png",
    "parent_job_id": null,
    "created_at": 1788770854344
  }
}
GET

/v1/themes

Public Discovery

Returns active studio lighting theme keys, reference preview images, and supported aspect ratios. Cached at edge nodes.

Code Examples
curl https://api.flashshot.io/v1/themes
const response = await fetch('https://api.flashshot.io/v1/themes');
const { themes, formats } = await response.json();
console.log('Available themes:', themes.map(t => t.key));
console.log('Available formats:', formats.map(f => f.key));
import requests

res = requests.get("https://api.flashshot.io/v1/themes")
data = res.json()
print("Themes:", [t["key"] for t in data.get("themes", [])])
print("Formats:", [f["key"] for f in data.get("formats", [])])
Response (200 OK)
{
  "success": true,
  "themes": [
    { "key": "pro_white", "name": "The Studio White", "color": "bg-white", "reference_image_url": "..." },
    { "key": "natural_wood", "name": "The Oak Collection", "color": "bg-amber-800", "reference_image_url": "..." }
  ],
  "formats": [
    { "key": "square", "label": "Square (1:1)" },
    { "key": "portrait", "label": "Portrait (4:5)" },
    { "key": "story", "label": "Story (9:16)" }
  ]
}
GET

/v1/account

0 Credits (Free)

Retrieves account information, available credit balance, total lifetime renders, enterprise subscription status, and rate limit quotas for the authenticated key.

Code Examples
curl https://api.flashshot.io/v1/account \
  -H "Authorization: Bearer fs_live_YOUR_API_KEY"
const response = await fetch('https://api.flashshot.io/v1/account', {
  headers: {
    'Authorization': 'Bearer fs_live_YOUR_API_KEY'
  }
});

const result = await response.json();
console.log('Credits Balance:', result.account.credits.balance);
console.log('Tier:', result.account.tier);
import requests

headers = {
    "Authorization": "Bearer fs_live_YOUR_API_KEY"
}

res = requests.get("https://api.flashshot.io/v1/account", headers=headers)
account = res.json()["account"]
print("Available Credits:", account["credits"]["balance"])
Response (200 OK)
{
  "success": true,
  "account": {
    "user_id": "usr_1788770850_c1b2",
    "email": "renier@jrgelectronics.co.za",
    "tier": "enterprise",
    "credits": {
      "balance": 248,
      "total_used": 152
    },
    "rate_limits": {
      "requests_per_minute": 60,
      "max_concurrent_jobs": 10
    }
  }
}
GET

/v1/openapi.json

OpenAPI 3.1.0

Delivers the full OpenAPI 3.1.0 JSON specification document. Compatible with Postman, Insomnia, Swagger UI, SDK generators (openapitools, stainless), and autonomous AI agent discovery.

Code Examples
curl https://api.flashshot.io/v1/openapi.json -o openapi.json
const response = await fetch('https://api.flashshot.io/v1/openapi.json');
const openapiSpec = await response.json();
console.log('OpenAPI Version:', openapiSpec.openapi);
console.log('Title:', openapiSpec.info.title);
console.log('Endpoints:', Object.keys(openapiSpec.paths));
import requests

res = requests.get("https://api.flashshot.io/v1/openapi.json")
spec = res.json()
print("API Title:", spec["info"]["title"])
print("Version:", spec["info"]["version"])
print("Available Paths:", list(spec.get("paths", {}).keys()))
https://api.flashshot.io/v1/openapi.json Inspect Full JSON Spec

Interactive "Try It Out" Live Console

Execute live requests directly against the Cloudflare Workers v1 API in real-time.

Request Payload (JSON)
Live Response

                                
Rendered Preview
Live High-Res Render Output Open in High Resolution
Client Integration Brief JRG Electronics (Renier Gerber)

Authoritative Integration Q&A for JRG Electronics

The following section documents the specific technical answers provided to Renier Gerber (Founder & Managing Director, JRG Electronics) regarding programmatic integration into JRG's custom inventory and listing systems.

1

API Documentation: OpenAPI 3.1 & Interactive Explorer

Answer: The complete OpenAPI 3.1 specification is delivered at https://api.flashshot.io/v1/openapi.json, suitable for importing directly into Postman, Insomnia, or code generation tools. Interactive documentation and testing consoles are live on https://flashshot.io/docs. Autonomous AI coding agents (Cursor, Claude Code, Windsurf) can ingest our machine manifests at /llms.txt and /llms-full.txt.

2

API Access Credentials & Base URL

Answer: Programmatic calls authenticate against the base URL https://api.flashshot.io/v1 using either Authorization: Bearer fs_live_... or x-api-key: fs_live_.... API keys are provisioned self-service in the customer account modal under "API Keys & Integrations". The system operates on a unified live production environment with real-time atomic credit verification.

3

3-Try Refine Editor Integration Details

Answer: The refinement editor functions programmatically through POST /v1/refine. JRG's custom admin portal provides the prior render's job_id as parent_job_id alongside natural language adjustment instructions (e.g. "Reduce specular reflection on bezel and increase shadow softness"). To generate 3 variations simultaneously, fire 3 parallel asynchronous calls to /v1/refine. FlashShot pulls parent assets directly from internal R2 storage in sub-10ms without external roundtrips.

4

Delivery Mechanism: Synchronous 5–8s Execution (No Webhooks)

Answer: Both /v1/transform and /v1/refine are 100% synchronous. The API holds the HTTP connection and returns the completed high-resolution R2 CDN URL within 5–8 seconds. There is no need to host a webhook receiver or write a polling loop. The GET /v1/jobs/:id endpoint remains available for retrospective auditing or history retrieval.

5

Input & Output Specifications

Answer: Inputs are accepted via JSON payload with the image field formatted as either a Base64 data URI (data:image/jpeg;base64,...) or a publicly accessible HTTPS image URL (https://jrgelectronics.co.za/...). Maximum request size is ~4.5MB. Outputs are returned as high-resolution PNGs on Cloudflare R2 CDN (https://images.flashshot.io/renders/...), formatted to the requested aspect ratio (e.g. 1:1 square up to 2048x2048px), ready for JRG's downstream WebP conversion.

Autonomous AI Agent Discovery

FlashShot provides machine-readable specifications adhering to the llms.txt standard. Autonomous coding agents (Cursor, Claude Code, Windsurf, Copilot, GitHub Models) can automatically discover endpoints, request/response models, and auth requirements.

Lightweight Overview (/llms.txt)

Concise summary of endpoints, schemas, authentication, and credit rules for quick agent ingestion.

View /llms.txt
Full Technical Spec (/llms-full.txt)

Exhaustive TypeScript interfaces, JSON schemas, error response codes, and step-by-step agent integration flows.

View /llms-full.txt