---
url: /orchestration/reference/operations/InvokePromptEnhancementStepTemplate.md
description: 'POST /v2/consumer/recipes/promptEnhancement — PromptEnhancement'
---

> Documentation index: https://developer.civitai.com/llms.txt — every page on this site has a markdown version at its URL + `.md`.

# PromptEnhancement

`POST https://orchestration.civitai.com/v2/consumer/recipes/promptEnhancement`

Operation `InvokePromptEnhancementStepTemplate` · Recipes · Civitai Orchestration API, generated from the published OpenAPI spec ([v2-consumers.json](https://developer.civitai.com/openapi/v2-consumers.json)); the interactive HTML page is this URL without `.md`.

Analyzes and enhances user prompts for a specific AI ecosystem.
/// Returns detected issues, recommendations, and improved prompt variants.

## Authentication

Send `Authorization: Bearer <token>` (the spec's `ApiKey` scheme); this operation documents `401 Unauthorized` for a missing or invalid token. See [Authentication](https://developer.civitai.com/orchestration/guide/authentication.md).

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `experimental` | query | boolean | no |  |
| `allowMatureContent` | query | boolean | no |  |
| `whatif` | query | boolean | no |  |
| `ephemeral` | query | boolean | no |  |
| `tier` | query | `WorkflowTier` (one of `paid`, `free`) | no | How a workflow is paid for. |

## Request body

Optional. Content types: `application/json`, `text/json`, `application/*+json`.

Schema `PromptEnhancementInput`.

| Field | Type | Required | Description |
|---|---|---|---|
| `ecosystem` | string | yes | The target ecosystem (e.g., "sd1", "sdxl", "flux", "ltx2"). (minLength `1`) |
| `prompt` | string | yes | (minLength `1`) |
| `negativePrompt` | string, nullable | no |  |
| `temperature` | number (double), nullable | no | LLM temperature for enhancement creativity (0.0–1.0). Defaults to 0.7. (minimum `0`, maximum `1`) |
| `instruction` | string, nullable | no | Optional instruction to guide how the prompt is enhanced (e.g., "expand to 77 tokens", "keep it under 20 words"). |
| `images` | array of string (source-image), nullable | no | Reference images (URLs, data URIs, raw base64 or AIR strings) the model considers for subject, style, lighting and composition. Requires the ecosystem's prompt-analysis model to be vision-capable; non-VLM models silently ignore them. |

## Responses

### 200 OK

Content type: `application/json`.

Schema `PromptEnhancementOutput`.

| Field | Type | Required | Description |
|---|---|---|---|
| `issues` | array of `PromptIssue` | yes |  |
| `recommendations` | array of string | yes |  |
| `enhancedPrompt` | string | yes |  |
| `enhancedNegativePrompt` | string, nullable | no |  |

### 400 Bad Request

Content type: `application/json`.

Schema `ProblemDetails`.

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | string, nullable | no |  |
| `title` | string, nullable | no |  |
| `status` | integer (int32), nullable | no |  |
| `detail` | string, nullable | no |  |
| `instance` | string, nullable | no |  |

### 401 Unauthorized

Content type: `application/json`.

Schema `ProblemDetails` — fields as listed above.

### 403 Forbidden

Content type: `application/json`.

Schema `ProblemDetails` — fields as listed above.
