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

# Prompt Enhancement - Overview

> AI-powered prompt optimization tools for better generation results.

<Info>
  In v2 all prompt boosters use a **single unified endpoint** — `POST /api/v2/prompts/enhancements`. You select the booster with the **`type`** field (v2 dot notation) and the target model via **`model_slug`**.
</Info>

## Endpoints

| Purpose | Endpoint |
| - | - |
| Prompt Booster | `POST /api/v2/prompts/enhancements` |
| Booster Price | `POST /api/v2/prompts/enhancements/price` |

## Request fields (`/api/v2/prompts/enhancements`)

| Field | Required | Notes |
| - | - | - |
| `prompt` | **Yes** | Raw user prompt (min 3 chars). |
| `type` | **Yes** | Inference type in dot notation (see table below). |
| `model_slug` | **Yes** | Target deAPI model, e.g. `Flux_2_Klein_4B_BF16`. Selects the guide. |
| `image` | Conditional — required for `images.edits` / `videos.animations` | Reference image: URL, data-URI, base64, or file. |
| `negative_prompt` | No | Optional (min 3 chars). |

### `type` values

Only prompt-driven inference types have a booster. Types that take no meaningful prompt — upscaling, background removal, OCR, transcription, embeddings — are not supported and are rejected with **422**.

| `type` | Use case |
| - | - |
| `images.generations` | Text-to-image |
| `images.edits` | Image-to-image / edit (requires `image`) |
| `videos.generations` | Text/image-to-video |
| `videos.animations` | Character animation (requires `image`) |
| `audio.speech` | Text-to-speech |
| `audio.music` | Text-to-music |

## Workflow

<Steps>
  <Step title="Enhance your prompt">
    Call `POST /api/v2/prompts/enhancements` with `prompt`, `type`, and `model_slug` (plus `image` for `images.edits` / `videos.animations`).
  </Step>

  <Step title="Use the enhanced prompt">
    Plug the returned `prompt` into the matching v2 generation endpoint — `/api/v2/images/generations`, `/api/v2/images/edits`, `/api/v2/videos/generations`, `/api/v2/audio/speech`, etc.
  </Step>
</Steps>

See the [Prompt Booster](/api/v2/prompt-enhancement/prompt-booster) page for the full request/response schema.

## Inline boosting (`enhance_prompt`)

Instead of calling the booster first and passing the result on yourself, you can set **`enhance_prompt: true`** directly on a generation request. The boost then runs as an async pre-step inside the job, and the boosted prompt is what gets generated.

Supported on `POST /api/v2/images/generations`, `POST /api/v2/images/edits`, `POST /api/v2/videos/generations` and `POST /api/v2/videos/animations`.

| | Two-step (`/prompts/enhancements`) | Inline (`enhance_prompt: true`) |
| - | - | - |
| Round trips | Two | One |
| You see the boosted prompt before generating | Yes | No — it comes back on the job |
| Billing | Boost billed separately | Boost fee billed on the job |

The job status response reports what happened:

* `prompt_boosted` — whether the boost actually ran.
* `prompt_boost` — the boosted and original prompts. Non-null only once `prompt_boosted` is true; it stays `null` while the boost is still queued, and when no boost was requested.

<Warning>
  Inline boosting requires a prompt-booster guide configured for the target model. The request is rejected with **422** if no guide exists for that model, or if your account balance cannot cover the boost fee on top of the generation.
</Warning>


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