import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { RequestOptions } from "../internal/request-options.js"; export declare class Generate extends APIResource { /** * Caption image(s) */ caption(params: GenerateCaptionParams, options?: RequestOptions): APIPromise; /** * Describe the style of the given images or models. */ describeStyle(params: GenerateDescribeStyleParams, options?: RequestOptions): APIPromise; /** * Advanced precision in image generation by transforming visual data from input * images into mode maps. */ detect(params: GenerateDetectParams, options?: RequestOptions): APIPromise; /** * Get embeddings from text */ embed(params: GenerateEmbedParams, options?: RequestOptions): APIPromise; /** * Patch an asset with an image. */ patch(params: GeneratePatchParams, options?: RequestOptions): APIPromise; /** * Generate, complete or invent new prompts. */ prompt(params: GeneratePromptParams, options?: RequestOptions): APIPromise; /** * Generate with any model (Image, Video, Audio, 3d, Text). * * You can retrieve the model inputs from the `GET /models/{modelId}` endpoint. */ runModel(modelID: string, params: GenerateRunModelParams, options?: RequestOptions): APIPromise; /** * Translate text from one language to english. */ translate(params: GenerateTranslateParams, options?: RequestOptions): APIPromise; } export interface GenerateCaptionResponse { /** * The captions for each image. */ captions: Array; job: GenerateCaptionResponse.Job; /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ costDetails?: GenerateCaptionResponse.CostDetails; /** * The Compute Units cost for the request billed */ creativeUnitsCost?: number; /** * The Compute Units discount for the request billed */ creativeUnitsDiscount?: number; /** * The details level used to generate the captions. * * When a modelId is provided and examples are available, the details level is * ignored. */ detailsLevel?: 'action' | 'action+style'; /** * IP detection findings, when detection ran for this request. */ ipDetection?: GenerateCaptionResponse.IPDetection; } export declare namespace GenerateCaptionResponse { interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } namespace Job { /** * Metadata of the job with some additional information */ interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown; }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown; }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } namespace Metadata { interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } namespace Flow { interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } namespace Logic { interface Case { condition: string; value: string; } } } } interface StatusHistory { date: string; status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ interface CostDetails { 'assistant-message'?: number; caption?: number; 'custom-generation'?: number; 'describe-style'?: number; detection?: number; embed?: number; 'image-prompt-editing'?: number; 'inference-images'?: number; 'ip-detection'?: number; pixelate?: number; prompt?: number; 'remove-background'?: number; repaint?: number; restyle?: number; segmentation?: number; 'skybox-base-360'?: number; 'skybox-upscale-360'?: number; 'slop-detection'?: number; texture?: number; 'train-model'?: number; translate?: number; upscale?: number; vectorization?: number; } /** * IP detection findings, when detection ran for this request. */ interface IPDetection { /** * Whether and how detection affected the request. */ action: 'allowed' | 'blocked' | 'flagged'; /** * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a * per-image fee for each analyzed input image. */ creativeUnitsCharged: number; /** * Number of enabled filters evaluated for this request. */ evaluatedFilters: number; /** * Per-filter verdicts gathered for this request. */ findings: Array; /** * Convenience flag; always true when action is not 'allowed'. */ flagged: boolean; /** * True if one or more detectors errored while evaluating this request. */ hasDetectorError?: boolean; } namespace IPDetection { /** * A single filter's verdict. */ interface Finding { /** * Category of the filter that produced this verdict. */ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character'; /** * Confidence score from 0 (low) to 1 (high). */ confidence: number; /** * Identifier of the filter that produced this verdict. */ filterId: string; /** * Display name of the filter that produced this verdict. */ filterName: string; /** * Whether this filter considered the request an IP risk. */ flagged: boolean; /** * Short, user-facing explanation of the verdict. */ reason: string; /** * Named entities the filter recognized (e.g. characters, brands, people). */ entities?: Array; } } } export interface GenerateDescribeStyleResponse { /** * The style of the given images. */ description: string; job: GenerateDescribeStyleResponse.Job; /** * A short synthesis that describes the given asset(s) or asset(s) model. */ synthesis: string; /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ costDetails?: GenerateDescribeStyleResponse.CostDetails; /** * The Compute Units cost for the request billed */ creativeUnitsCost?: number; /** * The Compute Units discount for the request billed */ creativeUnitsDiscount?: number; /** * IP detection findings, when detection ran for this request. */ ipDetection?: GenerateDescribeStyleResponse.IPDetection; } export declare namespace GenerateDescribeStyleResponse { interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } namespace Job { /** * Metadata of the job with some additional information */ interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown; }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown; }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } namespace Metadata { interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } namespace Flow { interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } namespace Logic { interface Case { condition: string; value: string; } } } } interface StatusHistory { date: string; status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ interface CostDetails { 'assistant-message'?: number; caption?: number; 'custom-generation'?: number; 'describe-style'?: number; detection?: number; embed?: number; 'image-prompt-editing'?: number; 'inference-images'?: number; 'ip-detection'?: number; pixelate?: number; prompt?: number; 'remove-background'?: number; repaint?: number; restyle?: number; segmentation?: number; 'skybox-base-360'?: number; 'skybox-upscale-360'?: number; 'slop-detection'?: number; texture?: number; 'train-model'?: number; translate?: number; upscale?: number; vectorization?: number; } /** * IP detection findings, when detection ran for this request. */ interface IPDetection { /** * Whether and how detection affected the request. */ action: 'allowed' | 'blocked' | 'flagged'; /** * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a * per-image fee for each analyzed input image. */ creativeUnitsCharged: number; /** * Number of enabled filters evaluated for this request. */ evaluatedFilters: number; /** * Per-filter verdicts gathered for this request. */ findings: Array; /** * Convenience flag; always true when action is not 'allowed'. */ flagged: boolean; /** * True if one or more detectors errored while evaluating this request. */ hasDetectorError?: boolean; } namespace IPDetection { /** * A single filter's verdict. */ interface Finding { /** * Category of the filter that produced this verdict. */ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character'; /** * Confidence score from 0 (low) to 1 (high). */ confidence: number; /** * Identifier of the filter that produced this verdict. */ filterId: string; /** * Display name of the filter that produced this verdict. */ filterName: string; /** * Whether this filter considered the request an IP risk. */ flagged: boolean; /** * Short, user-facing explanation of the verdict. */ reason: string; /** * Named entities the filter recognized (e.g. characters, brands, people). */ entities?: Array; } } } export interface GenerateDetectResponse { job: GenerateDetectResponse.Job; asset?: GenerateDetectResponse.Asset; /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ costDetails?: GenerateDetectResponse.CostDetails; /** * The Compute Units cost for the request billed */ creativeUnitsCost?: number; /** * The Compute Units discount for the request billed */ creativeUnitsDiscount?: number; /** * IP detection findings, when detection ran for this request. */ ipDetection?: GenerateDetectResponse.IPDetection; } export declare namespace GenerateDetectResponse { interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } namespace Job { /** * Metadata of the job with some additional information */ interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown; }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown; }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } namespace Metadata { interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } namespace Flow { interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } namespace Logic { interface Case { condition: string; value: string; } } } } interface StatusHistory { date: string; status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } interface Asset { /** * The asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId: string; /** * A list of CollectionId this asset belongs to */ collectionIds: Array; /** * The asset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * List of edit capabilities */ editCapabilities: Array<'DETECTION' | 'GENERATIVE_FILL' | 'PIXELATE' | 'PROMPT_EDITING' | 'REFINE' | 'REFRAME' | 'REMOVE_BACKGROUND' | 'SEGMENTATION' | 'UPSCALE' | 'UPSCALE_360' | 'VECTORIZATION'>; /** * The kind of asset */ kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * Metadata of the asset with some additional information */ metadata: Asset.Metadata; /** * The mime type of the asset (example: "image/png") */ mimeType: string; /** * The owner (project) ID (example: "proj_23tlk332lkht3kl2" or * "team_dlkhgs23tlk3hlkth32lkht3kl2" for old teams) */ ownerId: string; /** * The privacy of the asset */ privacy: 'private' | 'public' | 'unlisted'; /** * The properties of the asset, content may depend on the kind of asset returned */ properties: Asset.Properties; /** * source of the asset */ source: '3d23d' | '3d23d:texture' | '3d:texture' | '3d:texture:albedo' | '3d:texture:metallic' | '3d:texture:mtl' | '3d:texture:normal' | '3d:texture:roughness' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2splat' | 'img2txt' | 'img2video' | 'inference-control-net' | 'inference-control-net-img' | 'inference-control-net-inpainting' | 'inference-control-net-inpainting-ip-adapter' | 'inference-control-net-ip-adapter' | 'inference-control-net-reference' | 'inference-control-net-texture' | 'inference-img' | 'inference-img-ip-adapter' | 'inference-img-texture' | 'inference-in-paint' | 'inference-in-paint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt' | 'inference-txt-ip-adapter' | 'inference-txt-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture:albedo' | 'texture:ao' | 'texture:edge' | 'texture:height' | 'texture:metallic' | 'texture:normal' | 'texture:smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2txt' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-text' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone'; /** * The actual status */ status: 'error' | 'pending' | 'success'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The asset last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * Signed URL to get the asset content */ url: string; /** * Automatic captioning of the asset */ automaticCaptioning?: string; /** * The description, it will contain in priority: * * - the manual description * - the advanced captioning when the asset is used in training flow * - the automatic captioning */ description?: string; /** * The embedding of the asset when requested. * * Only available when an asset can be embedded (ie: not Detection maps) */ embedding?: Array; /** * The video asset's first frame. * * Contains the assetId and the url of the first frame. */ firstFrame?: Asset.FirstFrame; /** * Whether the asset is hidden. */ isHidden?: boolean; /** * The video asset's last frame. * * Contains the assetId and the url of the last frame. */ lastFrame?: Asset.LastFrame; /** * The NSFW labels */ nsfw?: Array; /** * The original file url. * * Contains the url of the original file. without any conversion. Only available * for some specific video, audio and threeD assets. Is only specified if the given * asset data has been replaced with a new file during the creation of the asset. */ originalFileUrl?: string; /** * The output index of the asset within a job This index is an positive integer * that starts at 0 It is used to differentiate between multiple outputs of the * same job If the job has only one output, this index is 0 */ outputIndex?: number; /** * The asset's preview. * * Contains the assetId and the url of the preview. */ preview?: Asset.Preview; /** * SlopGuard detection result, computed asynchronously after generation. * * `details` (the per-dimension reasons and suggestions) is returned only when the * asset is read with `withSlopGuardDetails=true`. */ slopGuard?: Asset.SlopGuard; /** * The asset's thumbnail. * * Contains the assetId and the url of the thumbnail. */ thumbnail?: Asset.Thumbnail; } namespace Asset { /** * Metadata of the asset with some additional information */ interface Metadata { kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The type of the asset. Ex: 'inference-txt2img' will represent an asset generated * from a text to image model */ type: '3d-texture' | '3d-texture-albedo' | '3d-texture-metallic' | '3d-texture-mtl' | '3d-texture-normal' | '3d-texture-roughness' | '3d23d' | '3d23d-texture' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2splat' | 'img2txt' | 'img2video' | 'inference-controlnet' | 'inference-controlnet-img2img' | 'inference-controlnet-inpaint' | 'inference-controlnet-inpaint-ip-adapter' | 'inference-controlnet-ip-adapter' | 'inference-controlnet-reference' | 'inference-controlnet-texture' | 'inference-img2img' | 'inference-img2img-ip-adapter' | 'inference-img2img-texture' | 'inference-inpaint' | 'inference-inpaint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt2img' | 'inference-txt2img-ip-adapter' | 'inference-txt2img-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture-albedo' | 'texture-ao' | 'texture-edge' | 'texture-height' | 'texture-metallic' | 'texture-normal' | 'texture-smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2txt' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-text' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone'; /** * How angular is the surface? 0 is like a sphere, 1 is like a mechanical object */ angular?: number; /** * The optional aspect ratio given for the generation, only applicable for some * models */ aspectRatio?: string; backgroundOpacity?: number; /** * The baseModelId that maybe changed at inference time */ baseModelId?: string; /** * A bounding box around the object of interest, in the format [x1, y1, x2, y2]. */ bbox?: Array; betterQuality?: boolean; /** * The control image already processed by canny detector. Must reference an * existing AssetId. */ cannyStructureImage?: string; /** * Activate clustering. */ clustering?: boolean; /** * Ensure upscaled tile have the same color histogram as original tile. */ colorCorrection?: boolean; colorMode?: string; colorPrecision?: number; /** * Flux Kontext LoRA to style the image. For Flux Kontext Prompt Editing. */ concepts?: Array; contours?: Array>>>; /** * End step for control. */ controlEnd?: number; /** * The date when the asset was copied to a project */ copiedAt?: string; cornerThreshold?: number; /** * Allow the generation of "hallucinations" during the upscale process, which adds * additional details and deviates from the original image. Default: optimized for * your preset and style. */ creativity?: number; /** * Amount of decay in creativity over the upscale process. The lowest the value, * the less the creativity will be preserved over the upscale process. */ creativityDecay?: number; /** * If true, use the default parameters */ defaultParameters?: boolean; /** * The depth fidelity if a depth image provided */ depthFidelity?: number; /** * The control image processed by depth estimator. Must reference an existing * AssetId. */ depthImage?: string; /** * Amount of details to remove or add */ detailsLevel?: number; dilate?: number; /** * Contrast factor for Grayscale detector */ factor?: number; filterSpeckle?: number; /** * Determine the scale at which the upscale process works. * * - With a small value, the upscale works at the largest scale, resulting in fewer * added details and more coherent images. Ideal for portraits, for example. * - With a large value, the upscale works at the smallest scale, resulting in more * added details and more hallucinations. Ideal for landscapes, for example. * * (info): A small value is slower and more expensive to run. */ fractality?: number; /** * Apply extra control to the Skybox 360 geometry. The higher the value, the more * the 360 geometry will influence the generated skybox image. * * Use with caution. Default is adapted to the other parameters. */ geometryEnforcement?: number; /** * The guidance used to generate this asset */ guidance?: number; halfMode?: boolean; hdr?: number; height?: number; /** * High threshold for Canny detector */ highThreshold?: number; /** * (deprecated) Horizontal expansion ratio. */ horizontalExpansionRatio?: number; /** * The input image to process. Must reference an existing AssetId or be a data URL. */ image?: string; /** * Strengthen the similarity to the original image during the upscale. Default: * optimized for your preset and style. */ imageFidelity?: number; /** * Preserve the seamless properties of skybox or texture images. Input has to be of * same type (seamless). */ imageType?: 'seamfull' | 'skybox' | 'texture'; /** * The id of the Inference describing how this image was generated */ inferenceId?: string; /** * When set to `high`, allows to better preserve details from the input images in * the output. This is especially useful when using images that contain elements * like faces or logos that require accurate preservation in the generated image. * * You can provide multiple input images that will all be preserved with high * fidelity, but keep in mind that the first image will be preserved with richer * textures and finer details, so if you include elements such as faces, consider * placing them in the first image. * * Only available for the `gpt-image-1` model. */ inputFidelity?: 'high' | 'low'; /** * Location of the input image in the output. */ inputLocation?: 'bottom' | 'left' | 'middle' | 'right' | 'top'; /** * To invert the relief */ invert?: boolean; /** * How polished is the surface? 0 is like a rough surface, 1 is like a mirror */ keypointThreshold?: number; layerDifference?: number; lengthThreshold?: number; /** * The ISO timestamp when the lock on the canvas will expire */ lockExpiresAt?: string; /** * Low threshold for Canny detector */ lowThreshold?: number; /** * The mask used for the asset generation or editing */ mask?: string; maxIterations?: number; /** * Maximum threshold for Grayscale conversion */ maxThreshold?: number; /** * Minimum threshold for Grayscale conversion */ minThreshold?: number; /** * Modality to detect */ modality?: 'canny' | 'depth' | 'grayscale' | 'lineart_anime' | 'mlsd' | 'normal' | 'pose' | 'scribble' | 'segmentation' | 'sketch'; mode?: string; /** * The modelId used to generate this asset */ modelId?: string; /** * The type of the generator used */ modelType?: 'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; name?: string; nbMasks?: number; /** * The negative prompt used to generate this asset */ negativePrompt?: string; /** * Controls the influence of the negative prompt. Default 0 means the negative * prompt has no effect. Higher values increase negative prompt influence. Must * be > 0 if negativePrompt is provided. */ negativePromptStrength?: number; /** * The number of denoising steps for each image generation. */ numInferenceSteps?: number; /** * The number of outputs to generate. */ numOutputs?: number; originalAssetId?: string; outputIndex?: number; /** * Overlap percentage for the output image. */ overlapPercentage?: number; /** * Override the embeddings of the model. Only your prompt and negativePrompt will * be used. Use with caution. */ overrideEmbeddings?: boolean; parentId?: string; parentJobId?: string; pathPrecision?: number; /** * List of points (label, x, y) in the image where label = 0 for background and 1 * for object. */ points?: Array>; /** * How polished is the surface? 0 is like a rough surface, 1 is like a mirror */ polished?: number; preset?: string; progressPercent?: number; /** * The prompt that guided the asset generation or editing */ prompt?: string; /** * Increase the fidelity to the prompt during upscale. Default: optimized for your * preset and style. */ promptFidelity?: number; /** * How raised is the surface? 0 is flat like water, 1 is like a very rough rock */ raised?: number; /** * The reference images used for the asset generation or editing */ referenceImages?: Array; /** * Additional refinement steps before scaling. * * If scalingFactor == 1, the refinement process will be applied (1 + * refinementSteps) times. If scalingFactor > 1, the refinement process will be * applied refinementSteps times. */ refinementSteps?: number; /** * Remove background for Grayscale detector */ removeBackground?: boolean; /** * Size proportion of the input image in the output. */ resizeOption?: number; /** * Boolean to output the contours. */ resultContours?: boolean; /** * Boolean to return the source image with the mask applied as alpha channel (RGBA * PNG, transparent background) instead of the binary mask. Mutually exclusive with * `resultMask` — passing both as `true` returns a 400 error. Note: * `backgroundOpacity` is no longer honored — alpha is binary (0/255) only. */ resultImage?: boolean; /** * Boolean to return the binary masks in the response. Mutually exclusive with * `resultImage` — passing both as `true` returns a 400 error. */ resultMask?: boolean; rootParentId?: string; /** * Save a flipbook of the texture. Deactivated when the input texture is larger * than 2048x2048px */ saveFlipbook?: boolean; /** * Scaling factor (when `targetWidth` not specified) */ scalingFactor?: number; /** * The scheduler used to generate this asset */ scheduler?: string; /** * The seed used to generate this asset. Can be a string or a number in some * cases . */ seed?: string; /** * Sharpen tiles. */ sharpen?: boolean; /** * How shiny is the surface? 0 is like a matte surface, 1 is like a diamond */ shiny?: number; size?: number; /** * Activate sketch detection instead of canny. */ sketch?: boolean; sourceProjectId?: string; spliceThreshold?: number; /** * The strength * * Only available for the `flux-kontext` LoRA model. */ strength?: number; /** * Strength for the input image structure preservation */ structureFidelity?: number; /** * The control image for structure. A canny detector will be applied to this image. * Must reference an existing AssetId. */ structureImage?: string; style?: '3d-cartoon' | '3d-rendered' | 'anime' | 'cartoon' | 'cinematic' | 'claymation' | 'cloud-skydome' | 'comic' | 'cyberpunk' | 'enchanted' | 'fantasy' | 'ink' | 'manga' | 'manga-color' | 'minimalist' | 'neon-tron' | 'oil-painting' | 'pastel' | 'photo' | 'photography' | 'psychedelic' | 'retro-fantasy' | 'scifi-concept-art' | 'space' | 'standard' | 'whimsical'; /** * The higher the value the more it will look like the style image(s) */ styleFidelity?: number; /** * List of style images. Most of the time, only one image is enough. It must be * existing AssetIds. */ styleImages?: Array; /** * Condition the influence of the style image(s). The higher the value, the more * the style images will influence the upscaled image. */ styleImagesFidelity?: number; /** * The target height of the output image. */ targetHeight?: number; /** * Target width for the upscaled image, take priority over scaling factor */ targetWidth?: number; /** * A textual description / keywords describing the object of interest. */ text?: string; /** * The asset to convert in texture maps. Must reference an existing AssetId. */ texture?: string; /** * The thumbnail of the canvas */ thumbnail?: Metadata.Thumbnail; /** * If set to true, during the upscaling process, the model will match tiles of the * source image with tiles of the style image(s). This will result in a more * coherent restyle. Works best with style images that have a similar composition. */ tileStyle?: boolean; trainingImage?: boolean; /** * (deprecated) Vertical expansion ratio. */ verticalExpansionRatio?: number; /** * The width of the rendered image. */ width?: number; } namespace Metadata { interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } /** * The thumbnail of the canvas */ interface Thumbnail { /** * The AssetId of the image used as a thumbnail for the canvas (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for the canvas */ url: string; } } /** * The properties of the asset, content may depend on the kind of asset returned */ interface Properties { size: number; /** * Number of animation frames if animations exist */ animationFrameCount?: number; /** * Bitrate of the media in bits per second */ bitrate?: number; /** * Number of bones if skeleton exists */ boneCount?: number; /** * Recommended preview camera mode emitted by the generator (gsplat route); passed * through to mesh-rendering verbatim. */ cameraMode?: 'aerial' | 'interior' | 'turntable'; /** * Recommended preview camera path emitted by the generator (gsplat route); passed * through to mesh-rendering verbatim. */ cameraTrajectory?: Array; /** * Number of channels of the audio */ channels?: number; /** * Number of Unicode code points in the text. Code-point-aware (so a non-BMP emoji * counts as 1) but not full grapheme-cluster aware (a ZWJ sequence still counts as * several). */ charCount?: number; /** * Classification of the audio */ classification?: 'effect' | 'interview' | 'music' | 'other' | 'sound' | 'speech' | 'text' | 'unknown'; /** * Codec name of the media */ codecName?: string; /** * Description of the audio */ description?: string; /** * Bounding box dimensions [width, height, depth] */ dimensions?: Array; /** * Duration of the media in seconds */ duration?: number; /** * Number of faces/triangles in the mesh */ faceCount?: number; /** * Format of the mesh file (e.g. 'glb', etc.) */ format?: string; /** * Frame rate of the video in frames per second */ frameRate?: number; /** * Whether the mesh has animations */ hasAnimations?: boolean; /** * True when `preview` holds the entire content unmodified — consumers can use it * directly without fetching `asset.url`. False or undefined means the content * exceeds the preview budget and consumers must fetch the full body from S3 to * read past the preview. */ hasFullPreview?: boolean; /** * Whether the mesh has normal vectors */ hasNormals?: boolean; /** * Whether the mesh has bones/skeleton */ hasSkeleton?: boolean; /** * Whether the mesh has UV coordinates */ hasUVs?: boolean; height?: number; /** * Number of frames in the video */ nbFrames?: number; /** * Leading slice of the content used for inline UI display and as a search * shortcut. Capped at TEXT_PREVIEW_MAX_BYTES (UTF-8) and always cut on a * code-point boundary so no character is split. Number of characters in the * preview varies by script (around 1024 for ASCII, ~340 for CJK, ~256 for * emoji-heavy text at the default 1 KB budget). */ preview?: string; /** * Sample rate of the media in Hz */ sampleRate?: number; /** * Transcription of the audio */ transcription?: Properties.Transcription; /** * Number of vertices in the mesh */ vertexCount?: number; width?: number; /** * Number of whitespace-separated words in the text */ wordCount?: number; } namespace Properties { /** * One explicit camera keyframe for the splat route. Several are interpolated over * the requested frames into an orbit/fly-through; a single keyframe renders a * static view. Overrides {@link SplatCameraMode} when provided. */ interface CameraTrajectory { /** * Camera eye position in the splat's world frame. */ position: Array; /** * Look-at point in the splat's world frame. */ target: Array; /** * Vertical field of view in degrees (defaults to 50 in the renderer). */ fov?: number; } /** * Transcription of the audio */ interface Transcription { text: string; } } /** * The video asset's first frame. * * Contains the assetId and the url of the first frame. */ interface FirstFrame { assetId: string; url: string; } /** * The video asset's last frame. * * Contains the assetId and the url of the last frame. */ interface LastFrame { assetId: string; url: string; } /** * The asset's preview. * * Contains the assetId and the url of the preview. */ interface Preview { assetId: string; url: string; } /** * SlopGuard detection result, computed asynchronously after generation. * * `details` (the per-dimension reasons and suggestions) is returned only when the * asset is read with `withSlopGuardDetails=true`. */ interface SlopGuard { /** * ISO-8601 timestamp of when scoring ran */ computedAt: string; /** * Whether scoring succeeded or errored */ status: 'error' | 'scored'; /** * Rubric/model version that produced this result */ version: string; /** * Generic AI-quality sub-score */ aiQualityScore?: number; /** * Ids of briefs that contributed */ appliedBriefIds?: Array; /** * Brief-compliance sub-score (omitted when no brief applied) */ briefComplianceScore?: number; /** * Per-dimension reasons and suggestions, as produced by the detector. * * Returned only when the asset is read with `withSlopGuardDetails=true` by the * project that owns it — the brief-compliance text paraphrases that project's * brief, so a cross-project read of a public asset gets the summary alone. Also * omitted when the archived verdict is unavailable (asset scored by an older * version, or an unreadable archive). */ details?: SlopGuard.Details; /** * Error message when status is 'error' (truncated) */ error?: string; /** * 0–100 composite score (present when status is 'scored') */ overallScore?: number; /** * Sensitivity used for the verdict */ sensitivity?: 'high' | 'low' | 'medium'; /** * pass / warn / fail (present when status is 'scored') */ verdict?: 'fail' | 'pass' | 'warn'; } namespace SlopGuard { /** * Per-dimension reasons and suggestions, as produced by the detector. * * Returned only when the asset is read with `withSlopGuardDetails=true` by the * project that owns it — the brief-compliance text paraphrases that project's * brief, so a cross-project read of a public asset gets the summary alone. Also * omitted when the archived verdict is unavailable (asset scored by an older * version, or an unreadable archive). */ interface Details { /** * Always-on generic AI-quality dimension */ aiQuality: Details.AIQuality; /** * Brief-compliance dimension; omitted when no brief applied */ briefCompliance?: Details.BriefCompliance; } namespace Details { /** * Always-on generic AI-quality dimension */ interface AIQuality { /** * Why the image scored as it did */ reasons: Array; /** * 0–100; higher is better (more compliant / less AI-looking) */ score: number; /** * Actionable suggestions to improve the score */ suggestions: Array; } /** * Brief-compliance dimension; omitted when no brief applied */ interface BriefCompliance { /** * Why the image scored as it did */ reasons: Array; /** * 0–100; higher is better (more compliant / less AI-looking) */ score: number; /** * Actionable suggestions to improve the score */ suggestions: Array; } } } /** * The asset's thumbnail. * * Contains the assetId and the url of the thumbnail. */ interface Thumbnail { assetId: string; url: string; } } /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ interface CostDetails { 'assistant-message'?: number; caption?: number; 'custom-generation'?: number; 'describe-style'?: number; detection?: number; embed?: number; 'image-prompt-editing'?: number; 'inference-images'?: number; 'ip-detection'?: number; pixelate?: number; prompt?: number; 'remove-background'?: number; repaint?: number; restyle?: number; segmentation?: number; 'skybox-base-360'?: number; 'skybox-upscale-360'?: number; 'slop-detection'?: number; texture?: number; 'train-model'?: number; translate?: number; upscale?: number; vectorization?: number; } /** * IP detection findings, when detection ran for this request. */ interface IPDetection { /** * Whether and how detection affected the request. */ action: 'allowed' | 'blocked' | 'flagged'; /** * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a * per-image fee for each analyzed input image. */ creativeUnitsCharged: number; /** * Number of enabled filters evaluated for this request. */ evaluatedFilters: number; /** * Per-filter verdicts gathered for this request. */ findings: Array; /** * Convenience flag; always true when action is not 'allowed'. */ flagged: boolean; /** * True if one or more detectors errored while evaluating this request. */ hasDetectorError?: boolean; } namespace IPDetection { /** * A single filter's verdict. */ interface Finding { /** * Category of the filter that produced this verdict. */ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character'; /** * Confidence score from 0 (low) to 1 (high). */ confidence: number; /** * Identifier of the filter that produced this verdict. */ filterId: string; /** * Display name of the filter that produced this verdict. */ filterName: string; /** * Whether this filter considered the request an IP risk. */ flagged: boolean; /** * Short, user-facing explanation of the verdict. */ reason: string; /** * Named entities the filter recognized (e.g. characters, brands, people). */ entities?: Array; } } } export interface GenerateEmbedResponse { /** * The embedding * * A 1_024 dimension vector */ embedding: Array; job: GenerateEmbedResponse.Job; /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ costDetails?: GenerateEmbedResponse.CostDetails; /** * The Compute Units cost for the request billed */ creativeUnitsCost?: number; /** * The Compute Units discount for the request billed */ creativeUnitsDiscount?: number; /** * IP detection findings, when detection ran for this request. */ ipDetection?: GenerateEmbedResponse.IPDetection; } export declare namespace GenerateEmbedResponse { interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } namespace Job { /** * Metadata of the job with some additional information */ interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown; }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown; }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } namespace Metadata { interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } namespace Flow { interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } namespace Logic { interface Case { condition: string; value: string; } } } } interface StatusHistory { date: string; status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ interface CostDetails { 'assistant-message'?: number; caption?: number; 'custom-generation'?: number; 'describe-style'?: number; detection?: number; embed?: number; 'image-prompt-editing'?: number; 'inference-images'?: number; 'ip-detection'?: number; pixelate?: number; prompt?: number; 'remove-background'?: number; repaint?: number; restyle?: number; segmentation?: number; 'skybox-base-360'?: number; 'skybox-upscale-360'?: number; 'slop-detection'?: number; texture?: number; 'train-model'?: number; translate?: number; upscale?: number; vectorization?: number; } /** * IP detection findings, when detection ran for this request. */ interface IPDetection { /** * Whether and how detection affected the request. */ action: 'allowed' | 'blocked' | 'flagged'; /** * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a * per-image fee for each analyzed input image. */ creativeUnitsCharged: number; /** * Number of enabled filters evaluated for this request. */ evaluatedFilters: number; /** * Per-filter verdicts gathered for this request. */ findings: Array; /** * Convenience flag; always true when action is not 'allowed'. */ flagged: boolean; /** * True if one or more detectors errored while evaluating this request. */ hasDetectorError?: boolean; } namespace IPDetection { /** * A single filter's verdict. */ interface Finding { /** * Category of the filter that produced this verdict. */ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character'; /** * Confidence score from 0 (low) to 1 (high). */ confidence: number; /** * Identifier of the filter that produced this verdict. */ filterId: string; /** * Display name of the filter that produced this verdict. */ filterName: string; /** * Whether this filter considered the request an IP risk. */ flagged: boolean; /** * Short, user-facing explanation of the verdict. */ reason: string; /** * Named entities the filter recognized (e.g. characters, brands, people). */ entities?: Array; } } } export interface GeneratePatchResponse { job: GeneratePatchResponse.Job; asset?: GeneratePatchResponse.Asset; /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ costDetails?: GeneratePatchResponse.CostDetails; /** * The Compute Units cost for the request billed */ creativeUnitsCost?: number; /** * The Compute Units discount for the request billed */ creativeUnitsDiscount?: number; /** * IP detection findings, when detection ran for this request. */ ipDetection?: GeneratePatchResponse.IPDetection; } export declare namespace GeneratePatchResponse { interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } namespace Job { /** * Metadata of the job with some additional information */ interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown; }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown; }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } namespace Metadata { interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } namespace Flow { interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } namespace Logic { interface Case { condition: string; value: string; } } } } interface StatusHistory { date: string; status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } interface Asset { /** * The asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ id: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId: string; /** * A list of CollectionId this asset belongs to */ collectionIds: Array; /** * The asset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * List of edit capabilities */ editCapabilities: Array<'DETECTION' | 'GENERATIVE_FILL' | 'PIXELATE' | 'PROMPT_EDITING' | 'REFINE' | 'REFRAME' | 'REMOVE_BACKGROUND' | 'SEGMENTATION' | 'UPSCALE' | 'UPSCALE_360' | 'VECTORIZATION'>; /** * The kind of asset */ kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * Metadata of the asset with some additional information */ metadata: Asset.Metadata; /** * The mime type of the asset (example: "image/png") */ mimeType: string; /** * The owner (project) ID (example: "proj_23tlk332lkht3kl2" or * "team_dlkhgs23tlk3hlkth32lkht3kl2" for old teams) */ ownerId: string; /** * The privacy of the asset */ privacy: 'private' | 'public' | 'unlisted'; /** * The properties of the asset, content may depend on the kind of asset returned */ properties: Asset.Properties; /** * source of the asset */ source: '3d23d' | '3d23d:texture' | '3d:texture' | '3d:texture:albedo' | '3d:texture:metallic' | '3d:texture:mtl' | '3d:texture:normal' | '3d:texture:roughness' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2splat' | 'img2txt' | 'img2video' | 'inference-control-net' | 'inference-control-net-img' | 'inference-control-net-inpainting' | 'inference-control-net-inpainting-ip-adapter' | 'inference-control-net-ip-adapter' | 'inference-control-net-reference' | 'inference-control-net-texture' | 'inference-img' | 'inference-img-ip-adapter' | 'inference-img-texture' | 'inference-in-paint' | 'inference-in-paint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt' | 'inference-txt-ip-adapter' | 'inference-txt-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture:albedo' | 'texture:ao' | 'texture:edge' | 'texture:height' | 'texture:metallic' | 'texture:normal' | 'texture:smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2txt' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-text' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone'; /** * The actual status */ status: 'error' | 'pending' | 'success'; /** * The associated tags (example: ["sci-fi", "landscape"]) */ tags: Array; /** * The asset last update date as an ISO string (example: * "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * Signed URL to get the asset content */ url: string; /** * Automatic captioning of the asset */ automaticCaptioning?: string; /** * The description, it will contain in priority: * * - the manual description * - the advanced captioning when the asset is used in training flow * - the automatic captioning */ description?: string; /** * The embedding of the asset when requested. * * Only available when an asset can be embedded (ie: not Detection maps) */ embedding?: Array; /** * The video asset's first frame. * * Contains the assetId and the url of the first frame. */ firstFrame?: Asset.FirstFrame; /** * Whether the asset is hidden. */ isHidden?: boolean; /** * The video asset's last frame. * * Contains the assetId and the url of the last frame. */ lastFrame?: Asset.LastFrame; /** * The NSFW labels */ nsfw?: Array; /** * The original file url. * * Contains the url of the original file. without any conversion. Only available * for some specific video, audio and threeD assets. Is only specified if the given * asset data has been replaced with a new file during the creation of the asset. */ originalFileUrl?: string; /** * The output index of the asset within a job This index is an positive integer * that starts at 0 It is used to differentiate between multiple outputs of the * same job If the job has only one output, this index is 0 */ outputIndex?: number; /** * The asset's preview. * * Contains the assetId and the url of the preview. */ preview?: Asset.Preview; /** * SlopGuard detection result, computed asynchronously after generation. * * `details` (the per-dimension reasons and suggestions) is returned only when the * asset is read with `withSlopGuardDetails=true`. */ slopGuard?: Asset.SlopGuard; /** * The asset's thumbnail. * * Contains the assetId and the url of the thumbnail. */ thumbnail?: Asset.Thumbnail; } namespace Asset { /** * Metadata of the asset with some additional information */ interface Metadata { kind: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The type of the asset. Ex: 'inference-txt2img' will represent an asset generated * from a text to image model */ type: '3d-texture' | '3d-texture-albedo' | '3d-texture-metallic' | '3d-texture-mtl' | '3d-texture-normal' | '3d-texture-roughness' | '3d23d' | '3d23d-texture' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2splat' | 'img2txt' | 'img2video' | 'inference-controlnet' | 'inference-controlnet-img2img' | 'inference-controlnet-inpaint' | 'inference-controlnet-inpaint-ip-adapter' | 'inference-controlnet-ip-adapter' | 'inference-controlnet-reference' | 'inference-controlnet-texture' | 'inference-img2img' | 'inference-img2img-ip-adapter' | 'inference-img2img-texture' | 'inference-inpaint' | 'inference-inpaint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt2img' | 'inference-txt2img-ip-adapter' | 'inference-txt2img-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture-albedo' | 'texture-ao' | 'texture-edge' | 'texture-height' | 'texture-metallic' | 'texture-normal' | 'texture-smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2txt' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-text' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone'; /** * How angular is the surface? 0 is like a sphere, 1 is like a mechanical object */ angular?: number; /** * The optional aspect ratio given for the generation, only applicable for some * models */ aspectRatio?: string; backgroundOpacity?: number; /** * The baseModelId that maybe changed at inference time */ baseModelId?: string; /** * A bounding box around the object of interest, in the format [x1, y1, x2, y2]. */ bbox?: Array; betterQuality?: boolean; /** * The control image already processed by canny detector. Must reference an * existing AssetId. */ cannyStructureImage?: string; /** * Activate clustering. */ clustering?: boolean; /** * Ensure upscaled tile have the same color histogram as original tile. */ colorCorrection?: boolean; colorMode?: string; colorPrecision?: number; /** * Flux Kontext LoRA to style the image. For Flux Kontext Prompt Editing. */ concepts?: Array; contours?: Array>>>; /** * End step for control. */ controlEnd?: number; /** * The date when the asset was copied to a project */ copiedAt?: string; cornerThreshold?: number; /** * Allow the generation of "hallucinations" during the upscale process, which adds * additional details and deviates from the original image. Default: optimized for * your preset and style. */ creativity?: number; /** * Amount of decay in creativity over the upscale process. The lowest the value, * the less the creativity will be preserved over the upscale process. */ creativityDecay?: number; /** * If true, use the default parameters */ defaultParameters?: boolean; /** * The depth fidelity if a depth image provided */ depthFidelity?: number; /** * The control image processed by depth estimator. Must reference an existing * AssetId. */ depthImage?: string; /** * Amount of details to remove or add */ detailsLevel?: number; dilate?: number; /** * Contrast factor for Grayscale detector */ factor?: number; filterSpeckle?: number; /** * Determine the scale at which the upscale process works. * * - With a small value, the upscale works at the largest scale, resulting in fewer * added details and more coherent images. Ideal for portraits, for example. * - With a large value, the upscale works at the smallest scale, resulting in more * added details and more hallucinations. Ideal for landscapes, for example. * * (info): A small value is slower and more expensive to run. */ fractality?: number; /** * Apply extra control to the Skybox 360 geometry. The higher the value, the more * the 360 geometry will influence the generated skybox image. * * Use with caution. Default is adapted to the other parameters. */ geometryEnforcement?: number; /** * The guidance used to generate this asset */ guidance?: number; halfMode?: boolean; hdr?: number; height?: number; /** * High threshold for Canny detector */ highThreshold?: number; /** * (deprecated) Horizontal expansion ratio. */ horizontalExpansionRatio?: number; /** * The input image to process. Must reference an existing AssetId or be a data URL. */ image?: string; /** * Strengthen the similarity to the original image during the upscale. Default: * optimized for your preset and style. */ imageFidelity?: number; /** * Preserve the seamless properties of skybox or texture images. Input has to be of * same type (seamless). */ imageType?: 'seamfull' | 'skybox' | 'texture'; /** * The id of the Inference describing how this image was generated */ inferenceId?: string; /** * When set to `high`, allows to better preserve details from the input images in * the output. This is especially useful when using images that contain elements * like faces or logos that require accurate preservation in the generated image. * * You can provide multiple input images that will all be preserved with high * fidelity, but keep in mind that the first image will be preserved with richer * textures and finer details, so if you include elements such as faces, consider * placing them in the first image. * * Only available for the `gpt-image-1` model. */ inputFidelity?: 'high' | 'low'; /** * Location of the input image in the output. */ inputLocation?: 'bottom' | 'left' | 'middle' | 'right' | 'top'; /** * To invert the relief */ invert?: boolean; /** * How polished is the surface? 0 is like a rough surface, 1 is like a mirror */ keypointThreshold?: number; layerDifference?: number; lengthThreshold?: number; /** * The ISO timestamp when the lock on the canvas will expire */ lockExpiresAt?: string; /** * Low threshold for Canny detector */ lowThreshold?: number; /** * The mask used for the asset generation or editing */ mask?: string; maxIterations?: number; /** * Maximum threshold for Grayscale conversion */ maxThreshold?: number; /** * Minimum threshold for Grayscale conversion */ minThreshold?: number; /** * Modality to detect */ modality?: 'canny' | 'depth' | 'grayscale' | 'lineart_anime' | 'mlsd' | 'normal' | 'pose' | 'scribble' | 'segmentation' | 'sketch'; mode?: string; /** * The modelId used to generate this asset */ modelId?: string; /** * The type of the generator used */ modelType?: 'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'; name?: string; nbMasks?: number; /** * The negative prompt used to generate this asset */ negativePrompt?: string; /** * Controls the influence of the negative prompt. Default 0 means the negative * prompt has no effect. Higher values increase negative prompt influence. Must * be > 0 if negativePrompt is provided. */ negativePromptStrength?: number; /** * The number of denoising steps for each image generation. */ numInferenceSteps?: number; /** * The number of outputs to generate. */ numOutputs?: number; originalAssetId?: string; outputIndex?: number; /** * Overlap percentage for the output image. */ overlapPercentage?: number; /** * Override the embeddings of the model. Only your prompt and negativePrompt will * be used. Use with caution. */ overrideEmbeddings?: boolean; parentId?: string; parentJobId?: string; pathPrecision?: number; /** * List of points (label, x, y) in the image where label = 0 for background and 1 * for object. */ points?: Array>; /** * How polished is the surface? 0 is like a rough surface, 1 is like a mirror */ polished?: number; preset?: string; progressPercent?: number; /** * The prompt that guided the asset generation or editing */ prompt?: string; /** * Increase the fidelity to the prompt during upscale. Default: optimized for your * preset and style. */ promptFidelity?: number; /** * How raised is the surface? 0 is flat like water, 1 is like a very rough rock */ raised?: number; /** * The reference images used for the asset generation or editing */ referenceImages?: Array; /** * Additional refinement steps before scaling. * * If scalingFactor == 1, the refinement process will be applied (1 + * refinementSteps) times. If scalingFactor > 1, the refinement process will be * applied refinementSteps times. */ refinementSteps?: number; /** * Remove background for Grayscale detector */ removeBackground?: boolean; /** * Size proportion of the input image in the output. */ resizeOption?: number; /** * Boolean to output the contours. */ resultContours?: boolean; /** * Boolean to return the source image with the mask applied as alpha channel (RGBA * PNG, transparent background) instead of the binary mask. Mutually exclusive with * `resultMask` — passing both as `true` returns a 400 error. Note: * `backgroundOpacity` is no longer honored — alpha is binary (0/255) only. */ resultImage?: boolean; /** * Boolean to return the binary masks in the response. Mutually exclusive with * `resultImage` — passing both as `true` returns a 400 error. */ resultMask?: boolean; rootParentId?: string; /** * Save a flipbook of the texture. Deactivated when the input texture is larger * than 2048x2048px */ saveFlipbook?: boolean; /** * Scaling factor (when `targetWidth` not specified) */ scalingFactor?: number; /** * The scheduler used to generate this asset */ scheduler?: string; /** * The seed used to generate this asset. Can be a string or a number in some * cases . */ seed?: string; /** * Sharpen tiles. */ sharpen?: boolean; /** * How shiny is the surface? 0 is like a matte surface, 1 is like a diamond */ shiny?: number; size?: number; /** * Activate sketch detection instead of canny. */ sketch?: boolean; sourceProjectId?: string; spliceThreshold?: number; /** * The strength * * Only available for the `flux-kontext` LoRA model. */ strength?: number; /** * Strength for the input image structure preservation */ structureFidelity?: number; /** * The control image for structure. A canny detector will be applied to this image. * Must reference an existing AssetId. */ structureImage?: string; style?: '3d-cartoon' | '3d-rendered' | 'anime' | 'cartoon' | 'cinematic' | 'claymation' | 'cloud-skydome' | 'comic' | 'cyberpunk' | 'enchanted' | 'fantasy' | 'ink' | 'manga' | 'manga-color' | 'minimalist' | 'neon-tron' | 'oil-painting' | 'pastel' | 'photo' | 'photography' | 'psychedelic' | 'retro-fantasy' | 'scifi-concept-art' | 'space' | 'standard' | 'whimsical'; /** * The higher the value the more it will look like the style image(s) */ styleFidelity?: number; /** * List of style images. Most of the time, only one image is enough. It must be * existing AssetIds. */ styleImages?: Array; /** * Condition the influence of the style image(s). The higher the value, the more * the style images will influence the upscaled image. */ styleImagesFidelity?: number; /** * The target height of the output image. */ targetHeight?: number; /** * Target width for the upscaled image, take priority over scaling factor */ targetWidth?: number; /** * A textual description / keywords describing the object of interest. */ text?: string; /** * The asset to convert in texture maps. Must reference an existing AssetId. */ texture?: string; /** * The thumbnail of the canvas */ thumbnail?: Metadata.Thumbnail; /** * If set to true, during the upscaling process, the model will match tiles of the * source image with tiles of the style image(s). This will result in a more * coherent restyle. Works best with style images that have a similar composition. */ tileStyle?: boolean; trainingImage?: boolean; /** * (deprecated) Vertical expansion ratio. */ verticalExpansionRatio?: number; /** * The width of the rendered image. */ width?: number; } namespace Metadata { interface Concept { /** * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w") */ modelId: string; /** * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale * is between 0 and 2. */ scale: number; /** * The epoch of the model (example: "000001") Only available for Flux Lora Trained * models */ modelEpoch?: string; } /** * The thumbnail of the canvas */ interface Thumbnail { /** * The AssetId of the image used as a thumbnail for the canvas (example: * "asset_GTrL3mq4SXWyMxkOHRxlpw") */ assetId: string; /** * The url of the image used as a thumbnail for the canvas */ url: string; } } /** * The properties of the asset, content may depend on the kind of asset returned */ interface Properties { size: number; /** * Number of animation frames if animations exist */ animationFrameCount?: number; /** * Bitrate of the media in bits per second */ bitrate?: number; /** * Number of bones if skeleton exists */ boneCount?: number; /** * Recommended preview camera mode emitted by the generator (gsplat route); passed * through to mesh-rendering verbatim. */ cameraMode?: 'aerial' | 'interior' | 'turntable'; /** * Recommended preview camera path emitted by the generator (gsplat route); passed * through to mesh-rendering verbatim. */ cameraTrajectory?: Array; /** * Number of channels of the audio */ channels?: number; /** * Number of Unicode code points in the text. Code-point-aware (so a non-BMP emoji * counts as 1) but not full grapheme-cluster aware (a ZWJ sequence still counts as * several). */ charCount?: number; /** * Classification of the audio */ classification?: 'effect' | 'interview' | 'music' | 'other' | 'sound' | 'speech' | 'text' | 'unknown'; /** * Codec name of the media */ codecName?: string; /** * Description of the audio */ description?: string; /** * Bounding box dimensions [width, height, depth] */ dimensions?: Array; /** * Duration of the media in seconds */ duration?: number; /** * Number of faces/triangles in the mesh */ faceCount?: number; /** * Format of the mesh file (e.g. 'glb', etc.) */ format?: string; /** * Frame rate of the video in frames per second */ frameRate?: number; /** * Whether the mesh has animations */ hasAnimations?: boolean; /** * True when `preview` holds the entire content unmodified — consumers can use it * directly without fetching `asset.url`. False or undefined means the content * exceeds the preview budget and consumers must fetch the full body from S3 to * read past the preview. */ hasFullPreview?: boolean; /** * Whether the mesh has normal vectors */ hasNormals?: boolean; /** * Whether the mesh has bones/skeleton */ hasSkeleton?: boolean; /** * Whether the mesh has UV coordinates */ hasUVs?: boolean; height?: number; /** * Number of frames in the video */ nbFrames?: number; /** * Leading slice of the content used for inline UI display and as a search * shortcut. Capped at TEXT_PREVIEW_MAX_BYTES (UTF-8) and always cut on a * code-point boundary so no character is split. Number of characters in the * preview varies by script (around 1024 for ASCII, ~340 for CJK, ~256 for * emoji-heavy text at the default 1 KB budget). */ preview?: string; /** * Sample rate of the media in Hz */ sampleRate?: number; /** * Transcription of the audio */ transcription?: Properties.Transcription; /** * Number of vertices in the mesh */ vertexCount?: number; width?: number; /** * Number of whitespace-separated words in the text */ wordCount?: number; } namespace Properties { /** * One explicit camera keyframe for the splat route. Several are interpolated over * the requested frames into an orbit/fly-through; a single keyframe renders a * static view. Overrides {@link SplatCameraMode} when provided. */ interface CameraTrajectory { /** * Camera eye position in the splat's world frame. */ position: Array; /** * Look-at point in the splat's world frame. */ target: Array; /** * Vertical field of view in degrees (defaults to 50 in the renderer). */ fov?: number; } /** * Transcription of the audio */ interface Transcription { text: string; } } /** * The video asset's first frame. * * Contains the assetId and the url of the first frame. */ interface FirstFrame { assetId: string; url: string; } /** * The video asset's last frame. * * Contains the assetId and the url of the last frame. */ interface LastFrame { assetId: string; url: string; } /** * The asset's preview. * * Contains the assetId and the url of the preview. */ interface Preview { assetId: string; url: string; } /** * SlopGuard detection result, computed asynchronously after generation. * * `details` (the per-dimension reasons and suggestions) is returned only when the * asset is read with `withSlopGuardDetails=true`. */ interface SlopGuard { /** * ISO-8601 timestamp of when scoring ran */ computedAt: string; /** * Whether scoring succeeded or errored */ status: 'error' | 'scored'; /** * Rubric/model version that produced this result */ version: string; /** * Generic AI-quality sub-score */ aiQualityScore?: number; /** * Ids of briefs that contributed */ appliedBriefIds?: Array; /** * Brief-compliance sub-score (omitted when no brief applied) */ briefComplianceScore?: number; /** * Per-dimension reasons and suggestions, as produced by the detector. * * Returned only when the asset is read with `withSlopGuardDetails=true` by the * project that owns it — the brief-compliance text paraphrases that project's * brief, so a cross-project read of a public asset gets the summary alone. Also * omitted when the archived verdict is unavailable (asset scored by an older * version, or an unreadable archive). */ details?: SlopGuard.Details; /** * Error message when status is 'error' (truncated) */ error?: string; /** * 0–100 composite score (present when status is 'scored') */ overallScore?: number; /** * Sensitivity used for the verdict */ sensitivity?: 'high' | 'low' | 'medium'; /** * pass / warn / fail (present when status is 'scored') */ verdict?: 'fail' | 'pass' | 'warn'; } namespace SlopGuard { /** * Per-dimension reasons and suggestions, as produced by the detector. * * Returned only when the asset is read with `withSlopGuardDetails=true` by the * project that owns it — the brief-compliance text paraphrases that project's * brief, so a cross-project read of a public asset gets the summary alone. Also * omitted when the archived verdict is unavailable (asset scored by an older * version, or an unreadable archive). */ interface Details { /** * Always-on generic AI-quality dimension */ aiQuality: Details.AIQuality; /** * Brief-compliance dimension; omitted when no brief applied */ briefCompliance?: Details.BriefCompliance; } namespace Details { /** * Always-on generic AI-quality dimension */ interface AIQuality { /** * Why the image scored as it did */ reasons: Array; /** * 0–100; higher is better (more compliant / less AI-looking) */ score: number; /** * Actionable suggestions to improve the score */ suggestions: Array; } /** * Brief-compliance dimension; omitted when no brief applied */ interface BriefCompliance { /** * Why the image scored as it did */ reasons: Array; /** * 0–100; higher is better (more compliant / less AI-looking) */ score: number; /** * Actionable suggestions to improve the score */ suggestions: Array; } } } /** * The asset's thumbnail. * * Contains the assetId and the url of the thumbnail. */ interface Thumbnail { assetId: string; url: string; } } /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ interface CostDetails { 'assistant-message'?: number; caption?: number; 'custom-generation'?: number; 'describe-style'?: number; detection?: number; embed?: number; 'image-prompt-editing'?: number; 'inference-images'?: number; 'ip-detection'?: number; pixelate?: number; prompt?: number; 'remove-background'?: number; repaint?: number; restyle?: number; segmentation?: number; 'skybox-base-360'?: number; 'skybox-upscale-360'?: number; 'slop-detection'?: number; texture?: number; 'train-model'?: number; translate?: number; upscale?: number; vectorization?: number; } /** * IP detection findings, when detection ran for this request. */ interface IPDetection { /** * Whether and how detection affected the request. */ action: 'allowed' | 'blocked' | 'flagged'; /** * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a * per-image fee for each analyzed input image. */ creativeUnitsCharged: number; /** * Number of enabled filters evaluated for this request. */ evaluatedFilters: number; /** * Per-filter verdicts gathered for this request. */ findings: Array; /** * Convenience flag; always true when action is not 'allowed'. */ flagged: boolean; /** * True if one or more detectors errored while evaluating this request. */ hasDetectorError?: boolean; } namespace IPDetection { /** * A single filter's verdict. */ interface Finding { /** * Category of the filter that produced this verdict. */ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character'; /** * Confidence score from 0 (low) to 1 (high). */ confidence: number; /** * Identifier of the filter that produced this verdict. */ filterId: string; /** * Display name of the filter that produced this verdict. */ filterName: string; /** * Whether this filter considered the request an IP risk. */ flagged: boolean; /** * Short, user-facing explanation of the verdict. */ reason: string; /** * Named entities the filter recognized (e.g. characters, brands, people). */ entities?: Array; } } } export interface GeneratePromptResponse { job: GeneratePromptResponse.Job; /** * The generated prompts. */ prompts: Array; /** * The full ready-to-run model calls, index-aligned with `prompts`: `prompts[i]` is * the prompt text of `calls[i]`. */ calls?: Array; /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ costDetails?: GeneratePromptResponse.CostDetails; /** * The Compute Units cost for the request billed */ creativeUnitsCost?: number; /** * The Compute Units discount for the request billed */ creativeUnitsDiscount?: number; /** * IP detection findings, when detection ran for this request. */ ipDetection?: GeneratePromptResponse.IPDetection; /** * The mode used to generate new prompt(s). */ mode?: 'completion' | 'contextual' | 'contextual-v2' | 'image-editing' | 'inventive' | 'structured'; } export declare namespace GeneratePromptResponse { interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } namespace Job { /** * Metadata of the job with some additional information */ interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown; }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown; }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } namespace Metadata { interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } namespace Flow { interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } namespace Logic { interface Case { condition: string; value: string; } } } } interface StatusHistory { date: string; status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } /** * A complete, ready-to-run model call proposed by Prompt Spark v3. * * The prompt text is carried inside `parameters` under the target model's prompt * input (when the model defines one). For models without a prompt input, the text * is only available in the index-aligned `prompts` array. */ interface Call { /** * The target model the call is for. */ modelId: string; /** * Schema-valid dynamic parameters for the target model, prompt included. */ parameters: unknown; /** * Optional rationale for the proposed call. */ rationale?: string; } /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ interface CostDetails { 'assistant-message'?: number; caption?: number; 'custom-generation'?: number; 'describe-style'?: number; detection?: number; embed?: number; 'image-prompt-editing'?: number; 'inference-images'?: number; 'ip-detection'?: number; pixelate?: number; prompt?: number; 'remove-background'?: number; repaint?: number; restyle?: number; segmentation?: number; 'skybox-base-360'?: number; 'skybox-upscale-360'?: number; 'slop-detection'?: number; texture?: number; 'train-model'?: number; translate?: number; upscale?: number; vectorization?: number; } /** * IP detection findings, when detection ran for this request. */ interface IPDetection { /** * Whether and how detection affected the request. */ action: 'allowed' | 'blocked' | 'flagged'; /** * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a * per-image fee for each analyzed input image. */ creativeUnitsCharged: number; /** * Number of enabled filters evaluated for this request. */ evaluatedFilters: number; /** * Per-filter verdicts gathered for this request. */ findings: Array; /** * Convenience flag; always true when action is not 'allowed'. */ flagged: boolean; /** * True if one or more detectors errored while evaluating this request. */ hasDetectorError?: boolean; } namespace IPDetection { /** * A single filter's verdict. */ interface Finding { /** * Category of the filter that produced this verdict. */ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character'; /** * Confidence score from 0 (low) to 1 (high). */ confidence: number; /** * Identifier of the filter that produced this verdict. */ filterId: string; /** * Display name of the filter that produced this verdict. */ filterName: string; /** * Whether this filter considered the request an IP risk. */ flagged: boolean; /** * Short, user-facing explanation of the verdict. */ reason: string; /** * Named entities the filter recognized (e.g. characters, brands, people). */ entities?: Array; } } } export interface GenerateRunModelResponse { job: GenerateRunModelResponse.Job; /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ costDetails?: GenerateRunModelResponse.CostDetails; /** * The Compute Units cost for the request billed */ creativeUnitsCost?: number; /** * The Compute Units discount for the request billed */ creativeUnitsDiscount?: number; /** * IP detection findings, when detection ran for this request. */ ipDetection?: GenerateRunModelResponse.IPDetection; } export declare namespace GenerateRunModelResponse { interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } namespace Job { /** * Metadata of the job with some additional information */ interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown; }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown; }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } namespace Metadata { interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } namespace Flow { interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } namespace Logic { interface Case { condition: string; value: string; } } } } interface StatusHistory { date: string; status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ interface CostDetails { 'assistant-message'?: number; caption?: number; 'custom-generation'?: number; 'describe-style'?: number; detection?: number; embed?: number; 'image-prompt-editing'?: number; 'inference-images'?: number; 'ip-detection'?: number; pixelate?: number; prompt?: number; 'remove-background'?: number; repaint?: number; restyle?: number; segmentation?: number; 'skybox-base-360'?: number; 'skybox-upscale-360'?: number; 'slop-detection'?: number; texture?: number; 'train-model'?: number; translate?: number; upscale?: number; vectorization?: number; } /** * IP detection findings, when detection ran for this request. */ interface IPDetection { /** * Whether and how detection affected the request. */ action: 'allowed' | 'blocked' | 'flagged'; /** * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a * per-image fee for each analyzed input image. */ creativeUnitsCharged: number; /** * Number of enabled filters evaluated for this request. */ evaluatedFilters: number; /** * Per-filter verdicts gathered for this request. */ findings: Array; /** * Convenience flag; always true when action is not 'allowed'. */ flagged: boolean; /** * True if one or more detectors errored while evaluating this request. */ hasDetectorError?: boolean; } namespace IPDetection { /** * A single filter's verdict. */ interface Finding { /** * Category of the filter that produced this verdict. */ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character'; /** * Confidence score from 0 (low) to 1 (high). */ confidence: number; /** * Identifier of the filter that produced this verdict. */ filterId: string; /** * Display name of the filter that produced this verdict. */ filterName: string; /** * Whether this filter considered the request an IP risk. */ flagged: boolean; /** * Short, user-facing explanation of the verdict. */ reason: string; /** * Named entities the filter recognized (e.g. characters, brands, people). */ entities?: Array; } } } export interface GenerateTranslateResponse { /** * Detected language of the input. */ detectedLanguage: string; job: GenerateTranslateResponse.Job; /** * The translated prompt. */ translation: string; /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ costDetails?: GenerateTranslateResponse.CostDetails; /** * The Compute Units cost for the request billed */ creativeUnitsCost?: number; /** * The Compute Units discount for the request billed */ creativeUnitsDiscount?: number; /** * IP detection findings, when detection ran for this request. */ ipDetection?: GenerateTranslateResponse.IPDetection; } export declare namespace GenerateTranslateResponse { interface Job { /** * The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ createdAt: string; /** * The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8") */ jobId: string; /** * The type of job */ jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'splat' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow'; /** * Metadata of the job with some additional information */ metadata: Job.Metadata; /** * Progress of the job (between 0 and 1) */ progress: number; /** * The current status of the job */ status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; /** * The history of the different statuses the job went through with the ISO string * date of when the job reached each statuses. */ statusHistory: Array; /** * The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z") */ updatedAt: string; /** * The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea") */ authorId?: string; /** * The billing of the job */ billing?: Job.Billing; /** * The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D") */ ownerId?: string; } namespace Job { /** * Metadata of the job with some additional information */ interface Metadata { /** * List of produced assets for this job */ assetIds?: Array; /** * Eventual error for the job */ error?: string | null; /** * The flow of the job. Only available for workflow jobs. */ flow?: Array; /** * Actionable hint for the user explaining what went wrong and how to resolve it. */ hint?: string; /** * The inputs for the job */ input?: { [key: string]: unknown; }; /** * May contain the output of the job for specific custom models jobs. Only * available for custom models which generate non-assets outputs. Example: LLM text * results. */ output?: { [key: string]: unknown; }; /** * For voice-clone jobs: the ID of the model being trained. */ outputModelId?: string; /** * The workflow ID of the job if job is part of a workflow. */ workflowId?: string; /** * The workflow job ID of the job if job is part of a workflow job. */ workflowJobId?: string; } namespace Metadata { interface Flow { /** * The id of the node. */ id: string; /** * The status of the node. Only available for WorkflowJob nodes. */ status: 'failure' | 'pending' | 'processing' | 'rejected' | 'skipped' | 'success'; /** * The type of the job for the node. */ type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow'; /** * List of produced assets for this node. */ assets?: Array; /** * Fixed number of iterations for a ForEach node. When set, the loop runs exactly * `count` times regardless of array input. When not set, the loop iterates over * the resolved array input. Only available for ForEach nodes. */ count?: number; /** * The nodes that this node depends on. Only available for nodes that have * dependencies. Mainly used for user approval nodes. */ dependsOn?: Array; /** * If true, the outputs of this node will be included in the workflow job's final * output. Only applicable to producing nodes (custom-model, inference, etc.). By * default, only last nodes (nodes not referenced by other nodes) contribute to * outputs. Set this to true to also include intermediate nodes in the final * output. Note: This should only be set to `true` or left undefined. */ includeOutputsInWorkflowJob?: true; /** * The inputs of the node. */ inputs?: Array; /** * Statically-configured items for a List node. The node outputs this array as-is * when executed. Only available for List nodes. The values can be strings, * numbers, or asset IDs. */ items?: Array; /** * Zero-based index of the iteration this node copy belongs to. Set on * dynamically-created copies of loop body nodes. */ iterationIndex?: number; /** * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is * only available for nodes started. A node "Pending" for a running workflow job is * not started. */ jobId?: string; /** * The logic of the node. Only available for logic nodes. */ logic?: Flow.Logic; /** * The type of the logic for the node. Only available for logic nodes. */ logicType?: 'if-else'; /** * IDs of the body template nodes that belong to this ForEach loop. At runtime * these templates are cloned once per iteration and marked Skipped. Only available * for ForEach nodes. */ loopBodyNodeIds?: Array; /** * ID of the ForEach node that spawned this iteration copy. Set on * dynamically-created copies of loop body nodes. */ loopNodeId?: string; /** * The model id for the node. Mainly used for custom model tasks. */ modelId?: string; /** * The output of the node. Only available for logic nodes. */ output?: unknown; /** * The workflow id for the node. Mainly used for workflow tasks. */ workflowId?: string; } namespace Flow { interface Asset { assetId: string; url: string; } /** * This is used to run the flow. */ interface Input { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The configured items for inputs_array type inputs. Each item is an array of * SubNodeInput that need ref/value resolution. Only available for inputs_array * type. */ items?: Array>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Input.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Input.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Input { /** * A sub-input within an inputs_array item. Same as NodeInput but without the * recursive items field. */ interface Item { /** * The name that must be user to call the model through the API */ name: string; /** * The data type of the input */ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array'; /** * The allowed values for the input. For \`string\` or \`number\` types, creates a * single-select dropdown. For \`string_array\` type, creates a multi-select * dropdown. */ allowedValues?: Array; /** * Specifies the background behavior for the input. Only available for \`file\` and * \`file_array\` input types with kind \`image\`. */ backgroundBehavior?: 'opaque' | 'transparent'; /** * Whether the input is a color or not. Only available for \`string\` input type. */ color?: boolean; /** * Whether this input affects the model's cost calculation */ costImpact?: boolean; /** * The default value for the input */ default?: unknown; /** * Help text displayed in the UI to provide additional information about the input */ description?: string; /** * Used to visually group inputs together in the UI. Inputs with the same group * value appear consecutively in the UI. */ group?: string; /** * Hint text displayed in the UI as a tooltip to guide the user */ hint?: string; /** * The list of inputs which form an object within a container array. All inputs are * the same as the current object. This is only available for type inputs_array * inputs. */ inputs?: Array<{ [key: string]: unknown; }>; /** * The asset kind of the input. Only taken into account for \`file\` and * \`file_array\` input types. If model provides multiple kinds, the input will be * not able to create the asset on the flight on API side with dataurl without * data:kind, prefix */ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video'; /** * The label displayed in the UI for this input */ label?: string; /** * The name of the file input field to use as the mask source */ maskFrom?: string; /** * The maximum allowed value. Only available for \`number\` and \`array\` input * types. */ max?: number; /** * The maximum allowed media duration in seconds. Only applies to \`file\` and * \`file_array\` input types for video and audio assets. Validated against * \`asset.properties.duration\` at job creation time. */ maxDuration?: number; /** * The maximum allowed length for \`string\` inputs. Also applies to each item in * \`string_array\`. */ maxLength?: number; /** * The maximum allowed file size in bytes. Only applies to \`file\` and * \`file_array\` input types. Validated against \`asset.properties.size\` at job * creation time. */ maxSize?: number; /** * The minimum allowed value. Only available for \`number\` and array input types. */ min?: number; /** * The minimum allowed length for string inputs. Also applies to each item in * \`string_array\`. */ minLength?: number; /** * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only * available for \`model_array\` input type. */ modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>; /** * Whether this input represents a parent asset to assign to the produced assets. * Only available for \`file\` and \`file_array\` input types. * * For \`file_array\`, the parent asset is the first item in the array. */ parent?: boolean; /** * Placeholder text for the input. Only available for 'string' input type. */ placeholder?: string; /** * Whether the input is a prompt. When true, displays as a text area with prompt * spark feature. Only available for \`string\` input type. */ prompt?: boolean; /** * Whether the input is used with prompt spark. Only available for \`string\` input * type. */ promptSpark?: boolean; /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ ref?: Item.Ref; /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ required?: Item.Required; /** * The step increment for numeric inputs. Only available for \`number\` input type. */ step?: number; /** * The value of the input. This is the value of the input that will be used to run * the node. Only available for flows managed by a WorkflowJob. */ value?: unknown; } namespace Item { /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The reference to another input or output of the same workflow. Must have at * least one of node or conditional. */ interface Ref { /** * The conditional nodes to reference. If the conditional nodes are successful, the * node will be successful. If the conditional nodes are skipped, the node will be * skipped. Contains an array of node ids used to check the status of the nodes. */ conditional?: Array; /** * This is the desired node output value if ref is an if/else node. */ equal?: string; /** * The name of the input or output to reference. If the type is 'workflow', the * name is the name of the input of the workflow is required If the type is 'node', * the name is not mandatory, except if you want all outputs of the node. To get * all outputs of a node, you can use the name 'all'. */ name?: string; /** * The node id or 'workflow' if the source is a workflow input. */ node?: string; } /** * Set of rules that describes when this input is required: * * - \`always\`: Input is always required * - \`ifNotDefined\`: Input is required when another specified input is not * defined * - \`ifDefined\`: Input is required when another specified input is defined * - \`conditionalValues\`: Input is required when another input has a specific * value * * By default, the input is not required. */ interface Required { /** * Whether the input is always required */ always?: boolean; /** * Makes this input required when another input has a specific value: * * - Key: name of the input to check * - Value: operation and allowed values that trigger the requirement */ conditionalValues?: unknown; /** * Makes this input required when another input is defined: * * - Key: name of the input that must be defined * - Value: message to display when this input is required */ ifDefined?: unknown; /** * Makes this input required when another input is not defined: * * - Key: name of the input that must be undefined * - Value: message to display when this input is required */ ifNotDefined?: unknown; } } /** * The logic of the node. Only available for logic nodes. */ interface Logic { /** * The cases of the logic. Only available for if/else nodes. */ cases?: Array; /** * The default case of the logic. Contains the id/output of the node to execute if * no case is matched. Only available for if/else nodes. */ default?: string; /** * The transform of the logic. Only available for transform nodes. */ transform?: string; } namespace Logic { interface Case { condition: string; value: string; } } } } interface StatusHistory { date: string; status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up'; } /** * The billing of the job */ interface Billing { cuCost: number; cuDiscount: number; /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ cuCostDetails?: Billing.CuCostDetails; /** * When true, the credits charged for this job are not automatically refunded if * the generation fails, because the model used does not support refund-on-failure. * Absent or false means a failed generation is refunded as usual. */ disableRefund?: boolean; } namespace Billing { /** * Compute Units charged for the ADD-ONS of this job, per action — the fees paid on * top of the generation itself, such as `slop-detection`. * * `cuCost` above is the main action alone, so the job's total is `cuCost` plus the * values here. * * Two caveats when displaying it: * * - These are a remaining refundable balance, not a receipt: a job that failed or * was cancelled has had its add-ons refunded, so they read 0 while `cuCost` * still shows the main action's original charge. * - `ip-detection` is part of the shape but is never populated today: that fee is * charged outside the job and reported once, as * `ipDetection.creativeUnitsCharged`, in the response of the request that ran * it. * * Absent when the job paid for no add-on. */ interface CuCostDetails { 'ip-detection'?: number; 'slop-detection'?: number; } } } /** * Compute Units cost per billing action for this request, after discount. Values * sum to `creativeUnitsCost`. Only Compute-Units-consuming actions with a non-zero * charge appear. Lets clients split the total (e.g. generation vs * `slop-detection`) — including on dryRun estimates. */ interface CostDetails { 'assistant-message'?: number; caption?: number; 'custom-generation'?: number; 'describe-style'?: number; detection?: number; embed?: number; 'image-prompt-editing'?: number; 'inference-images'?: number; 'ip-detection'?: number; pixelate?: number; prompt?: number; 'remove-background'?: number; repaint?: number; restyle?: number; segmentation?: number; 'skybox-base-360'?: number; 'skybox-upscale-360'?: number; 'slop-detection'?: number; texture?: number; 'train-model'?: number; translate?: number; upscale?: number; vectorization?: number; } /** * IP detection findings, when detection ran for this request. */ interface IPDetection { /** * Whether and how detection affected the request. */ action: 'allowed' | 'blocked' | 'flagged'; /** * IP-detection CU fee, separate from creativeUnitsCost: a fixed base fee plus a * per-image fee for each analyzed input image. */ creativeUnitsCharged: number; /** * Number of enabled filters evaluated for this request. */ evaluatedFilters: number; /** * Per-filter verdicts gathered for this request. */ findings: Array; /** * Convenience flag; always true when action is not 'allowed'. */ flagged: boolean; /** * True if one or more detectors errored while evaluating this request. */ hasDetectorError?: boolean; } namespace IPDetection { /** * A single filter's verdict. */ interface Finding { /** * Category of the filter that produced this verdict. */ category: 'artist-style' | 'brand-trademark' | 'celebrity-likeness' | 'custom' | 'fictional-character'; /** * Confidence score from 0 (low) to 1 (high). */ confidence: number; /** * Identifier of the filter that produced this verdict. */ filterId: string; /** * Display name of the filter that produced this verdict. */ filterName: string; /** * Whether this filter considered the request an IP risk. */ flagged: boolean; /** * Short, user-facing explanation of the verdict. */ reason: string; /** * Named entities the filter recognized (e.g. characters, brands, people). */ entities?: Array; } } } export interface GenerateCaptionParams { /** * Body param: List of images used to generate captions. Results are returned in * the same order as the given images. * * Images are set a data URLs (example: * \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\") * or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\"). * * Notes: * * - if both `modelId` and `images` are provided, `modelId`'s examples and training * images will be used to influence the caption structure of the images * - if only `images` are provided, the captions will be conditioned by the * `detailsLevel` parameter * - Replaces `assetIds` parameter * - if you want to caption multiple images at a time, please prefer using asset * ids instead of data url */ images: Array; /** * Query param */ dryRun?: unknown; /** * Query param */ projectId?: unknown; /** * Body param: The assetIds to generate captions. Results are returned in the same * order as the given assetIds. Deprecated, use `images` parameter instead. */ assetIds?: Array; /** * Body param: The details level used to generate the captions. * * When a modelId is provided and examples are available, the details level is * ignored. */ detailsLevel?: 'action' | 'action+style'; /** * Body param: Whether we try to ensure IP removal for new prompt generation. */ ensureIPCleared?: boolean; /** * Body param: When provided, the model will follow the model's training images and * examples' prompt to generate the captions. */ modelId?: string; /** * Body param: 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.. */ seed?: number; /** * Body param: 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. */ temperature?: number; /** * Body param: 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. */ topP?: number; /** * Body param: Optional list of words sequences that should not be present in the * generated prompts. */ unwantedSequences?: Array; } export interface GenerateDescribeStyleParams { /** * Query param */ dryRun?: unknown; /** * Query param */ projectId?: unknown; /** * Body param: The asset ids used to condition the generation. */ assetIds?: Array; /** * Body param: Whether we try to ensure IP removal for new prompt generation. */ ensureIPCleared?: boolean; /** * Body param: 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?: Array; /** * Body param: The modelId used to condition the generation. * * When provided, the generation will take into account model's training images, * examples. * * In `contextual` mode, the modelId is used to retrieve additional context from * the model such as its type and capabilities. */ modelId?: string; /** * Body param: 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.. */ seed?: number; /** * Body param: 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. */ temperature?: number; /** * Body param: 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. */ topP?: number; /** * Body param: Optional list of words sequences that should not be present in the * generated prompts. */ unwantedSequences?: Array; } export interface GenerateDetectParams { /** * Body param: The image to be used to detect. Must reference an existing AssetId * or be a data URL. */ image: string; /** * Body param: Modality to detect */ modality: 'canny' | 'depth' | 'grayscale' | 'lineart_anime' | 'mlsd' | 'normal' | 'pose' | 'scribble' | 'segmentation' | 'sketch'; /** * Query param */ dryRun?: unknown; /** * Query param: If set to true, returns the original asset without transformation */ originalAssets?: boolean; /** * Query param */ projectId?: unknown; /** * Body param: Contrast factor for Grayscale detector */ factor?: number; /** * Body param: High threshold for Canny detector */ highThreshold?: number; /** * Body param: How polished is the surface? 0 is like a rough surface, 1 is like a * mirror */ keypointThreshold?: number; /** * Body param: Low threshold for Canny detector */ lowThreshold?: number; /** * Body param: Maximum threshold for Grayscale conversion */ maxThreshold?: number; /** * Body param: Minimum threshold for Grayscale conversion */ minThreshold?: number; /** * Body param: Remove background for Grayscale detector */ removeBackground?: boolean; } export interface GenerateEmbedParams { /** * Body param: The text to embed. Must be a non-empty string. */ text: string; /** * Query param */ dryRun?: unknown; /** * Query param: If set to true, returns the original asset without transformation */ originalAssets?: boolean; /** * Query param */ projectId?: unknown; } export interface GeneratePatchParams { /** * Body param: The input image as a data URL (example: * "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=") * or the asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ image: string; /** * Query param */ dryRun?: unknown; /** * Query param: If set to true, returns the original asset without transformation */ originalAssets?: boolean; /** * Query param */ projectId?: unknown; /** * Body param: Whether to allow the merged image to extend the size of the original * (when x or y are negative or merged image is bigger) */ allowOverflow?: boolean; /** * Body param: The background color as an hexadecimal code (ex: "#FFFFFF"), an html * color (ex: "red") or "transparent" if "format" is "png". Default to "white" */ backgroundColor?: string; /** * Body param: The crop operation to apply to the image. Applied before any * operation. For the backgroundColor: rgba, hex or named color are supported. */ crop?: GeneratePatchParams.Crop; /** * Body param: The output format. Default to "png" */ format?: 'jpeg' | 'png'; /** * Body param: The image to be merged. */ patch?: GeneratePatchParams.Patch; /** * Body param: The position of the image to be merged. */ position?: GeneratePatchParams.Position; } export declare namespace GeneratePatchParams { /** * The crop operation to apply to the image. Applied before any operation. For the * backgroundColor: rgba, hex or named color are supported. */ interface Crop { height: number; left: number; top: number; width: number; backgroundColor?: string; } /** * The image to be merged. */ interface Patch { /** * The source of the image to be merged, as a data URL (example: * "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=") * or the asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw") */ image: string; /** * The mode of merging the images: `override` or `erase`. */ mode: 'erase' | 'override'; } /** * The position of the image to be merged. */ interface Position { /** * The X position of the image to be merged, in pixels. */ x: number; /** * The Y position of the image to be merged, in pixels. */ y: number; } } export interface GeneratePromptParams { /** * Body param: The mode used to generate new prompt(s). */ mode: 'completion' | 'contextual' | 'contextual-v2' | 'image-editing' | 'inventive' | 'structured'; /** * Query param */ dryRun?: unknown; /** * Query param */ projectId?: unknown; /** * Body param: The asset ids used to condition the generation. * * Notes: * * - supersedes the `modelId` parameter when provided. * - ignored when `mode` is `image-editing-prompt`. */ assetIds?: Array; /** * Body param: Whether we try to ensure IP removal for new prompt generation. */ ensureIPCleared?: boolean; /** * Body param: 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`. */ image?: string; /** * Body param: 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\"). * * A referenced asset ID may point to an image or a video. A video is used for * visual conditioning via its first and last frames (a single frame when only one * is available) and stays a single reference. * * 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. * - `contextual-v2` (and modes aliased to it) accepts up to 15 references; the * other modes accept up to 5. */ images?: Array; /** * Body param: 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`. */ modelId?: string; /** * Body param: The number of results to return. */ numResults?: number; /** * Body param: The initial prompt spark feed to `completion`, `inventive` or * `structured` modes. */ prompt?: string; /** * Body param: 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.. */ seed?: number; /** * Body param: 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. */ temperature?: number; /** * Body param: 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. */ topP?: number; } export interface GenerateRunModelParams { /** * Body param: The request body for the custom generation must be retrieve from GET * /models/{modelId} inputs fields */ body: unknown; /** * Query param */ dryRun?: unknown; /** * Query param: Set to "true" to run an IP-detection preflight on this request. * Combine with ?dryRun=true for an advisory check that returns findings without * generating. */ ipDetection?: boolean; /** * Query param: The projectId used for ownership resource management. Either to * assert ownership or to set the owner of the resource(s) */ projectId?: string; } export interface GenerateTranslateParams { /** * Body param: The prompt to translate. */ prompt: string; /** * Query param */ dryRun?: unknown; /** * Query param */ projectId?: unknown; /** * Body param: Whether we try to ensure IP removal for new prompt generation. */ ensureIPCleared?: boolean; /** * Body param: 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?: Array; /** * Body param: 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.. */ seed?: number; /** * Body param: 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. */ temperature?: number; /** * Body param: 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. */ topP?: number; } export declare namespace Generate { export { type GenerateCaptionResponse as GenerateCaptionResponse, type GenerateDescribeStyleResponse as GenerateDescribeStyleResponse, type GenerateDetectResponse as GenerateDetectResponse, type GenerateEmbedResponse as GenerateEmbedResponse, type GeneratePatchResponse as GeneratePatchResponse, type GeneratePromptResponse as GeneratePromptResponse, type GenerateRunModelResponse as GenerateRunModelResponse, type GenerateTranslateResponse as GenerateTranslateResponse, type GenerateCaptionParams as GenerateCaptionParams, type GenerateDescribeStyleParams as GenerateDescribeStyleParams, type GenerateDetectParams as GenerateDetectParams, type GenerateEmbedParams as GenerateEmbedParams, type GeneratePatchParams as GeneratePatchParams, type GeneratePromptParams as GeneratePromptParams, type GenerateRunModelParams as GenerateRunModelParams, type GenerateTranslateParams as GenerateTranslateParams, }; } //# sourceMappingURL=generate.d.ts.map