Grok Bot runs an external image API via a Skill with fixed references and no paid retries
Source read in full
Overview
Daily posts need covers and illustrations of the author's signature character. Generating, downloading and reuploading the images used to mean switching between several tools.
Workflow
- Prepare 3 API parameters: API Key, Base URL and model name. Before adding credit, check whether the proxy's docs list
/images/generations(many only implement/chat/completions) and whether it returns Base64 or an image URL. - Have Grok Bot write the script (excerpt from the author's prompt): Use codex cil to help develop a lightweight image generation script in Python that calls the proxy's OpenAI GPT image generation API directly. Support text-to-image, generation with a reference image and image editing. Generate 2 versions of each image in one call. Save images locally and output the file paths. Manage the API Key as an environment variable and use the standard library where possible. No Web UI, database or standalone server is needed. The source also includes a minimal
image.pyof around 30 lines (pip install openai,timeout=180, max_retries=1). - Save it as the GPT External Image Generation skill (points from the author's second prompt): Trigger it whenever the user explicitly asks to generate an image or call an external image model. Extract the visual description, run the script, and return the saved files as chat attachments. Return the specific error immediately if a call fails, and never automatically retry a paid request. Find the matching image in the asset pack when triggered.
- Check: Ask GPT to draw a 16:9 technology-themed post cover in cool colors with no text. Confirm three things: it really used the external API, saved the image to the folder, and returned the image in chat.
- Set up fixed character assets: Create
references/muon.png(character reference),prompts/muon.txt(appearance description) andgenerated_images/on the cloud computer. Switch the script to the image editing API. Add a skill rule to read the description and attach the reference automatically when Muon is mentioned, keeping the character's core appearance intact.
Key points and results
- Split the work: Use native Grok Bot generation for the occasional image and an inexpensive external API for frequent images in a specific style.
- Keep API Keys out of skill text. Skills are easy to share or export, so store keys in an environment variable or credential store.
- Never automatically retry paid requests. A network stall could otherwise trigger more than ten calls in the background.
- An external API saves on image costs only. Grok Bot still uses its allowance to interpret instructions, call the terminal and transfer files.
- The author says costs fell to a fraction and gives no specific price comparison.
Source
- Platform
- X
- Author
- arito_si
- Published
- Categories
- Content and writing
What this evidence label means
Source read in full
We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.