/generate/prompt

Generate, complete or invent new prompts.

Query Params
string
Body Params
string
enum
required
Defaults to structured

The mode used to generate new prompt(s).

Allowed:
boolean

Whether we try to ensure IP removal for new prompt generation.

string

The input image as a data URL (example: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=") or the asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")

Required when mode is image-editing-prompt.

images
array of strings

List of images used to condition the generation.

Images are set a data URLs (example: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=") or the asset IDs (example: "asset_GTrL3mq4SXWyMxkOHRxlpw").

Notes:

  • in contextual mode, images condition prompt generation by using their actual descriptions as context
  • in all other modes, it supersedes the modelId parameter when provided.
images
number

If specified, the API will make a best effort to produce the same results, such that repeated requests with the same seed and parameters should return the same outputs. Must be used along with the same parameters including prompt, model's state, etc..

string

The modelId used to condition the generation.

When provided, the generation will take into account model's training images, examples.

Only supports 'gemini-2.0-flash', 'gemini-2.5-flash', 'gpt-image-1', 'flux-kontext' and 'runway-gen4-image' for now when mode is image-editing-prompt.

number
0 to 2

The sampling temperature to use. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

We generally recommend altering this or topP but not both.

assetIds
array of strings

The asset ids used to condition the generation.

Notes:

  • supersedes the modelId parameter when provided.
  • ignored when mode is image-editing-prompt.
assetIds
number
1 to 5

The number of results to return.

string

The initial prompt spark feed to completion, inventive or structured modes.

number
0 to 1

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this or temperature but not both.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json