Skip to content

Image Generation

Runnit image generation is a single-call, auto-save operation. One request generates an image, downloads it server-side, and saves it straight into your asset library: you never handle binary data or base64 payloads.

Open a conversation about your project and describe the image you need. Include the subject, style and intended size or aspect ratio. Ru generates and saves the image, then shows the result in chat and in the project’s Assets tab.

Each generated image appears once on the project. If it is already available there, automatic filing reuses it. Copies saved to another destination keep their AI creator attribution. Existing duplicate files are not removed automatically. See Assets for organising saved files.

When you call the image-generation endpoint, Runnit:

  1. Generates the image (default model fal-ai/nano-banana).
  2. Downloads the result server-side.
  3. Saves it into the unified assets system.
  4. Returns a lightweight success response with the saved asset metadata.

This collapses what used to be a three-step workflow (generate → download → save) into one request, which keeps token usage low for AI agents.

Send a POST to /api/images/generate with at least a prompt, a file name, and either a jobId or a requestId:

Terminal window
curl -X POST https://api.runnit.io/api/images/generate \
-H "Content-Type: application/json" \
-H "X-Agent-Api-Key: <your-agent-api-key>" \
-d '{
"organizationId": "your-org-id",
"jobId": "your-job-id",
"prompt": "A beautiful sunset over mountains",
"fileName": "sunset.jpg",
"description": "Hero image for the launch campaign",
"aspectRatio": "16:9",
"outputFormat": "jpeg"
}'
FieldRequiredNotes
promptYesDescription of the image to generate.
fileNameYesSaved file name; include .jpg or .png.
jobId or requestIdOne requiredAssociates the asset with a job.
organizationIdYesMust match your agent API key’s organisation.
numImagesNo1–10, defaults to 1.
aspectRatioNoDefaults to 1:1.
outputFormatNojpeg or png, defaults to jpeg.
descriptionNoStored on the asset; recommended for organisation.
{
"success": true,
"message": "Images generated and saved successfully",
"assets": [
{
"id": "asset-uuid",
"fileName": "sunset.jpg",
"fileType": "image",
"mimeType": "image/jpeg",
"fileSize": 125432,
"createdAt": "2025-10-08T12:00:00Z"
}
],
"generationInfo": {
"model": "fal-ai/nano-banana",
"prompt": "A beautiful sunset over mountains",
"aspectRatio": "16:9",
"outputFormat": "jpeg"
}
}

The saved image is immediately viewable in the app under the associated job’s assets.

Image generation uses the organisation’s active AI billing mode. A platform credit organisation needs enough credits to cover the estimated request, and the member making the request must hold a paid seat (Go, Pro, or Enterprise); image generation is not included in the free plan. An own-key organisation needs its fal.ai key under Settings → AI API Keys; Runnit never falls back to a platform key in that mode. See AI Credits for top-ups and key setup, and Billing and subscriptions for seats.