my-image-api

$npx mdskill add myapihq/myapi/my-image-api

Generate AI images from text prompts asynchronously.

  • Creates images from text prompts with optional style and aspect ratio.
  • Depends on MyImageAPI for generation and mystorageapi for storage.
  • Polls job status every 3 seconds until image is ready or times out.
  • Returns a public CDN URL; images appear in mystorageapi bucket.

SKILL.md

.github/skills/my-image-apiView on GitHub ↗
---
name: my-image-api
version: 1.0.0
description: >
  Generate AI images from a text prompt. Async — submit a prompt, the CLI polls until the image is ready, then returns a public CDN URL. Image lands automatically in your org's storage.
triggers: [image, generate image, ai image, hero image, logo, illustration, watercolor, prompt, cyberpunk, ratio, aspect ratio]
checksum: sha256-pending
---

# MyImageAPI

Text-to-image generation. Submit a prompt with optional aspect ratio, style, color palette, and "allow text" hint. The job is asynchronous — the CLI polls until completion (typically 10–30s, capped at 90s).

## Capabilities
<!-- llm:start -->
Generation is async. Submit a prompt → get a `job_id` immediately. The CLI polls every 3 seconds and returns when the job completes (or times out at 90s — the job continues server-side; check back with `image get <job_id>`).

Cost is per-image at the selected model's catalog rate (today $0.039 for the default flash model, $0.10 for the pro model). Run `myapi image models` for the live catalog. Failed jobs aren't charged. Generated images land automatically in your org's **mystorageapi** bucket — they show up in `myapi storage list` and can be referenced from a **myfunnelapi** page or embedded in a **myemailapi** template.

The output URL is public — anyone with it can view. Don't generate sensitive content.
<!-- llm:end -->

## Commands
<!-- generated:start -->
| Command | What it does |
|---|---|
| `myapi image generate <prompt>` | Async generate, polls up to 90s, returns id + URL |
| `myapi image list` | List all generated images for the org |
| `myapi image get <job_id>` | Get full job details (status, URL, prompt, ratio) |
| `myapi image models` | List available image models with per-image pricing |
| `myapi image delete <job_id>` | Delete the asset (job record kept for history) |

### Generate flags

| Flag | Allowed | Default | Notes |
|---|---|---|---|
| `--model` | id from `image models` | `gemini-2.5-flash-image` | Override the default model (e.g. `gemini-3-pro-image-preview` for higher quality) |
| `--ratio` | `1:1`, `16:9`, `9:16`, `4:3`, `3:4` | `1:1` | Aspect ratio of the output |
| `--style` | free-form | none | e.g. `"watercolor"`, `"cyberpunk neon"` |
| `--colors` | hex list | none | e.g. `"#ff6600,#003366"` — the model biases toward these |
| `--text` | flag (no value) | off | Allow text in the image. Off by default — text rarely renders well |
<!-- generated:end -->

## Examples
<!-- llm:start -->
```bash
# Plain generation
myapi image generate "A clean flat-color logo for a sustainable jam company"

# With styling
myapi image generate "Hero image, mountains at dawn" \
  --ratio 16:9 --style "watercolor" --colors "#ff6600,#003366"

# Higher-quality pro model
myapi image generate "Editorial portrait, soft natural light" \
  --model gemini-3-pro-image-preview --ratio 4:3

# History
myapi image list
myapi image get <job_id>
myapi image delete <job_id>

# Catalog — see which models are available and what they cost per image
myapi image models
```

Tips for agents:
- Prompts with explicit text usually fail — for branded text use a separate text overlay step.
- For non-square layouts, set `--ratio` rather than describing dimensions in the prompt.
<!-- llm:end -->

## Notes

- Cost is per-image at the selected model's catalog rate (`myapi image models`). Failed jobs aren't charged.
- The asset URL is public — don't generate sensitive content.
- `delete` is permanent for the asset; the job record (prompt + metadata) stays for history. Look before you delete: `myapi image list` first, pass `--org` explicitly; delete verbs require `--yes` in non-interactive runs.

Run `myapi image --help` or `myapi image <subcommand> --help` for full flag reference.

More from myapihq/myapi