> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryflowy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Flowy is a node-based AI creative platform: you generate images, video, audio, 3D and vector on an infinite Canvas, refine on the Studio timeline, and export or publish from the same project.
> Prefer the Flowy MCP server (https://mcp.tryflowy.ai/mcp) or the REST API at https://apis.tryflowy.ai/v1 for programmatic work. Install with `flowy mcp install` from the @flowy/cli package.
> Credits are workspace-scoped. Generations reserve credits on start and only deduct on success, so failed runs refund automatically.

# Start a run

> Start an asynchronous run of a flow, billed to the key's workspace.

The run starts asynchronously and returns a `runId` immediately. Poll [Get a run](/api/get-run) until its `status` is `completed` or `failed`.

The request body's `inputs` array is unchanged from before; an optional `params` object sits alongside it for the flow's exposed **advanced options** (from [Get a flow](/api/get-app)'s `params[]`), keyed by each param's `name`, with a value matching its `kind`. Every param is optional and defaults to the value it was published with, so a caller that only ever sent `inputs` keeps working verbatim.

`inputs` stays lenient: an unrecognized `node_id`, or a missing required content input, never fails the request. It comes back as a `warnings` entry (`unknown_input` / `missing_input`) on the `202` response instead. `params` is strict: an unknown name or an out-of-range/wrong-type value is rejected with `400` (`unknown_param` / `invalid_param`) before the run starts. See [Run a flow](/api/running-apps) for the full walkthrough and [Errors](/api/errors) for the error shapes.


## OpenAPI

````yaml api-reference/openapi.json POST /v1/apps/{appId}/runs
openapi: 3.0.3
info:
  title: Flowy App API
  version: 1.3.1
  description: >-
    Run Flowy apps and direct generations programmatically.


    Authenticate with a workspace API key in the `Authorization: Bearer` header.
    A **secret** key (`flowy_…`) is for servers; a **publishable** key
    (`flowy_pk_…`) is browser-safe and only works from its allowlisted domains.
    Every run or generation bills the API key's own workspace credits
    (caller-pays), so a leaked key can never spend another workspace's balance.


    Keys carry **scopes**: `apps:read` (list/inspect apps), `runs:read` (poll
    runs), `runs:write` (start runs), `generations:read` (poll direct
    generations), `generations:write` (start direct generations), `assets:read`
    (list/read workspace assets), and `credits:read` (read the credit balance).
    A request that needs a scope the key doesn't hold returns `403`.


    A published (public) app is runnable by any key; a private app is runnable
    only by a key of its own workspace.
servers:
  - url: https://apis.tryflowy.ai/genstudio-svc-v2/api
    description: Flowy API
  - url: https://fi.development.flamapis.com/genstudio-svc-v2/api
    description: Development
  - url: http://localhost:8000/genstudio-svc-v2/api
    description: Local
security:
  - ApiKeyAuth: []
tags:
  - name: Apps
    description: Discover apps and inspect their input/output schema.
  - name: Runs
    description: Start runs and poll for their results.
  - name: Generations
    description: Start direct image/video generations and poll for their results.
  - name: Assets
    description: Browse the workspace's asset library (uploads + generated media).
  - name: Credits
    description: Read the workspace's credit balance.
  - name: Spec
    description: The machine-readable OpenAPI document.
paths:
  /v1/apps/{appId}/runs:
    post:
      tags:
        - Runs
      summary: Start a run
      description: >-
        Starts an asynchronous run, billed to the key's workspace. Returns
        immediately with a `runId` — poll `GET /v1/runs/{runId}` for the result.
        Omit the body for an app with no inputs. **Requires the `runs:write`
        scope.**
      operationId: startRun
      parameters:
        - name: appId
          in: path
          required: true
          schema:
            type: string
          example: 507f1f77bcf86cd799439011
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                inputs:
                  type: object
                  additionalProperties:
                    type: string
                  description: >-
                    Map of input nodeId -> value (text, or a URL for media
                    inputs). Get the keys from GET /v1/apps/{appId}.
            example:
              inputs:
                node_1: https://example.com/me.jpg
                node_2: studio lighting, neutral background
      responses:
        '202':
          description: Run accepted. Poll GET /v1/runs/{runId}.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Daily spend cap reached or insufficient workspace credits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Private app not in your workspace, or the key lacks the runs:write
            scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: App not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit or concurrency limit exceeded
          headers:
            Retry-After:
              $ref: '#/components/headers/Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  headers:
    X-RateLimit-Limit:
      description: Maximum requests allowed in the current window (per minute).
      schema:
        type: integer
        example: 60
    X-RateLimit-Remaining:
      description: Requests remaining in the current window.
      schema:
        type: integer
        example: 59
    X-RateLimit-Reset:
      description: Unix epoch second at which the current window resets.
      schema:
        type: integer
        example: 1893456000
    Retry-After:
      description: Seconds to wait before retrying (sent on 429).
      schema:
        type: integer
        example: 12
  schemas:
    RunResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            runId:
              type: string
              example: 64c3f2a1e8b9c0d1f2e3a4b5
            status:
              type: string
              enum:
                - queued
                - running
                - completed
                - failed
              example: queued
    Error:
      type: object
      properties:
        error:
          type: string
          example: this API key lacks the runs:write scope
      required:
        - error
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: flowy_*
      description: >-
        A workspace API key. Secret keys (`flowy_…`) are server-side — keep them
        private. Publishable keys (`flowy_pk_…`) are browser-safe but only work
        from their allowlisted domains.

````