Guide · clip-art

Generate a clip-art asset

The generate-clip-art-asset workflow produces a reviewable visual artifact with provider metadata, storage keys, step telemetry, and cost ledger entries.

Workflow
generate-clip-art-asset
Artifact class
visual
Provider
OpenAI gpt-image-2
Runtime
~42s
Output
WebP · 1024×1024

How this workflow runs

IntakePrompt + styleSubject, style, aspect ratio.
GenerateImage modelOpenAI gpt-image-2 produces the raw image.
ProcessBackgroundfal/birefnet-light removes the background.
EncodeWebPRaw and processed PNG to WebP.
ArtifactReviewablePersisted with provider metadata and costs.

What you provide

  • Subject prompt (required)
  • Style: cartoon, flat, realistic, watercolor
  • Aspect ratio: 1:1, 4:3, 3:4, 16:9
  • Background removal: true by default

What you get

  • A reviewable visual artifact (WebP, 1024×1024)
  • Raw and processed file URLs
  • Provider, model, and prompt metadata captured per step
  • Per-step cost ledger entries with estimated and reconciled values

Send the request

Submit the run to the API with the workflow templateId and the intake your template requires.

POST /v1/runsjson
{
  "templateId": "generate-clip-art-asset",
  "intake": {
    "intent": {
      "prompt": "a cute chipmunk sleeping in a nest with her family",
      "style": "cartoon",
      "aspectRatio": "1:1"
    },
    "runtime": {
      "backgroundRemovalEnabled": true
    }
  }
}

Runtime steps

Each step persists its own timing, provider, model, and cost ledger entry. Steps execute in order; background removal can be disabled via intake.

  1. prompt.resolve

    Resolve style descriptor and content-type template into the final prompt.

  2. image.generate

    Provider call that produces the raw 1024×1024 image (default: openai/gpt-image-2).

  3. background.remove

    Optional background removal (default: fal/birefnet-light).

  4. image.convert_webp.raw

    Convert raw PNG to WebP.

  5. image.convert_webp.processed

    Convert processed PNG to WebP.

  6. storage.upload_raw

    Upload raw WebP to the artifacts namespace.

  7. storage.upload_processed

    Upload processed WebP to the artifacts namespace.

  8. artifact.create

    Persist the artifact record and link it to the run.

Read the response

The synchronous response returns the run identifier, status, the produced artifactId, total runtime, and an estimated cost roll-up.

201 createdjson
{
  "id": "run-a1b2c3d4",
  "status": "review",
  "artifactId": "artifact-0dc32dbb",
  "durationMs": 42184,
  "totalCosts": {
    "estimatedUsd": 0.0533,
    "actualUsd": null,
    "currency": "USD",
    "status": "estimated"
  }
}

Inspect telemetry

Fetch the full run for per-step timings, provider metadata, and cost ledger entries via GET /v1/runs/{runId}. The same provider cost ledger is available scoped to the artifact via GET /v1/artifacts/{artifactId}.