Text to Image API

v1.0.2

Generate AI images from text descriptions using Media.io OpenAPI. Provide a text prompt and receive a high-quality AI-generated image. Supports multiple mode...

0· 156·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for wondershare-boop/mediaio-text-to-image-api.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Text to Image API" (wondershare-boop/mediaio-text-to-image-api) from ClawHub.
Skill page: https://clawhub.ai/wondershare-boop/mediaio-text-to-image-api
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install mediaio-text-to-image-api

ClawHub CLI

Package manager switcher

npx clawhub@latest install mediaio-text-to-image-api
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name, description, README examples, JSON API manifest, and code all consistently target Media.io text-to-image endpoints. The only mismatch is registry metadata that lists no required env vars while SKILL.md (and the code) require an API_KEY; otherwise requested capabilities align with the stated purpose.
Instruction Scope
SKILL.md instructs the agent to set API_KEY, install the 'requests' package, and call Media.io endpoints. The instructions and included code only reference the shipped c_api_doc_detail.json and the API host; they do not instruct reading unrelated files or exfiltrating arbitrary data.
Install Mechanism
No install spec is provided (instruction-only), and SKILL.md recommends 'pip install requests' — a reasonable, low-risk dependency. No downloads from arbitrary URLs or archive extraction are present.
!
Credentials
Functionally the skill only needs a single Media.io API key (X-API-KEY), which is proportional. However, registry metadata shows 'required env vars: none' and 'primary credential: none' while SKILL.md and the code require API_KEY. This inconsistency should be resolved before trusting the skill.
Persistence & Privilege
The skill does not request persistent 'always' inclusion, does not modify other skills or system-wide settings, and does not declare config paths. It only reads the included JSON doc and an API_KEY from environment (or passed argument).
Assessment
This skill is internally consistent with a Media.io text-to-image integration, but do two quick checks before installing: (1) Confirm the SKILL.md requirement for API_KEY is accurate — the registry metadata currently omits it (likely an oversight). (2) Only provide a Media.io API key you control and trust; the key will be sent as X-API-KEY to https://openapi.media.io. If possible, use a key with limited scope/credits for testing. Review the included c_api_doc_detail.json to verify endpoints match Media.io documentation and monitor network usage when first using the skill. If you don't recognize the skill owner, treat the API key as sensitive and consider creating a dedicated test key rather than reusing a high-privilege/production key.

Like a lobster shell, security has layers — review code before you run it.

latestvk97aatbym7fat1qe185jzw0k8n8358jf
156downloads
0stars
3versions
Updated 1mo ago
v1.0.2
MIT-0

MediaIO Text to Image API Skill

Overview

This skill provides Text-to-Image generation capabilities through the Media.io OpenAPI. Transform your text descriptions into high-quality AI-generated images using state-of-the-art models.

Trigger Keywords

Use this skill when you hear:

  • "text to image", "text-to-image API", "generate image from text"
  • "create image from text", "text to image generation"
  • "AI image from prompt", "generate image with text"

Supported Models

The Text-to-Image API supports multiple models:

  • Imagen 4 (t2i-imagen-4) - Google's photorealistic image generation
  • Soul Character (t2i-soul-character) - Character generation

Requirements

Environment Variables

VariableRequiredDescription
API_KEYYesMedia.io OpenAPI key, sent as X-API-KEY header. Apply at https://developer.media.io/.

API Details

Text-to-Image Generation

Imagen 4 (Recommended)

  • API Name: Imagen 4
  • Model Code: t2i-imagen-4
  • Endpoint: POST https://openapi.media.io/generation/imagen/t2i-imagen-4
  • Description: Sets a new standard for photorealism and text rendering accuracy.

Request Parameters

ParameterTypeRequiredDescription
promptstringYesText description for image generation
ratiostringNoImage aspect ratio (e.g., "1:1", "16:9", "9:16")
countsstringNoNumber of images to generate (default: "1")

Common Response Structure

{
  "code": 0,
  "msg": "",
  "data": {
    "task_id": "..."
  },
  "trace_id": "..."
}

Quick Start

1) Install Dependency

pip install requests

2) Initialize Skill

import os
from scripts.skill_router import Skill

skill = Skill('scripts/c_api_doc_detail.json')
api_key = os.getenv('API_KEY', '')
if not api_key:
    raise RuntimeError('API_KEY is not set')

3) Configure Environment Variable API_KEY

Windows PowerShell:

$env:API_KEY="your-api-key"

macOS / Linux (bash/zsh):

export API_KEY="your-api-key"

Usage Examples (Python)

Basic Text-to-Image Generation

import os
from scripts.skill_router import Skill

skill = Skill('scripts/c_api_doc_detail.json')
api_key = os.getenv('API_KEY', '')
if not api_key:
    raise RuntimeError('API_KEY is not set')

result = skill.invoke(
    'Imagen 4',
    {
        'prompt': 'a serene mountain landscape at sunset, photorealistic, golden hour lighting',
        'ratio': '16:9',
        'counts': '1'
    },
    api_key=api_key
)
print(result)  # Returns task_id when code=0

Artistic Style Generation

import os
from scripts.skill_router import Skill

skill = Skill('scripts/c_api_doc_detail.json')
api_key = os.getenv('API_KEY', '')
if not api_key:
    raise RuntimeError('API_KEY is not set')

result = skill.invoke(
    'Imagen 4',
    {
        'prompt': 'an oil painting of a bustling Parisian cafe in the style of Impressionism, warm colors, visible brushstrokes',
        'ratio': '4:3'
    },
    api_key=api_key
)
print(result)

Character Generation

import os
from scripts.skill_router import Skill

skill = Skill('scripts/c_api_doc_detail.json')
api_key = os.getenv('API_KEY', '')
if not api_key:
    raise RuntimeError('API_KEY is not set')

result = skill.invoke(
    'Soul Character',
    {
        'prompt': 'a friendly fantasy wizard with a long white beard and blue robes, detailed character design',
        'ratio': '1:1'
    },
    api_key=api_key
)
print(result)

Query Task Result

import os
import time
from scripts.skill_router import Skill

skill = Skill('scripts/c_api_doc_detail.json')
api_key = os.getenv('API_KEY', '')
if not api_key:
    raise RuntimeError('API_KEY is not set')

task_id = 'your-task-id'

for _ in range(24):
    r = skill.invoke('Task Result', {'task_id': task_id}, api_key=api_key)
    print(r)
    status = (r.get('data') or {}).get('status')
    if status in ('completed', 'failed', 'succeeded'):
        break
    time.sleep(5)

Task Status Reference

  • waiting: queued
  • processing: running
  • completed: completed successfully
  • failed: failed
  • timeout: timed out

Supported Aspect Ratios

RatioDimensionsUse Case
1:1SquareProfile pictures, thumbnails
16:9LandscapeWallpapers, banners
9:16PortraitMobile wallpapers, stories
4:3StandardTraditional photos
3:4PortraitTraditional portraits

Error Handling

Error CodeDescription
374004Not authenticated. Apply for an APP KEY at https://developer.media.io/
490505Insufficient credits. Recharge before invoking generation APIs

Tips for Better Results

  1. Be Specific: Include details about lighting, style, and mood
  2. Use Descriptive Adjectives: "photorealistic", "cinematic", "vibrant"
  3. Specify Art Styles: "in the style of Van Gogh", "anime style", "watercolor"
  4. Include Technical Details: "8K", "HDR", "depth of field"

External Resources

Related Files

  • scripts/skill_router.py: core routing logic
  • scripts/c_api_doc_detail.json: API definitions

Comments

Loading comments...