imfinit
API reference

imfinit Image Generation API

Generate, cache, and retrieve images via HTTP. Accepts text prompts, optional reference images, model selection, and filename-based recall.

Base

https://imfin.it/api/generate

All examples use the production base. Replace with your custom domain if configured.

Subdomain Shortcut

https://api.imfin.it/prompt/model

Use the api subdomain for clean URLs. The first path segment is the prompt, the second (optional) is the model.

Query parameters

Color‑coded URL anatomy

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=true

Change colors indicate different parameter groups: prompt, model, aspect ratio, image(s), caching, and flags.

Examples

1) Text‑to‑image

https://imfin.it/api/generate?prompt=cinematic+sunset+city&model=gemini
Example: text-to-image

2) Image‑guided (single reference, Seedream‑4)

https://imfin.it/api/generate?prompt=enhance+lighting&model=seedream-4&image=https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?w=1024
Example: image-guided

3) Image‑guided (multiple references)

https://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=1024
Example: multi reference

4) Name and recall later

https://imfin.it/api/generate?prompt=hero+bottle+shot&model=seedream-4&filename=hero
https://imfin.it/api/generate?filename=hero
Example: named generation

5) Force PNG when recalling by name

https://imfin.it/api/generate?filename=hero&ext=png

6) Refresh a cached image

https://imfin.it/api/generate?prompt=cinematic+sunset+city&model=gemini&reroll=true

Parameter‑specific examples

prompt

https://imfin.it/api/generate?prompt=minimal+isometric+room&model=gemini
https://imfin.it/api/generate?prompt=macro+photo+dew+drops+on+leaf&model=gemini

model

https://imfin.it/api/generate?prompt=neon+city&model=ultra&raw=true
https://imfin.it/api/generate?prompt=flat+vector+cat+icon&model=svg
https://imfin.it/api/generate?prompt=clean+product+shot&model=imagen4
https://imfin.it/api/generate?prompt=match+style&model=seedream-4&image=https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?w=1024
https://imfin.it/api/generate?prompt=fast+sketch+icon&model=nano-banana-2&ar=1:1
https://imfin.it/api/generate?prompt=detailed+poster+with+text&model=nano-banana-pro&ar=3:4
https://imfin.it/api/generate?prompt=poster+with+crisp+small+text&model=gpt-image-2&ar=2:3

aspect ratio (ar)

https://imfin.it/api/generate?prompt=portrait+photo&model=gemini&ar=9:16
https://imfin.it/api/generate?prompt=square+logo&model=ultra&ar=1:1
https://imfin.it/api/generate?prompt=banner&model=imagen4&ar=21:9
https://imfin.it/api/generate?prompt=classic+photo&model=seedream-4&ar=3:2

image inputs

https://imfin.it/api/generate?prompt=studio+retouch&model=seedream-4&image=https://example.com/a.jpg
https://imfin.it/api/generate?prompt=studio+retouch&model=seedream-4&image_url=https://example.com/a.jpg
https://imfin.it/api/generate?prompt=studio+retouch&model=seedream-4&init_image=https://example.com/a.jpg
https://imfin.it/api/generate?prompt=studio+retouch&model=seedream-4&images=https://example.com/a.jpg,https://example.com/b.jpg

filename, ext

https://imfin.it/api/generate?prompt=hero+banner&model=gemini&filename=homepage-hero
https://imfin.it/api/generate?filename=homepage-hero
https://imfin.it/api/generate?filename=homepage-hero&ext=png

reroll & raw

https://imfin.it/api/generate?prompt=cinematic+sunset+city&model=gemini&reroll=true
https://imfin.it/api/generate?prompt=highly+realistic+portrait&model=ultra&raw=true

Nano Banana models (Google API)

nano-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:1
https://imfin.it/api/generate?prompt=logo+on+product+mockup&model=nano-banana-pro&image=https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?w=512

Authentication and credits

If 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.

Response headers

Errors