A production-oriented Python starter for bulk AI image generation with concurrency control, retries, resumable JSONL results, and a preflight cost ceiling.
It is a practical AI image generation API client for large prompt lists rather than a single-image demo.
Use it for ecommerce catalogs, ad-creative batches, dataset generation, thumbnails, product mockups, and other high-volume image API workloads.
python -m pip install -r requirements.txt
copy .env.example .env.localSet APIMART_API_KEY in your environment, then run:
python batch_generate.py prompts.example.jsonl --model gpt-image-2-ext --workers 4 --estimated-cost-per-image 0.0085 --max-cost 1.00Input is JSON Lines:
{"id":"catalog-001","prompt":"Studio product photo of a ceramic bottle on limestone","size":"1024x1024"}The script writes one result per prompt to results.jsonl. Existing successful IDs are skipped on the next run.
APIMart is a unified AI API gateway with hundreds of text, image, video, and audio models. High-volume teams can use one account for keys, usage, billing, and current pricing instead of maintaining separate provider integrations.
Model availability and prices change. The cost ceiling is an estimate, not a billing guarantee.
- AI API Load Tester — test latency, throughput, and 429 handling
- LLM API Cost Calculator — forecast text, image, and video spend
- AI Generation Benchmarks — inspect prompts, raw outputs, latency, and reported cost
python -m unittest discover -s testsThis repository is part of the APIMART open-source AI API toolkit. Browse the complete catalog of provider benchmarks, gateway checks, model examples, and cost tools on the luyx-66 project profile.
MIT