> ## 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.

# Create a node generation

> Start a generation as a node on a real project's canvas.

The node id is minted server-side and the generation appears on the project's canvas in real time; the output is also recorded in the workspace asset library. Canvas node *state* lives in the realtime collab layer, so reads go through [List assets](/api/list-assets).


## OpenAPI

````yaml api-reference/openapi.json POST /v1/projects/{projectId}/nodes
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 production API
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/projects/{projectId}/nodes:
    post:
      tags:
        - Projects
      summary: Create a node generation
      description: >-
        Start a generation as a node on a real project's canvas (spends
        credits). The node id is minted server-side; output lands in the asset
        library.
      operationId: createNode
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - prompt
              properties:
                type:
                  type: string
                  enum:
                    - image
                    - video
                    - audio
                    - 3d
                prompt:
                  type: string
                input_media:
                  type: array
                  items:
                    type: object
                    properties:
                      asset_id:
                        type: string
                      url:
                        type: string
                aspect_ratio:
                  type: string
                resolution:
                  type: string
                duration_seconds:
                  type: number
                mode:
                  type: string
                  enum:
                    - sfx
                    - music
      responses:
        '202':
          description: Node generation started
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      projectId:
                        type: string
                      nodeId:
                        type: string
                      type:
                        type: string
                      status:
                        type: string
components:
  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.

````