# Alt text

SleekAI describes images in the media library with a vision model and writes
the description to the image's alt text, caption or description. It works on
images you select in a table, and on new uploads if you turn that on.

Alt text sits below AI in the sidebar and has three pages: the model, the
generation settings, and the table.

## Model

The **Alt text** page chooses the model that looks at the images. It lists
the models of every provider with a stored [API key](/docs/ai/settings/api-keys.md);
custom models are not offered. Choose a model that accepts images.

**System instruction** tells the model how to describe an image. Its
placeholder shows the instruction SleekAI uses when the settings hold none:
a concise, descriptive alt text of under 125 characters. Along with the image,
SleekAI sends the image's title and caption when it has them.

Nothing is generated until a model is chosen.

## Generation

The **Generation** page has two settings:

- **Generate alt text for new uploads** generates a description for every
  image added to the media library.
- **Fields** chooses where the description is written: **Alt text**,
  **Image caption** and **Image description**. The same text goes into every
  field you choose, replacing what was there. Choose at least one field;
  otherwise the description is generated and then discarded.

An upload does not wait for the model: SleekAI queues the work as the
`sleekAi/altText/generate` action in Action Scheduler and generates the text
shortly after. If the action cannot be queued, the text is generated during
the upload instead. A callback you add to that action at a priority above 10
runs after SleekAI has written the text; see the
[hooks reference](/docs/ai/reference/hooks.md).

## Table

The **Table** page lists the media library's images with a thumbnail, their
alt text, caption and description, and their date. Select images, or every
image on the page with the checkbox in the table's header, and choose
**Generate** above the table to describe them one after another with the
current model and fields; the button names how many images are selected and
stays disabled until you select one. The **Status** column shows each image as
processing, completed or failed.

The table pages through the library, 10 rows at a time unless you choose up
to 500, newest first unless the **Date** column's menu sorts it oldest first.
The page keeps that state in its address, before the `#`, as `paged`,
`per_page` and `order=oldest`, so a link can open a given page of the table; a
page past the last one opens the last.

## From the command line

`wp sleek ai alt-text generate` describes images with the same model and
fields, by attachment ID or for every image that has no alt text yet:

```bash
wp sleek ai alt-text generate 42 43
wp sleek ai alt-text generate --all-missing --dry-run
```

`--dry-run` lists the images without calling the provider. A run handles at
most 50 images, or as many as `--limit` names up to 500; run it again for the
rest. The
[CLI reference](/docs/ai/reference/cli.md) lists every option.
