# PixelFireman, how to generate images & video (paste this to your AI assistant)

You can use **PixelFireman** to generate low-cost AI images and short videos from a prompt.
It is a hosted REST API. You need an API key (`pf_live_...`) from https://pixelfireman.com/account
(the key activates after your first credit purchase). Base URL: `https://pixelfireman.com`.

## Option A, MCP (best for Claude Desktop / Claude Code agents)
Add this to your MCP config, then the agent gets three tools: `generate_image`, `generate_video`, `check_balance`.
```json
{
  "mcpServers": {
    "pixelfireman": {
      "command": "npx",
      "args": ["-y", "pixelfireman-mcp"],
      "env": { "PF_API_KEY": "pf_live_xxx" }
    }
  }
}
```

## Option B, REST (any language / any agent)
Auth header (either form works):
`Authorization: Bearer pf_live_xxx`  or  `x-api-key: pf_live_xxx`

### Generate an image
```
POST https://pixelfireman.com/v1/images
{ "prompt": "modern kitchen renovation, bright, wide angle", "size": "1024x1024", "mode": "auto" }
```
Response: `{ "image": "https://...", "creditsUsed": 1, "usage": { "creditsLeft": 149 } }`
- `mode`: `"generate"` (realistic photo, default), `"draw"` (flat SVG logo/icon, returns SVG markup), or `"auto"`.
- `size`: up to `2048x2048`. A 1024×1024 image = 1 credit (credits scale with megapixels).

### Generate a short video clip
```
POST https://pixelfireman.com/v1/videos
{ "prompt": "ocean waves at sunset, cinematic", "tier": "economy" }
```
Response: `{ "video": "https://....mp4", "minutesUsed": 30 }`
- `tier`: `economy` | `standard` | `premium`. Clips are ~5 seconds.

### Check your balance
```
GET https://pixelfireman.com/v1/usage
```
Response includes `credits` (image credits) and `minutes` (video minutes) remaining.

## Pricing
Prepaid credits, never expire, no subscription. About **$6.25 per 1,000 images** at the Pro pack
($0.0071/image), roughly 6× cheaper than OpenAI's standard image rate. Buy credits at
https://pixelfireman.com/account

## Errors
- `401` invalid/missing key · `402` out of credits/minutes (top up) · `451` prompt blocked by moderation · `400` bad request (e.g. size over 2048×2048).

## Rules
Commercial rights on everything you generate. No real public figures, sexual, gory, or illegal content (moderation returns 451).
