← Back to Blog

How to Run an AI Image Generation Agent with OE Runtime

Turn text descriptions into high-quality images automatically. OE Runtime lets you run an AI image generation agent locally — no cloud platform, no monthly subscription, just a YAML file and a binary.

🎨
Step 1
Plan the Prompt
Design a detailed prompt with style, lighting, composition, and aspect ratio details.
Step 2
Generate Image
Call the image generation tool with the crafted prompt and retrieve the image URL.
Step 3
Report
Return the final prompt used, image URL, and style notes for future reference.

What You Need


Create the Project Folder

Create a folder called image-generation/ and add these two files:

image-generation/
├── SKILL.md         # the portable skill (agentskills.io)
├── agent.yaml       # wires SKILL.md to your connector
└── oe-config.json  # LLM key + connector credentials

The Skill Files

Create SKILL.md inside an image-generation/ directory. This is the portable skill — it follows the agentskills.io format and runs unchanged on Claude, Cursor, Windsurf, or OE Runtime:

---
name: image-generation
description: Generate images from text descriptions using AI
license: Apache-2.0
metadata:
  author: Open Enthrium
  version: "1.0"
---

You are a creative image generation agent. Craft detailed prompts and generate high-quality images.
If the concept is vague, enhance it with artistic style, lighting, and composition details before generating.
Complete all steps fully before writing your report.

## Step 1: Plan the Prompt
Design a detailed image generation prompt for a professional product showcase photo.
The subject: a sleek laptop on a minimalist desk with soft natural lighting.
Enhance with: camera angle, lighting style, color palette, mood, and aspect ratio (16:9).

## Step 2: Generate Image
Submit the prompt to the OpenAI Image connector.
POST /images/generations with body:
{
  "model": "gpt-image-1",
  "prompt": "<detailed prompt from previous step>",
  "n": 1,
  "size": "1024x1024"
}
The response will contain data[0].local_path with the saved image file path. Report that path.

## Step 3: Report
Summarize the result:
- The final prompt used
- Any enhancements made to the original concept
- Image URL
- Style and composition notes for future reference

Create agent.yaml in the same directory to wire the skill to your connector:

name: Image Creator
description: Generate images from text descriptions using AI
connectors:
  - connection_name: OpenAI Image
    connection_type: openai-image
skills:
  - path: ./
    trigger_type: auto

The Config File

Create oe-config.json in the same directory:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "YOUR_OPENAI_API_KEY"
  },
  "server": {
    "enabled": false,
    "port": 3333,
    "apiKey": "your-secret-api-key"
  },
  "connectors": [
    {
      "connection_name": "OpenAI Image",
      "connection_type": "openai-image",
      "bearerToken": "YOUR_OPENAI_API_KEY",
      "baseUrl": "https://api.openai.com/v1",
      "model": "gpt-image-1"
    }
  ]
}

Replace YOUR_OPENAI_API_KEY with your key from platform.openai.com/api-keys.

Download OE Runtime

OE Runtime — Direct Downloads

Run the Agent

From the parent folder containing your skill directory:

MethodBest forDownload
1 npx recommended No install needed — always runs the latest version —
2 Windows .exe Download once, run offline on Windows ⊞ Windows (.exe)
3 macOS binary Download once, run offline on Mac  macOS
4 Linux binary Server deployments, cron jobs, Docker 🐧 Linux
5 API Server integration Call from any app, webhook, or automation pipeline 📮 Postman Collection

1 npx recommended

npx -y @openenthrium/oe-runtime@latest ./image-generation

2 Windows

oe-runtime-win.exe ./image-generation

3 macOS

chmod +x oe-runtime-macos
./oe-runtime-macos ./image-generation

First run blocked? System Settings → Privacy & Security → Allow Anyway.

4 Linux

chmod +x oe-runtime-linux
./oe-runtime-linux ./image-generation

5 API Server integration

Add a "server" block to oe-config.json, then start with --serve:

{
  "llm": { ... },
  "server": { "enabled": true, "port": 3333, "apiKey": "your-secret-key" },
  "connectors": [ ... ]
}
npx -y @openenthrium/oe-runtime@latest --serve --config oe-config.json

Run with inline YAML:

curl -X POST http://localhost:3333/run \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret-key" \
  -d '{"yaml": "...", "params": {}}'

Or run from a file on the server:

curl -X POST http://localhost:3333/run-file \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret-key" \
  -d '{"file": "/path/to/agent.yaml", "params": {}}'

Use Cases

Build your own agents with OE Runtime

Download OE Runtime and run any AI agent locally or as a server — no cloud required.

Get OE Runtime →
Series OE Runtime Agent Guides — 21 Connectors
Series overview →