> ## Documentation Index
> Fetch the complete documentation index at: https://docs.budgetpixel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WordPress Plugin

> Generate featured and inline images inside the WordPress block editor with 25+ BudgetPixel image models — cost shown before every run, bulk-fill from WP-CLI, API key kept server-side.

**BudgetPixel AI Images** is the official WordPress plugin. It adds a *BudgetPixel AI
Image* panel to the post sidebar: the prompt is pre-filled from the post's title and
excerpt, you pick a model and aspect ratio, see the exact credit cost, generate, and
set the result as the featured image or insert it into the post. A WP-CLI command
fills every missing featured image in one run.

The plugin is a thin client for this API. Every call happens server-side from your
WordPress install, so your API key never reaches the browser.

<Note>
  API access is included in **every paid plan**; the plugin itself is free (GPL-2.0-or-later).
  Images are billed in credits at the same prices as budgetpixel.com — see the
  [price index](https://budgetpixel.com/data/ai-generation-price-index) for every model.
</Note>

## Install

1. In WordPress, go to **Plugins → Add New**, search for **BudgetPixel AI Images**, and install it — or upload the release zip from the [GitHub repository](https://budgetpixel.com/plugins/wordpress).
2. Create an API key in the [developer console](https://budgetpixel.com/developers).
3. Open **Settings → BudgetPixel**, paste the key, pick a default model and aspect ratio, and press **Test connection**.

## Use it in the editor

Open any post. In the **Post** sidebar, expand **BudgetPixel AI Image**:

* **Prompt** — pre-filled from the title and excerpt with a "no lettering" style hint; edit it freely (once you edit, the plugin stops updating it from the title).
* **Model** and **Aspect ratio** — the live model list and prices come from your account.
* **Cost line** — the exact credit cost of one image, and your current balance.
* **Generate image** → preview → **Set as featured image** or **Insert into post**.

Alt text defaults to the prompt. The model, job id and prompt are stored as attachment
meta (`_budgetpixel_model`, `_budgetpixel_job_id`, `_budgetpixel_prompt`) so the origin
of every image stays auditable.

## Bulk-fill missing featured images

```bash theme={null}
# List posts without a featured image and the total cost — nothing is generated
wp budgetpixel featured --dry-run

# Generate for up to 50 published posts with a specific model
wp budgetpixel featured --limit=50 --model=flux-2-klein --aspect=16:9 --yes
```

Options: `--post-type`, `--status`, `--limit`, `--model`, `--aspect`, `--dry-run`, `--yes`.
The command estimates the total first, checks your balance, and asks for confirmation
unless `--yes` is passed.

## What the plugin sends

Only when you act (Generate, Test connection, loading the model list or balance, or
running the CLI): your API key in the `Authorization` header, the prompt, model and
aspect ratio, and `BudgetPixel-WordPress/<version> (+<site url>)` as the User-Agent.
Generated images are downloaded into your Media Library. Nothing is added to your
public site unless you enable the optional *Made with BudgetPixel* caption, which is
off by default.

## Configuration

| Setting | Where | Notes |
| - | - | - |
| API key | Settings → BudgetPixel | Stored in the options table; never shown in full again |
| Default model / aspect ratio | Settings → BudgetPixel | Used by the editor panel and the CLI |
| Caption | Settings → BudgetPixel | Opt-in "Made with BudgetPixel" image caption |
| API origin | `wp-config.php` | `define( 'BUDGETPIXEL_API_BASE', 'https://…/v1' );` for a staging API |
| Default prompt | `budgetpixel_default_prompt` filter | Change the house style hint |

## Endpoints used

`GET /v1/models?type=image` · `POST /v1/cost` · `POST /v1/images/{model}` ·
`GET /v1/images/{job_id}` · `GET /v1/account/credits`

## Permissions

Any user who can upload media can generate images (Authors and above by default).
Attaching an image to a post additionally requires permission to edit that post.

## Links

* [Plugin page](https://budgetpixel.com/plugins/wordpress)
* [Developer API Terms](https://budgetpixel.com/developer-terms) · [Privacy](https://budgetpixel.com/privacy)
* Support: [support@budgetpixel.com](mailto:support@budgetpixel.com)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.