Generate, cache, and retrieve images via HTTP. Accepts text prompts, optional reference images, model selection, and filename-based recall.
https://imfin.it/api/generateAll examples use the production base. Replace with your custom domain if configured.
https://api.imfin.it/prompt/modelUse the api subdomain for clean URLs. The first path segment is the prompt, the second (optional) is the model.
gemini | ultra | svg | imagen4 | seedream-4 | nano-banana | nano-banana-pro | nano-banana-2 | gpt-image-2 (legacy nanobanana aliases still work). The nano-banana* models use the Google Generative Language API (set GEMINI_API_KEY); gpt-image-2 is OpenAI’s GPT Image 2 routed through the Vercel AI Gateway.1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, etc. Default is 16:9. Supported by: gemini, ultra, imagen4, seedream-4, gpt-image-2, and default flux-1.1-pro models.image=).name, slug): Friendly name to store the generation under, and to recall later without a prompt.filename, request a specific format: jpg or png.true, bypass cache and generate a fresh variation.ultra).https://imfin.it/api/generate?prompt=modern+home&model=seedream-4&ar=16:9&image=https://example.com/a.jpg&image=https://example.com/b.jpg&filename=hero&reroll=trueChange colors indicate different parameter groups: prompt, model, aspect ratio, image(s), caching, and flags.
https://imfin.it/api/generate?prompt=cinematic+sunset+city&model=geminihttps://imfin.it/api/generate?prompt=enhance+lighting&model=seedream-4&image=https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?w=1024https://imfin.it/api/generate?prompt=clean+studio+look&model=seedream-4&image=https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?w=1024&image=https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=1024https://imfin.it/api/generate?prompt=hero+bottle+shot&model=seedream-4&filename=herohttps://imfin.it/api/generate?filename=herohttps://imfin.it/api/generate?filename=hero&ext=pnghttps://imfin.it/api/generate?prompt=cinematic+sunset+city&model=gemini&reroll=truehttps://imfin.it/api/generate?prompt=minimal+isometric+room&model=geminihttps://imfin.it/api/generate?prompt=macro+photo+dew+drops+on+leaf&model=geminihttps://imfin.it/api/generate?prompt=neon+city&model=ultra&raw=truehttps://imfin.it/api/generate?prompt=flat+vector+cat+icon&model=svghttps://imfin.it/api/generate?prompt=clean+product+shot&model=imagen4https://imfin.it/api/generate?prompt=match+style&model=seedream-4&image=https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?w=1024https://imfin.it/api/generate?prompt=fast+sketch+icon&model=nano-banana-2&ar=1:1https://imfin.it/api/generate?prompt=detailed+poster+with+text&model=nano-banana-pro&ar=3:4https://imfin.it/api/generate?prompt=poster+with+crisp+small+text&model=gpt-image-2&ar=2:3https://imfin.it/api/generate?prompt=portrait+photo&model=gemini&ar=9:16https://imfin.it/api/generate?prompt=square+logo&model=ultra&ar=1:1https://imfin.it/api/generate?prompt=banner&model=imagen4&ar=21:9https://imfin.it/api/generate?prompt=classic+photo&model=seedream-4&ar=3:2https://imfin.it/api/generate?prompt=studio+retouch&model=seedream-4&image=https://example.com/a.jpghttps://imfin.it/api/generate?prompt=studio+retouch&model=seedream-4&image_url=https://example.com/a.jpghttps://imfin.it/api/generate?prompt=studio+retouch&model=seedream-4&init_image=https://example.com/a.jpghttps://imfin.it/api/generate?prompt=studio+retouch&model=seedream-4&images=https://example.com/a.jpg,https://example.com/b.jpghttps://imfin.it/api/generate?prompt=hero+banner&model=gemini&filename=homepage-herohttps://imfin.it/api/generate?filename=homepage-herohttps://imfin.it/api/generate?filename=homepage-hero&ext=pnghttps://imfin.it/api/generate?prompt=cinematic+sunset+city&model=gemini&reroll=truehttps://imfin.it/api/generate?prompt=highly+realistic+portrait&model=ultra&raw=truenano-banana, nano-banana-pro, and nano-banana-2 call the Google Generative Language API directly (not Replicate). The deployment must define GEMINI_API_KEY (or GOOGLE_API_KEY / GOOGLE_GENERATIVE_AI_API_KEY). Response Content-Type may be image/png or image/jpeg; X-Model is the Gemini model id (e.g. gemini-2.5-flash-image). Reference URLs: up to 3 for nano-banana, up to 16 for nano-banana-pro and nano-banana-2.
https://imfin.it/api/generate?prompt=nano+banana+still+life&model=nano-banana-2&ar=1:1https://imfin.it/api/generate?prompt=logo+on+product+mockup&model=nano-banana-pro&image=https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?w=512If you are logged in, include x-parse-session-token in the request headers to apply credit billing. Insufficient credits return HTTP 402 with a JSON error.
X-Cache-Status: HIT for cached, MISS-GENERATED for fresh generations.X-Cache-Store: s3 or fs (local).X-S3-Key: S3 object key when applicable.X-Model: upstream model identifier (Replicate slug or Gemini model id).Content-Disposition: present when filename is supplied (inline with suggested filename).filename not found.