Images
Generate, edit, or upscale images. Pawan.Krd exposes three OpenAI-compatible endpoints for image models depending on which type they declare.
Generate
POST
/v1/images/generations📋Request
1{
2 "model": "your-image-model",
3 "prompt": "A cozy cabin in the snowy woods at night, cinematic lighting",
4 "n": 1,
5 "size": "1024x1024",
6 "steps": 30,
7 "guidance_scale": 7,
8 "response_format": "url"
9}Parameters (generation)
modelstringrequired
Image model id (type: image-generation).
promptstringrequired
Text description of the image to generate.
ninteger
Number of images to generate.
sizestring
WIDTHxHEIGHT, e.g. "1024x1024".
aspect_ratiostring
Alternative to size, e.g. "16:9".
stepsinteger
Diffusion / sampling steps.
guidance_scalenumber
CFG scale — how strictly the model follows the prompt.
seedinteger
Deterministic seed.
negative_promptstring
Things you do not want in the image (when supported).
response_formatstring
"url" or "b64_json".
schedulerstring
Sampler/scheduler name (when supported).
Response
📋200 OK
1{
2 "created": 1700000000,
3 "data": [
4 { "url": "https://cdn.pawan.krd/images/abc123.png" }
5 ]
6}Edit (inpainting / instructed)
POST
/v1/images/editsUse multipart/form-data with an image file and an optional mask. Models with inpainting respect the mask's transparent regions; instructed models edit the whole image based on the prompt.
💻curl
1curl https://api.pawan.krd/v1/images/edits \
2 -H "Authorization: Bearer pk-your_key" \
3 -F model="your-image-model" \
4 -F image=@input.png \
5 -F mask=@mask.png \
6 -F prompt="Replace the sky with a sunset" \
7 -F size="1024x1024"Upscale
POST
/v1/images/upscaleUpscale an input image. The maximum supported factor is per-model (e.g. 2x, 4x, 8x).
💻curl
1curl https://api.pawan.krd/v1/images/upscale \
2 -H "Authorization: Bearer pk-your_key" \
3 -F model="your-upscale-model" \
4 -F image=@input.png \
5 -F upscale_factor=4✓
Async uploads
For large multipart bodies (high-res inputs, masks, etc.), prefer the file-form variants shown above instead of inline base64 to keep payload sizes small.