# MyImageAPI > AI image generation with built-in storage Base URL: https://api.myimageapi.com Authentication: `Authorization: Bearer ` # MyImageAPI AI image generation from natural language prompts. Images are automatically stored and returned as a permanent public URL. ## Endpoints - POST /image/generate — Submit a prompt (and optional aspect_ratio, style, colors, has_text). Returns a job_id. - GET /image/jobs/{id} — Poll job status. When completed, returns a public `url` field. - GET /image/list — List all generated images for the authenticated account. ## Pricing - $0.05 per generated image (5 credits) ## Supported aspect ratios 1:1, 16:9, 9:16, 4:3, 3:4 ## Agent Onboarding To use this or any other MyAPIHQ service as an autonomous agent, follow these steps: 1. **Register an Agent Account**: Create an agent account. Returns `account_id`, `pin`, and a `token` (JWT) in one call — no email or human required. ```bash curl -X POST https://api.myapihq.com/hq/account/agent/create \ -H "Content-Type: application/json" \ -d '{"label": "my-agent"}' ``` 2. **Create a Permanent API Key**: Use the `token` from step 1 to create a workspace-scoped API key (`hq_live_...`). ```bash curl -X POST https://api.myapihq.com/hq/account/create/key \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"name": "my-agent-key"}' ``` 3. **Authenticate**: All subsequent requests must include: `Authorization: Bearer `. The JWT token from step 1 is valid for account and billing endpoints only. All service calls (orgs, funnels, email, domains) require the API key from step 2. ## Endpoints ### POST /image/generate **Generate an image from a prompt** **Request Body (JSON):** ```json { "prompt": string - Natural language description of the image to generate. (Required), "aspect_ratio": string (1:1|16:9|9:16|4:3|3:4), "style": string - Visual style hint, e.g. 'photorealistic', 'flat illustration'., "colors": string - Color palette hint, e.g. '#1a1a2e, #e94560'., "has_text": boolean - Allow text/logos in the image. } ``` **Response (JSON):** ```json { "job_id": string, "status": string } ``` ### GET /image/jobs/{id} **Poll job status** **Parameters:** - `id` (path): (type: string, Required) **Response (JSON):** ```json { "job_id": string, "status": string (pending|processing|completed|failed), "url": string - Public image URL — present when status is completed., "prompt": string, "aspect_ratio": string, "error": string - Error message — present when status is failed., "created_at": string, "updated_at": string } ``` ### GET /image/list **List generated images** **Response (JSON):** ```json Array<{ "job_id": string, "status": string, "url": string, "prompt": string, "aspect_ratio": string, "created_at": string }> ``` ## Pricing Pay per use. No subscription. --- ## Ecosystem Integration This service is part of the MyAPIHQ ecosystem. You authenticate using an API Key generated from your MyAPIHQ account. To view the full list of available services (like domain registration, funnel building, transactional email, object storage, etc.), fetch [https://myapihq.com/llms.txt](https://myapihq.com/llms.txt).