Agent skill

Image Generation

by letta-ai in letta-ai/letta-code

Generate images from text prompts (and optionally edit/remix input images).

Apache-2.0Auto-check passedMedia & Creative

Install Image Generation

skills CLI
$ npx skills add letta-ai/letta-code --skill image-generation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install letta-ai/letta-code image-generation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/letta-ai/letta-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/builtin/image-generation .claude/skills/image-generation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
image-generation
GitHub stars
3.6k
Token cost
~1.3k tokens
SKILL.md length
484 words
Files
1
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generate images from text prompts (and optionally edit/remix input images).

  • The user asks to create
  • SKILL.md covers Example, Request body, Response and Editing / remixing images, plus 1 more section
  • Calls curl and python3; reaches api.letta.com; needs LETTA_API_KEY
  • Tasks that involve Image generation

What it does

Image Generation is an agent skill from letta-ai/letta-code. Generate images from text prompts (and optionally edit/remix input images). Use when the user asks to create, generate, draw, render, or edit an image, illustration, logo, icon, diagram, or photo.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Media & Creative, covering Image generation. It works with Letta and OpenAI. The repository describes itself as: Stateful agents that are like people, with memory, identity, and the ability to learn and adapt. The licence is Apache-2.0.

When your agent uses it

  • The user asks to create
  • Tasks that involve Image generation

Example prompts

  • “/image-generation”

Requirements

  • Python 3
  • A credential in LETTA_API_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit d31b879. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.letta.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • LETTA_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Image Generation loads about 1.3k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 484 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from letta-ai/letta-code at commit d31b879, republished under its Apache-2.0 licence (© letta-ai). 484 words, ~1,254 tokens.

Download SKILL.mdSave it as .claude/skills/image-generation/SKILL.md (or your agent's skills folder).
name
image-generation
description
Generate images from text prompts (and optionally edit/remix input images). Use when the user asks to create, generate, draw, render, or edit an image, illustration, logo, icon, diagram, or photo.

Image Generation

Generate images via Letta's hosted endpoint POST /v1/images/generations. The API usually returns base64 image bytes, but some providers return signed image URLs; save either form to a local image file before replying.

Example

Generate the image, save it locally, then show it inline:

bash
base_url="${LETTA_BASE_URL%/}"

curl -sS -X POST "$base_url/v1/images/generations" \
  -H "Authorization: Bearer $LETTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider":"gemini","prompt":"a friendly robot mascot waving, flat vector logo, mint green background","n":1}' \
  > image-response.json

python3 - <<'PY'
import base64, json, urllib.request

with open("image-response.json") as f:
    response = json.load(f)

image = response["images"][0]
if image.get("b64_json"):
    data = base64.b64decode(image["b64_json"])
else:
    data = urllib.request.urlopen(image["url"]).read()

with open("robot-mascot.png", "wb") as f:
    f.write(data)

print("saved robot-mascot.png")
PY

In Bash tools launched by Letta Code, use the runtime-provided LETTA_BASE_URL and LETTA_API_KEY together for Letta API calls. Build URLs relative to ${LETTA_BASE_URL%/} and send Authorization: Bearer $LETTA_API_KEY. Do not hardcode https://api.letta.com: Desktop and remote runtimes may provide a proxy base URL, and the credential may only be valid through that URL. If either variable is missing, the user needs to authenticate with Letta Cloud (or provide a Letta API key); do not ask for an OpenAI/Gemini provider key. This endpoint also does not use /connect BYOK providers — the only provider values supported here are flux, gemini, and openai.

Then show the image to the user by embedding the saved file in your reply:

markdown
Here's the mascot:

![a friendly robot mascot waving, flat vector logo](./robot-mascot.png)

The Letta Code UI renders local file paths in markdown image tags, so the image appears inline. Always display generated images this way — don't just report the path, and never paste the raw base64 / a data: URI. The markdown path must match where you saved the file. For n > 1, save each image to its own file and embed each on its own line. Keep credit amounts and billing metadata out of user-facing replies and captions unless the user asks about cost. When asked, read billing.credits_charged from the saved response.

Show full SKILL.md (235 more words)Show less

Request body

FieldTypeNotes
provider"flux" | "gemini" | "openai"Required.
promptstringRequired, 1–32000 chars.
modelstringOptional; defaults per provider (below).
nint 1–4Optional, default 1. Request variations in one call.
sizestringOptional, e.g. "1024x1024" (OpenAI).
qualitylow|medium|high|autoOptional (OpenAI; higher = more credits).
output_formatpng|jpeg|webpOptional (OpenAI).
input_imagesstring[] (max 14)Optional. Base64 data URLs for edit/remix.
seedintOptional.
ProviderDefault modelUse for
fluxflux-2-proDefault for normal text-to-image. High-quality general image generation; commonly returns signed URLs.
geminigemini-3-pro-imageStrong prompt adherence, image editing/remix.
openaigpt-image-2Photoreal output, explicit size/quality/output_format.

Default to flux for normal text-to-image requests. Use gemini when the user provides input images or wants image editing/remix. Use openai when the user wants photoreal output or a specific size/quality.

Response

json
{
  "provider": "gemini",
  "model": "gemini-3-pro-image",
  "images": [{ "b64_json": "<base64>", "mime_type": "image/png" }],
  "billing": { "credits_charged": 12, "...": "..." }
}

Each images[] entry has either b64_json or url, plus mime_type. Gemini always returns b64_json. Flux commonly returns a signed url; download it to your local image file immediately because signed URLs expire. If OpenAI returns a url, download that URL instead of base64-decoding.

Editing / remixing images

Pass source images in input_images as base64 data URLs (data:<mime>;base64,<data>) and describe the edit in prompt. Gemini handles multi-image edits well. To build a data URL from a local file:

bash
DATA_URL="data:image/png;base64,$(base64 < input.png | tr -d '\n')"

Notes

  • Billing: every success charges credits; don't loop needlessly.
  • Errors: 402 = insufficient credits (credits_required in body); 400/500 return { "message": "..." } — surface it to the user.
  • Only flux, gemini, and openai are supported here.

© letta-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in src/skills/builtin/image-generation of letta-ai/letta-code.

Open the folder on GitHubat commit d31b879

Compare with similar skills

Image Generation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Image Generation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Image Generation this skillletta-ai/letta-code3.6k—~1.3kAutomated safety check: PassApache-2.0
Nano Banana Pro Prompts Recommend SkillYouMind-OpenLab/nano-banana-pro-prompts-recommend-skill1.9k1 repos~4.1kAutomated safety check: PassNone
Yingzaoop7418/guizang-yingzao-skill496—~1.1kAutomated safety check: PassNone
AI Image Creatorcentminmod/my-claude-code-setup2.7k—~8.1kAutomated safety check: NotesMIT
Character Refseternityspring/shuohao-skills4.3k—~1.7kAutomated safety check: WarnApache-2.0
Basic Memory Repo Imagesbasicmachines-co/basic-memory4.1k—~2.7kAutomated safety check: PassAGPL-3.0

Similar skills

  • Nano Banana Pro Prompts Recommend Skill

    YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill

    Recommend suitable prompts from 10,000+ Nano Banana Pro image generation prompts based on user needs.

    1.9k GitHub starsUsed in 1 repo~4.1k tokens
    Media & CreativeAuto-check passed
  • Yingzao

    op7418/guizang-yingzao-skill

    Transform real Chinese architecture and place-based cultural photos into art-directed editorial posters, integrated multi-photo scenes, and optional source comparisons.

    496 GitHub stars~1.1k tokensUpdated 1 mo ago
    Media & CreativeAuto-check passed
  • AI Image Creator

    centminmod/my-claude-code-setup

    Generate, edit-from-reference, or analyze images with AI via OpenRouter (Gemini, GPT Image, Seedream, Qwen, MAI, Grok, FLUX.2, Recraft, Muse, Riverflow; Cloudflare AI Gateway BYOK).

    2.7k GitHub stars~8.1k tokensUpdated 2 days ago
    Media & CreativeAuto-check: notes
  • Character Refs

    eternityspring/shuohao-skills

    给任何故事里的角色真出参考图(小说改编、自己原创的故事、单独设计一个角色都行,不需要小说原文): 一段话描述角色,拆成分层字段、补全后确认, 先出一张正面全身锚点,其余视图(大头照、90° 侧面、背面、细节、45° 大头照)都只参考这张锚点, 按需分档出图。每张图带标识、可单独重出,重出后自动标出哪些图过期。

    4.3k GitHub stars~1.7k tokensUpdated 2 days ago
    Media & CreativeAuto-check: warnings
  • Basic Memory Repo Images

    basicmachines-co/basic-memory

    Produces PR, changelog and two-week retro images for the Basic Memory repository from evidence in PR bodies, saved to fixed paths under docs/assets/infographics.

    4.1k GitHub stars~2.7k tokensUpdated today
    Media & CreativeAuto-check passed
  • Chatgpt Image Ad

    krusemediallc/arcads-claude-code

    Generate one or more standalone Meta image-ad creatives via ChatGPT Image 2 (gpt-image-2) through the Arcads external API.

    1.6k GitHub stars~2.7k tokensUpdated 18 days ago
    Media & CreativeAuto-check: notes

More from letta-ai/letta-code

All 25 skills in this repo
  • Creating Skills

    letta-ai/letta-code

    Guide for creating effective skills. An agent skill from letta-ai/letta-code.

    3.6k GitHub stars~4.6k tokensUpdated today
    Auto-check passed
  • Generating Mod Envs

    letta-ai/letta-code

    Generates and reviews mod learning env JSON files for Letta Code local mods.

    3.6k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Initializing Memory

    letta-ai/letta-code

    Comprehensive guide for initializing or reorganizing agent memory.

    3.6k GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Self Configuration

    letta-ai/letta-code

    Inspect or modify Letta Code's own memory, model, context window, system prompt, compaction, permissions, toolsets, mods, skills, channels, schedules, agent secrets, and local runtime settings.

    3.6k GitHub stars~7k tokensUpdated today
    Auto-check passed
  • Browser Use

    letta-ai/letta-code

    Control a real browser to navigate pages, click, type, fill forms, inspect rendered UI, take screenshots, or record video.

    3.6k GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Creating Mods

    letta-ai/letta-code

    Creates and edits trusted local Letta Code mods, including tools, slash commands, local-only model providers, lifecycle/turn events, scoped conversation helpers, panels, and capability-gated behavior.

    3.6k GitHub stars~2.5k tokensUpdated today
    Auto-check passed

Works with

Questions about Image Generation

What does Image Generation do?

Generate images from text prompts (and optionally edit/remix input images). Image Generation is an agent skill from letta-ai/letta-code. Generate images from text prompts (and optionally edit/remix input images).

When should I use Image Generation?

Image Generation fits situations like: the user asks to create; tasks that involve Image generation.

How do I install Image Generation in Claude Code?

Run `npx skills add letta-ai/letta-code --skill image-generation -a claude-code`. Or copy the skill folder (src/skills/builtin/image-generation in letta-ai/letta-code) into .claude/skills/image-generation in your project. Claude Code loads it when a task matches its description.

How do I install Image Generation in Codex?

Run `npx skills add letta-ai/letta-code --skill image-generation -a codex`. Or copy the skill folder (src/skills/builtin/image-generation in letta-ai/letta-code) into .agents/skills/image-generation in your project. Codex loads it when a task matches its description.

Can I use Image Generation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add letta-ai/letta-code --skill image-generation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/image-generation, .gemini/skills/image-generation, .github/skills/image-generation and .opencode/skills/image-generation in your project.

What does Image Generation need to run?

Going by SKILL.md and its folder, Image Generation needs the command-line tools its instructions call (curl and python3) and credentials named LETTA_API_KEY. Our summary lists: Python 3; A credential in LETTA_API_KEY.

Does Image Generation access the network?

SKILL.md names 1 domain. In commands or code: api.letta.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Image Generation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Image Generation use?

Image Generation is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Image Generation use?

About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Image Generation?

Skills that share tags, products or a category with Image Generation: Nano Banana Pro Prompts Recommend Skill (YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill, 1.9k stars), Yingzao (op7418/guizang-yingzao-skill, 496 stars), AI Image Creator (centminmod/my-claude-code-setup, 2.7k stars) and Character Refs (eternityspring/shuohao-skills, 4.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Image Generation?

letta-ai (a GitHub organization) maintains it in letta-ai/letta-code, which has 3,562 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 10, 2026.

Source: letta-ai/letta-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.