model_run

Generation

Run Model

Run any Scenario model to generate, edit, upscale, segment, post-process, or transform content. Across all assets kind. Call model_schema_get first so you know the exact parameter contract for the selected model. When it marks a prompt field with prompt_spark=true, prompt_spark can rewrite a short or underspecified prompt into an on-model one with tuned parameters — it rewrites rather than lightly edits, so skip it and pass the prompt directly when you or the user already wrote the exact prompt to use. For file-based parameters such as image, images, or referenceImages, pass Scenario asset_ids instead of local file paths. Use search with query="tool" to discover utility models. Args: - model_id: required — model to run - parameters: model payload as a JSON object — virtually every model needs at least a prompt or an image input; call model_schema_get first to discover the exact fields (defaults to {} if omitted, which most models reject); prompt_spark can draft on-model prompts and parameters for prompt_spark=true fields when you want them - wait: optional — true waits for completion, false returns immediately with a job_id - dry_run: optional — true returns the cost estimate without running or charging credits (sends ?dryRun=true) - team_id, project_id: required for OAuth callers Returns: if the job completes in time, returns status, job_id, model_id, and output asset_ids/app_urls. If it is still running, returns status='in_progress' with a job_id and instructions to continue via jobs_wait. With dry_run=true the response carries the cost estimate and no job is created. Examples: - "Generate an image" -> model_schema_get, then model_id="model_xxx", parameters={"prompt": "cinematic portrait"} (optionally prompt_spark first to rewrite a thin prompt) - "Edit using an uploaded reference" -> model_id="model_xxx", parameters={"prompt": "...", "image": "asset_xxx"} - "Kick off a long job and return immediately" -> wait=false - "How much would this cost?" -> dry_run=true Don't use when: You have not inspected the model schema yet, or when you only have a local file path. Prefer model_schema_get first, then upload_asset if asset_id inputs are needed.
open-world

Parameters

NameTypeRequiredDescription
model_idstringModel ID to run (e.g. 'model_google-gemini-3-1-flash'). Call model_schema_get first to discover accepted parameters and whether prompt_spark can help draft the prompt.
parametersrecord[object Object]Model parameters as a JSON object. Use model_schema_get to discover exact fields; a prompt field with prompt_spark=true supports prompt_spark for rewriting a thin prompt into an on-model one — pass a detailed prompt directly when the user wants it used verbatim. Common fields: prompt, image, aspectRatio, numImages, seed.
waitbooleantrueWait up to 180s for completion. Falls back to returning job_id if the model takes longer — call jobs_wait with the returned job_id to keep waiting.
dry_runbooleanEstimate cost without running. Sends ?dryRun=true so the API returns the cost estimate without executing or charging credits.
team_idstringTeam ID. Required if user belongs to multiple teams.
project_idstringProject ID to scope the operation to.
response_formatenum(json | markdown)jsonOutput format: 'json' for structured data, 'markdown' for human-readable text.

Example Request

JSON
{
  "model_id": "model_google-gemini-3-1-flash",
  "parameters": {
    "prompt": "a majestic dragon perched on a mountain at sunset",
    "aspectRatio": "16:9",
    "numImages": 1,
    "seed": 42
  },
  "wait": true,
  "team_id": "team_abc123",
  "project_id": "proj_xyz789"
}

Example Response

JSON
{
  "status": "succeeded",
  "job_id": "job_1a2b3c4d",
  "model_id": "model_google-gemini-3-1-flash",
  "assets": [
    {
      "id": "asset_img001",
      "app_url": "https://app.scenario.com/assets/asset_img001"
    }
  ],
  "message": "Completed. Call asset_display with an asset_id to show the result to the user."
}

Common Use Cases

  • Generate concept art from a text prompt using a community or fine-tuned model
  • Run image-to-image transformations by passing an input image URL in parameters
  • Produce multiple variations by setting numImages > 1 with a fixed seed
  • Trigger long-running video or 3D generation jobs asynchronously with wait: false