---
title: "Generate Structured Prompt from Diff"
method: POST
path: "/structured_prompt/generate_from_diff"
tags: ["Endpoints"]
---

# Generate Structured Prompt from Diff

`POST /structured_prompt/generate_from_diff`

Generates a new, optimized `structured_prompt` by analyzing the semantic difference between an original structred_prompt and a user-edited version. This endpoint is relevant for applications that allow for manual inline structured_prompt editing.

## Headers

- `api_token` string, required

## Request body

- object
  - `structured_prompt` string, required — A string containing the original structured prompt in JSON format.
  - `user_adjusted_structured_prompt` string, required — A string containing the manually modified structured prompt in JSON format.
  - `seed` integer — Seed for deterministic generation. Uses a random seed if omitted.
  - `sync` boolean — Response mode. * `false` (default): Asynchronous. Returns 202. * `true`: Synchronous. Returns 200 with result.
  - `webhook_url` string, uri — Optional URL for receiving the result via webhook when the async job completes. See [Webhooks](https://docs.bria.ai/webhooks).
  - `model_version` 'FIBO' — Generation model version.

## Response `200`

Successful operation (Synchronous Success)

- SyncSuccessStructPromptGenerate
  - `result` object, required
    - `seed` integer, required
    - `structured_prompt` string, required
  - `request_id` string, required
  - `warning` string — Returned only when ip_signal = true and the prompt field included IP content.

## Other responses

- `202` — Accepted (Asynchronous).
- `400` — Bad request (Incorrect format for Structured_Prompt or User_adjusted_structured_prompt).
- `401` — Unauthorized.
- `5XX` — Internal Server Error.

---

[API](https://skmtc.dev/bria-ai/apis/image-generation-api-reference.md) · [All operations](https://skmtc.dev/bria-ai/apis/image-generation-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/bria-ai/image-generation-api-reference/revisions/e715a3091223/schema)
