PierNode
Images

Generate Image

Create an image from a text prompt.

Turn a prompt into an image. The request returns a task; the image arrives when you poll it.

Minimal request

curl -X POST https://app.piernode.com/api/v1/images/generations \
  -H "Authorization: Bearer $PIERNODE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{"prompt": "a red ceramic teapot on a wooden table"}'
{
	"id": "fu0825tesv0laouebtjx0x5w",
	"status": "QUEUED",
	"createdAt": "2026-01-01T12:00:00.000Z"
}

The cost is reserved at this point. Nothing else is needed — every other field has a default.

Parameters

FieldTypeRequiredDefaultDescription
promptstringyes—1–2000 characters.
negativePromptstringno—Up to 1000 characters. What to steer away from.
resolutionstringno1k1k, 2k, 4k. Sets the price.
aspectRatiostringno1:11:1, 9:16, 16:9, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2.

Aspect ratio does not affect the price. Bodies are limited to 64 KB, and any field not listed is ignored.

A fuller example

curl -X POST https://app.piernode.com/api/v1/images/generations \
  -H "Authorization: Bearer $PIERNODE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
  -d '{
    "prompt": "a red ceramic teapot on a wooden table, studio lighting",
    "negativePrompt": "blurry, text, watermark",
    "resolution": "2k",
    "aspectRatio": "16:9"
  }'

Getting the result

Poll the task. On success:

{
	"status": "SUCCEEDED",
	"output": {
		"images": [{ "url": "https://...", "contentType": "image/png", "sizeBytes": 576963 }]
	}
}

Result links are signed and expire after an hour. Poll again for a fresh one — the stored image itself does not expire.

Errors

Status codes are listed in errors. A task that fails carries one of these in error.code:

CodeMeaning
GENERATION_FAILEDThe generation ran but produced no usable image.
PROVIDER_OUTPUT_INVALIDA result came back that could not be stored.
PROVIDER_UNAVAILABLEThe generation service could not be reached.
PROVIDER_SUBMIT_AMBIGUOUSThe generation could not be confirmed and was not retried.
GENERATION_TIMED_OUTIt did not finish in time.
NO_PROVIDER_CONFIGUREDThis task type cannot currently be run.

Any of them releases the reservation in full.

See also

On this page