Creative Studio runs in BYOK mode. Pass your Gemini API key via the X-API-Key header on every write request. We do not store your key. Costs are billed directly by Google.
curl -H "X-API-Key: YOUR_GEMINI_KEY" https://photogen.ashbi.ca/api/generate
Get total spend, per-model breakdown, per-day breakdown, and image count.
curl https://photogen.ashbi.ca/api/costs
Test whether a Gemini API key is valid before using it.
curl -X POST -H "X-API-Key: YOUR_KEY" https://photogen.ashbi.ca/api/validate-key
Generate a single image. Returns immediately with a job ID. Poll /api/jobs/<id> for the result.
curl -X POST -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" -d '{"model": "gemini-3.1-flash-image-preview", "prompt": "A sleek bottle on marble", "ratio": "1:1", "product_image": "base64..."}' https://photogen.ashbi.ca/api/generateComposite a product image onto a generated background. Same async pattern as /generate.
curl -X POST -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" -d '{"prompt": "On a beach at sunset", "product_image": "base64...", "ratio": "4:3"}' https://photogen.ashbi.ca/api/compositePoll for job status. Returns running, done (with image URL + cost), or error.
curl https://photogen.ashbi.ca/api/jobs/job_abc123
Serve a generated image. Paths are relative to the output directory.
| Model | Price / image |
|---|---|
| gemini-3.1-flash-image-preview (1K) | $0.045 |
| gemini-3.1-flash-image-preview (2K) | $0.090 |
| gemini-3-pro-image-preview (2K) | $0.240 |
| imagen-4.0-fast-generate-001 | $0.02 |
| imagen-4.0-generate-001 | $0.04 |
| imagen-4.0-ultra-generate-001 | $0.06 |