Image Generation & Gallery
Generate AI images for articles, manage gallery & trash, edit existing images.
The Image Gallery is the central store for all AI-generated images of a team. Every image created in chat or in the article editor lands permanently under /images — with filters, tags, favorites, soft delete, and 30-day trash. The edit modal can produce variants (image-to-image via OpenAI gpt-image-2) that hang as children on the original. Public share links make individual images shareable without login.
What it can do
- Generate —
POST /v1/generate/imagecreates a new image for a prompt. Async, the result appears in the gallery. - Gallery & trash —
GET /v1/imageswith filters (q,model,from,to,favorite,tags[],sort,page).GET /v1/images/trashlists soft-deleted, 30-day retention, then automatic hard-delete. - Edit (soft edit) —
POST /v1/images/{id}/editstarts a variant async. Response 202 with{job_id, edit_session_id}, frontend polls/v1/images/{id}and sees the new variant invariants[]. - Metadata —
PATCH /v1/images/{id}fortitleandtags[],POST /v1/images/{id}/favoritetoggles the star. - Bulk operations — bulk delete/restore (max 200), bulk export as ZIP (max 500, async via
/v1/images/exports/{job_id}). - Public share — idempotent 40-char token, public URL without login with
noindex,nofollow, optional expiry, and view counter. Audit trail is preserved after revoke. - Open in chat —
POST /v1/images/{id}/open-in-chatcreates anAiChatSessionwithgallery_image_id; the agent can keep working with the image as a source.
When to use
- You need hero images, OG images, or inline visuals for your articles and want to archive them reusably.
- You want to nudge an existing AI visualization (color, detail, style) instead of regenerating from scratch.
- You want to share an image without a platform login with clients / editors.
- You want to bulk-export images — e.g. for a WordPress sync or an external DAM.
Workflow
- Generate —
POST /v1/generate/imagewith{prompt, model?}. The image lands in the gallery. - Browse & filter —
GET /v1/images?tags[]=hero&sort=newestlists matching images. - Edit —
POST /v1/images/{id}/editwith prompt → variant hangs on the parent. Frontend polls/v1/images/{id}untilvariants[]is populated. - Clean up —
DELETE /v1/images/{id}moves to trash (30-day restore window).DELETE /v1/images/{id}/forever(only from trash) deletes permanently. - Share or process further —
POST /v1/images/{id}/sharecreates a public link,POST /v1/images/{id}/open-in-chatopens a chat session with the image as context.
API
| Method | Endpoint | Description | Credits |
|---|---|---|---|
POST |
/v1/generate/image |
Generate a new image | 5 |
GET |
/v1/images |
List with filter & pagination | 0 |
GET |
/v1/images/trash |
Soft-deleted images | 0 |
GET |
/v1/images/{id} |
Detail incl. variants[] and parent |
0 |
POST |
/v1/images/{id}/edit |
Async edit (gpt-image-2), 202 + {job_id, edit_session_id} |
10 |
PATCH |
/v1/images/{id} |
Update title, tags[] |
0 |
POST |
/v1/images/{id}/favorite |
Toggle is_favorite |
0 |
DELETE |
/v1/images/{id} |
Soft delete | 0 |
POST |
/v1/images/{id}/restore |
Restore from trash | 0 |
DELETE |
/v1/images/{id}/forever |
Hard delete (only from trash) | 0 |
POST |
/v1/images/bulk/delete · bulk/restore |
Bulk operations, {ids:[]} max 200 |
0 |
POST |
/v1/images/bulk/export |
Async ZIP, max 500 IDs | 0 |
GET |
/v1/images/exports/{job_id} |
Export status + download_url |
0 |
POST |
/v1/images/{id}/open-in-chat |
Creates AiChatSession with the image |
0 |
POST/PATCH/DELETE |
/v1/images/{id}/share |
Manage public share | 0 |
Credits & Limits
- Generate: 5 credits.
- Edit: 10 credits (same tariff as Generate; OpenAI backend cost is higher on the edit endpoint).
- Bulk caps: delete/restore max 200 IDs, export max 500 IDs per request.
- Trash auto-prune: 30 days, then hard-delete via cron.
- PNG required for edits: JPEG/WEBP are converted server-side to PNG ≤4MB.
- Team scoped: cross-team → 404.
Related modules
- AI Content Editor — images from the gallery can be inserted directly into articles.
- Agentic Chat — generated images appear immediately in the gallery; Open in Chat opens a new edit session.
- Rankion OS — images can be referenced and shared in OS folders.
Letzte Aktualisierung: May 1, 2026