gemini-2.5-flash) to generate social media captions from your images and optional intent text. You can generate a generic caption for all platforms or request a caption tuned to a specific platform’s style and constraints.
How it works
Open the AI caption panel
In the post editor, click Generate with AI. The panel appears alongside the caption field.
Provide context (optional)
Enter a short
prompt describing your intent — for example, “promoting a weekend sale” or “behind the scenes at our studio”. If you leave this blank, Gemini analyses the image alone.Attach images
Upload one or more images. The
media array is passed to Gemini as image parts, enabling the model to match the caption to the visual content.Choose a generation mode
- Generic (
POST /api/generate/captions) — produces a caption suitable for any platform. - Platform-specific (
POST /api/generate/captions/:platform) — tailors the output to the character limits, tone, and conventions of the chosen platform.
Generic caption generation
CallPOST /api/generate/captions with your prompt and media.
POST /api/generate/captions
Gemini system prompt (generative.controller.ts)
200 response
Platform-specific caption generation
CallPOST /api/generate/captions/:platform to generate a caption optimised for a particular platform. The buildPlatformPrompt function constructs a prompt that incorporates the platform’s character limits, style guidelines, and best practices.
POST /api/generate/captions/bluesky
bluesky · threads · instagram · facebook · mastodon · tumblr
Rate limits and quotas
Two limits apply to AI caption generation:Per-user plan limit
Tracked in
user.usage.captionGenerations vs user.limits.maxCaptionGenerations. Exceeding this returns a 429 with a plan upgrade prompt.API rate limit
A sliding window rate limiter (
ai_caption) allows 50 requests per hour per user across both caption endpoints, enforced before the plan limit check.Sending media to Gemini
ThebuildImageParts helper converts the media array from the request body into Gemini-compatible Part objects. Each entry should contain:
media array item shape
GenAi.models.generateContent() using model gemini-2.5-flash.
Caption generation call (generative.controller.ts)
Using generated captions in a post
After generation, the caption text is populated into thecontent.text field of the post editor. You can:
- Accept it as-is and publish or schedule the post.
- Edit the text before saving.
- Run generation again to get a different result.
- Copy the caption to a specific platform’s
platformSpecificContentfield if you want it to apply only to one platform while keeping a different caption for others.
Instagram-specific tips
Instagram-specific tips
Instagram captions support up to 2,200 characters. The generic generator targets 2–3 lines of body text followed by a block of 8 hashtags. For best results, attach a high-resolution image so Gemini can match the visual context.
Bluesky-specific tips
Bluesky-specific tips
Bluesky posts are capped at 300 characters including hashtags. Use
POST /api/generate/captions/bluesky to ensure the output fits the constraint. The platform-specific prompt instructs the model to stay within the limit.Mastodon-specific tips
Mastodon-specific tips
Mastodon instances have configurable character limits (typically 500). The platform-specific generator targets this range. Content-warning fields and content sensitivity are not currently set automatically.
Tumblr-specific tips
Tumblr-specific tips
Tumblr supports rich long-form text. The platform-specific prompt allows the model to produce more expansive copy suited to blog-style posts.
API reference
| Method | Endpoint | Description |
|---|---|---|
POST | /api/generate/captions | Generate a generic caption from a prompt and images. |
POST | /api/generate/captions/:platform | Generate a caption tailored to the specified platform. |
Authorization: Bearer <token> header and a JSON body with optional prompt (string) and media (array of base64 image objects).