{
  "openapi": "3.1.1",
  "info": {
    "title": "Workflows API",
    "description": "Chain translation, review and dubbing steps into one automated run.",
    "version": "1.0.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "{{API_BASE_URL}}",
      "description": "Your API environment"
    }
  ],
  "tags": [
    {
      "name": "Workflows"
    },
    {
      "name": "Step types"
    },
    {
      "name": "Runs"
    },
    {
      "name": "Approvals"
    }
  ],
  "paths": {
    "/v1/cosmos/executions": {
      "get": {
        "operationId": "list-runs",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Page number, from 1.",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number",
              "examples": [
                1
              ]
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Runs per page.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "type": "number",
              "examples": [
                20
              ]
            }
          },
          {
            "name": "projectId",
            "required": false,
            "in": "query",
            "description": "Only runs in this project (a project ID), or `none` for runs in no project.",
            "schema": {
              "type": "string",
              "examples": [
                "6d5c4b3a-2e1f-4a0b-9c8d-7e6f5a4b3c2d"
              ]
            }
          },
          {
            "name": "flowId",
            "required": false,
            "in": "query",
            "description": "Only runs of this workflow (its `id`).",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e"
              ]
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "`live` = `running`, `awaiting_action`, `completed`, `failed` = `failed` or `timed_out`, `cancelled` = stopped by a person, `all` = no filter.",
            "schema": {
              "default": "all",
              "type": "string",
              "enum": [
                "all",
                "live",
                "awaiting_action",
                "completed",
                "failed",
                "cancelled"
              ],
              "examples": [
                "failed"
              ]
            }
          },
          {
            "name": "q",
            "required": false,
            "in": "query",
            "description": "Text to find in the run name or the workflow name, ignoring case.",
            "schema": {
              "maxLength": 200,
              "type": "string",
              "examples": [
                "launch"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListExecutionsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: a field failed validation, or a parameter is malformed (for example, an ID that is not a UUID).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "List runs",
        "tags": [
          "Runs"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:read`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Your organization's runs, newest first, one page at a time. Filter by workflow (`flowId`), project (`projectId`), status group (`status`) or text in the run or workflow name (`q`). `counts` says how many runs each status filter would return with the other filters applied. Each row has a quick `progress`; Get a run has the full detail.",
        "x-orbitdocs-order": 2,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/executions/{id}": {
      "get": {
        "operationId": "get-a-run",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Run ID (`executionId`), from Start a run or List runs.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: a field failed validation, or a parameter is malformed (for example, an ID that is not a UUID).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No run with this `id` in your organization, or the run is in a project you can’t see (`Execution <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Get a run",
        "tags": [
          "Runs"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:read`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Poll a run. `status` is the run's; `nodes` has every step's own `status`, its `output` once it has succeeded, and a link to the work it created (`navigation`). When `status` is `PAUSED`, an Approval gate is waiting: approve or reject it. A dub step whose `status` is `awaiting_action` while the run is `RUNNING` waits for its speakers' voices: approve them with Approve speaker voices in the Video Dubbing API, using the job ID in its `navigation.processId`. Poll every 10 to 30 seconds; runs with dubbing take minutes.",
        "x-orbitdocs-order": 3,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/executions/{id}/images.zip": {
      "get": {
        "operationId": "download-a-run-s-images",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Run ID (`executionId`), from Start a run or List runs.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The zip file.",
            "content": {
              "application/zip": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "`This run has produced no images yet.`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No run with this `id` in your organization, or the run is in a project you can’t see (`Execution <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "More than 100 images, or more than 300 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 413,
                      "message": "Payload Too Large"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Download a run’s images",
        "tags": [
          "Runs"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:read`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Every image the run’s finished steps produced, in one zip — numbered in step order and named after the step that made it. Up to 100 images and 300 MB.",
        "x-orbitdocs-order": 7,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/executions/{id}/images/save-to-drive": {
      "post": {
        "operationId": "save-a-run-s-images-to-drive",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Run ID (`executionId`), from Start a run or List runs.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveRunImagesDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many images were saved: `{ saved }`."
          },
          "400": {
            "description": "`This run has produced no images yet.`, or a folder that cannot be saved into.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No run with this `id` in your organization, or the run is in a project you can’t see (`Execution <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Save a run’s images to Drive",
        "tags": [
          "Runs"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:read`. An API key acts with the role of the member who created it. Also `asset:create`.",
            "position": "after-description"
          }
        ],
        "description": "File every image the run’s finished steps produced in the Drive — into `folderId` when given, else a `Workflows/<run name>` folder. The stored images are registered as they are; nothing is uploaded again.",
        "x-orbitdocs-order": 8,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/executions/{id}/nodes/{nodeId}/approve": {
      "post": {
        "operationId": "approve-a-step",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Run ID (`executionId`), from Start a run or List runs.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
              ]
            }
          },
          {
            "name": "nodeId",
            "required": true,
            "in": "path",
            "description": "The Approval gate's node `id`.",
            "schema": {
              "type": "string",
              "examples": [
                "review"
              ]
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The gate was approved and the run continues.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionStatusResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`This step is not awaiting approval.`: `nodeId` is not an Approval gate of this run, or it is not waiting (already decided, or not reached yet). Or `This run has no workflow to resume.`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No run with this `id` in your organization, or the run is in a project you can’t see (`Execution <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The run belongs to a project task with a checklist that must be finished before this step can be approved; the message names it and how many items are open.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 409,
                      "message": "Conflict",
                      "error": "Conflict"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Approve a step",
        "tags": [
          "Approvals"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:execute`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Approve an Approval gate that is waiting (`PAUSED` on the run, `awaiting_action` on the gate's step in Get a run). The run continues with the next step and goes back to `RUNNING`. No body.",
        "x-orbitdocs-order": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/executions/{id}/nodes/{nodeId}/reject": {
      "post": {
        "operationId": "reject-a-step",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Run ID (`executionId`), from Start a run or List runs.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
              ]
            }
          },
          {
            "name": "nodeId",
            "required": true,
            "in": "path",
            "description": "The Approval gate's node `id`.",
            "schema": {
              "type": "string",
              "examples": [
                "review"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectGateBodyDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The gate was rejected; `status` is `TERMINATED`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionStatusResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`This step is not awaiting approval.`: `nodeId` is not an Approval gate of this run, or it is not waiting (already decided, or not reached yet). Or `This run has already finished.`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No run with this `id` in your organization, or the run is in a project you can’t see (`Execution <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "The run could not be stopped right now, and nothing changed. Reject it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 503,
                      "message": "Error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Reject a step",
        "tags": [
          "Approvals"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:execute`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Reject an Approval gate that is waiting. The run stops as `TERMINATED`, with your `reason` as its `error`. Like a cancel, credits already charged are kept and later steps are never run or charged.",
        "x-orbitdocs-order": 2,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/executions/{id}/nodes/{nodeId}/step-owners": {
      "post": {
        "description": "Replace the members responsible for one step of a run. Owners get a notification in the Universe app when their step finishes, and when an Approval gate they own is waiting for them. Only product steps and Approval gates take owners. Send an empty `memberIds` to remove them all. Returns the owners of every step of the run.",
        "operationId": "set-step-owners",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Run ID (`executionId`), from Start a run or List runs.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
              ]
            }
          },
          {
            "name": "nodeId",
            "required": true,
            "in": "path",
            "description": "The step's node `id` in the flow (the `nodeId` in the run's `nodes`).",
            "schema": {
              "type": "string",
              "examples": [
                "review"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetStepOwnersDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The owners were replaced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StepOwnersResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "A field failed validation, or: `Step \"<nodeId>\" is not part of this flow.`, `\"<step>\" is not a step that can be given an owner.` (only product steps and Approval gates take owners), or `Some members do not belong to this organization`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No run with this `id` in your organization, or the run is in a project you can’t see (`Execution <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Set step owners",
        "tags": [
          "Runs"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:execute`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "x-orbitdocs-order": 8,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/executions/{id}/project": {
      "patch": {
        "description": "File a run in one of your projects, or pass `projectId: null` to unassign it. Only files the run saves from now on follow the new project; nothing already saved moves. Allowed at any time.",
        "operationId": "move-a-run-to-a-project",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Run ID (`executionId`), from Start a run or List runs.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveExecutionProjectBodyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The run is in the project now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MoveExecutionProjectResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`id` is not a UUID (`Validation failed (uuid is expected)`), or `projectId` is neither a UUID nor null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No run with this `id` in your organization, or the run is in a project you can’t see (`Execution <id> not found`). Or `projectId` is not a project in your organization (`Project not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Move a run to a project",
        "tags": [
          "Runs"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:execute`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "x-orbitdocs-order": 7,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/executions/{id}/rename": {
      "post": {
        "description": "Give a run a new name, at any time, finished runs included. The name is only a label: it changes nothing about how the run works. Leading and trailing spaces are removed and the name is cut to 200 characters.",
        "operationId": "rename-a-run",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Run ID (`executionId`), from Start a run or List runs.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameExecutionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The run was renamed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenameExecutionResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "`name` is missing or empty, or only spaces (`A run name cannot be empty.`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No run with this `id` in your organization, or the run is in a project you can’t see (`Execution <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Rename a run",
        "tags": [
          "Runs"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:execute`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "x-orbitdocs-order": 6,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/executions/{id}/retry": {
      "post": {
        "operationId": "retry-a-run",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Run ID (`executionId`), from Start a run or List runs.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
              ]
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The run is running again; `status` is `RUNNING`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionStatusResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Nothing changed: `Only a finished run can be retried.` (it is still `RUNNING` or `PAUSED`), `This run has no workflow to retry.` (it has no workflow, yet some of its steps ran), or `This run uses the \"<step>\" step, which has been retired. Start a new run from the workflow instead.`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Your balance does not cover 1 credit for every charging step that runs again, or your organization owes credits. Nothing changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. Besides a missing `cosmos:execute`: `You don't have permission to run \"<step>\". Ask an admin for access.` (the API key's role lacks the permission a step needs, listed in its `requires`), or `Your organization does not have access to \"<step>\".` (the product is not in your plan). Nothing was started or charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No run with this `id` in your organization, or the run is in a project you can’t see (`Execution <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "`This run is already being retried.`: a run that never started is being started again by another request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 409,
                      "message": "Conflict",
                      "error": "Conflict"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "A run that never started still could not be started (`The run could not be started. Retry it, or start a new run.`). It stays `FAILED`; retry it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 503,
                      "message": "Error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Retry a run",
        "tags": [
          "Runs"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:execute`. An API key acts with the role of the member who created it.\n\n**Credits:** Steps that already succeeded are not run or charged again. Each step that runs again is charged again at its rate: usually when it starts again, and in a few cases (such as a step inside a Parallel branch) once, when it finishes. Your balance must cover at least 1 credit for every charging step that will run again, or the API returns 402 and nothing changes.\n\n| Rate | What it covers | Price |\n| --- | --- | --- |\n| Video Dubbing | Dubbing a video, with or without instant voice cloning. Per minute of source video; a multi-speaker run is charged a third more, since each speaker is separately transcribed, voice-matched and synthesized. | 300 credits per minute |\n| Video → Subtitle | Subtitling a video. Charged per minute of source video. | 100 credits per minute |\n| Subtitle → Transcript Translation | Translating an uploaded subtitle file. Charged per minute of subtitle timeline (the file carries its own timings — there is no source video). | 60 credits per minute |\n| Transcript Autofix | Correcting the pipeline's own transcript output — free by design. | 0 credits per minute |\n| Video Export | Exporting the finished video — free. An export that applies lip-sync is charged as Lip-Sync on Export instead. | 0 credits per minute |\n| Image QC | Quality-control check of an image. | 150 credits per image |\n| Audio QC | Quality-control check of audio. Charged per minute. | 150 credits per minute |\n| Video QC | Quality-control check of video. Charged per minute. | 300 credits per minute |\n| Word translation | Translating a Word (.docx) file in the playground. Charged per source word. | 0.5 credits per word |\n| PowerPoint translation | Translating a PowerPoint (.pptx) file in the playground. Charged per source word. | 0.5 credits per word |\n| Excel translation | Translating an Excel (.xlsx) file in the playground. Charged per source word. | 0.5 credits per word |\n| PDF translation | Translating a PDF in the playground, keeping its layout. Charged per source word. | 0.5 credits per word |\n| InDesign translation | Translating an InDesign (.idml) file in the playground, keeping its layout and styles. Charged per source word. | 0.5 credits per word |\n| DITA translation | Translating a DITA topic or map in the playground, keeping its structure and markup. Charged per source word. | 0.5 credits per word |\n| JSON translation | Translating a JSON file in the playground. Charged per source word. | 0.5 credits per word |\n| XML translation | Translating an XML file in the playground. Charged per source word. | 0.5 credits per word |\n| HTML translation | Translating an HTML file in the playground. Charged per source word. | 0.5 credits per word |\n| XLIFF translation | Translating an XLIFF file in the playground. Charged per source word. | 0.5 credits per word |\n| Text translation | Translating plain text in the playground. Charged per source word. | 0.5 credits per word |\n| Text to speech | Synthesizing speech in the video playground. Charged per second of generated audio. | 120 credits per minute |\n| Instant voice clone | Creating one cloned voice from a sample in the video playground. Charged per cloned voice. | 500 credits |\n| Lip sync (sync-3) | Rendering a lip-synced video on sync-3 in the video playground. Charged per second of rendered output. | 2000 credits per minute |\n| Lip sync (lipsync-2-pro) | Rendering a lip-synced video on lipsync-2-pro in the video playground. Charged per second of rendered output. | 1200 credits per minute |\n| Lip sync (lipsync-2) | Rendering a lip-synced video on lipsync-2 in the video playground. Charged per second of rendered output. | 750 credits per minute |\n| Lip sync (latentsync) | Rendering a lip-synced video on latentsync in the video playground. Charged per second of rendered output. | 300 credits per minute |\n| Workflow LLM step (text) | A model call in a Cosmos workflow that produces text — including every step that delivers a document, since the document is written around the text. Charged per 1,000 prompt/completion tokens, by model. | Claude Opus 5: 24 credits per 1K tokens; Claude Sonnet 5: 16 credits per 1K tokens; Claude Haiku 4.5: 4 credits per 1K tokens; GPT-5.6 Sol: 16 credits per 1K tokens; GPT-5.6 Terra: 8 credits per 1K tokens; GPT-5.6 Luna: 2 credits per 1K tokens; Gemini 3.1 Pro: 16 credits per 1K tokens; Gemini 3.8 Flash: 4 credits per 1K tokens |\n| Workflow LLM step (image) | A model call in a Cosmos workflow that generates an image. Charged per image, the same for every model. | 300 credits per image |\n| Workflow LLM step (video) | A model call in a Cosmos workflow that generates video. Charged per second of output, the same for every model. | 200 credits per second |",
            "position": "after-description"
          }
        ],
        "description": "Start a finished run again from where it stopped. Steps that succeeded keep their output and are not run again; the step that failed, and everything after it, runs again with the same inputs. Meant for `failed` runs; a run that could not be started at all starts from its first step. The run goes back to `running` and keeps its `executionId`. If a step of the run has since been retired, start a new run instead.",
        "x-orbitdocs-order": 4,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/flows": {
      "get": {
        "operationId": "list-workflows",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Ready-made workflows first, then yours.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FlowResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "List workflows",
        "tags": [
          "Workflows"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:read`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "List your organization's workflows, newest change first, after the ready-made workflows every organization can run (`isSystem: true`). Each one comes with its `inputSchema`: what a run asks for. Not paged.",
        "x-orbitdocs-order": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "operationId": "create-a-workflow",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveFlowDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The workflow was saved, and published if it has a real step.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "The graph breaks a save rule; `message` names the first problem, worded as Validate a workflow would. For example:\n\n- `Unknown node type \"<key>\".`\n- `A flow needs a Start node.` / `A flow needs an End node.` / `Connect the last step to the End node.`\n- `\"<step>\" needs its \"<field>\" set.` or `\"<step>\" needs its \"<input>\" wired from an upstream node.`\n- `Every node must be connected — remove or connect any floating nodes.`\n- `A Parallel gate needs a Merge where its branches rejoin.` or `A Switch gate needs at least one case.`\n\nBranching problems (a Parallel without its Merge, a step on more than one branch, a loop) are found when the flow is compiled, after the rules above pass. In that case the graph has already been stored as you sent it: a new workflow is kept as a `draft` (find it with List workflows), and an updated one keeps running the last version that compiled. Fix the graph and save again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. Besides a missing `cosmos` permission: `You don't have permission to run \"<step>\". Ask an admin for access.` (the API key's role lacks the permission a step you added needs, listed in its `requires`), `Your organization does not have access to \"<step>\".` (the product is not in your plan), or a Drive file set in `config` that the role may not read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Create a workflow",
        "tags": [
          "Workflows"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:create`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Save a new workflow: a `graph` of steps from List step types, with exactly one `logic.start` and one `logic.end`, joined by `control` edges in run order, plus `binding` edges (mirrored in `inputBindings`) where a step reads an earlier output. Check a graph first with Validate a workflow. A graph with at least one real step is compiled and published straight away, so it can run; one with only Start and End (or nothing) stays a `draft`. Creating a workflow is free; its runs are charged.",
        "x-orbitdocs-order": 3,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/flows/{id}": {
      "get": {
        "operationId": "get-a-workflow",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Workflow ID (`id`), from Create a workflow or List workflows.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The workflow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: a field failed validation, or a parameter is malformed (for example, an ID that is not a UUID).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No workflow with this `id` in your organization, or it was deleted (`Flow <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Get a workflow",
        "tags": [
          "Workflows"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:read`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Get one workflow: its graph, its `status` (`draft` or `published`; only a published workflow can run) and its `inputSchema`, the values to pass in `input` when you start a run. Ready-made workflows can be read too.",
        "x-orbitdocs-order": 2,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "put": {
        "operationId": "update-a-workflow",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Workflow ID (`id`), from Create a workflow or List workflows.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveFlowDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved workflow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "The graph breaks a save rule; `message` names the first problem, worded as Validate a workflow would. For example:\n\n- `Unknown node type \"<key>\".`\n- `A flow needs a Start node.` / `A flow needs an End node.` / `Connect the last step to the End node.`\n- `\"<step>\" needs its \"<field>\" set.` or `\"<step>\" needs its \"<input>\" wired from an upstream node.`\n- `Every node must be connected — remove or connect any floating nodes.`\n- `A Parallel gate needs a Merge where its branches rejoin.` or `A Switch gate needs at least one case.`\n\nBranching problems (a Parallel without its Merge, a step on more than one branch, a loop) are found when the flow is compiled, after the rules above pass. In that case the graph has already been stored as you sent it: a new workflow is kept as a `draft` (find it with List workflows), and an updated one keeps running the last version that compiled. Fix the graph and save again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "`System flows are read-only.`: this is a ready-made workflow. Not allowed. Besides a missing `cosmos` permission: `You don't have permission to run \"<step>\". Ask an admin for access.` (the API key's role lacks the permission a step you added needs, listed in its `requires`), `Your organization does not have access to \"<step>\".` (the product is not in your plan), or a Drive file set in `config` that the role may not read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No workflow with this `id` in your organization, or it was deleted (`Flow <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Update a workflow",
        "tags": [
          "Workflows"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:update`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Change a workflow. Send only what changes: a `graph` you send replaces the whole graph, and `name` or `description` left out stay as they are. Every save of a workflow with a real step compiles it again and raises `conductorWorkflowVersion`; runs already started keep the version they started with. Step permissions are checked only for steps this save adds or changes, so you can keep a colleague's steps you could not add yourself. Ready-made workflows cannot be changed.",
        "x-orbitdocs-order": 5,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/flows/{id}/org-copy": {
      "post": {
        "operationId": "get-your-copy-of-a-ready-made-workflow",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Workflow ID (`id`), from Create a workflow or List workflows.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e"
              ]
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The organization’s copy of the workflow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "The graph breaks a save rule; `message` names the first problem, worded as Validate a workflow would. For example:\n\n- `Unknown node type \"<key>\".`\n- `A flow needs a Start node.` / `A flow needs an End node.` / `Connect the last step to the End node.`\n- `\"<step>\" needs its \"<field>\" set.` or `\"<step>\" needs its \"<input>\" wired from an upstream node.`\n- `Every node must be connected — remove or connect any floating nodes.`\n- `A Parallel gate needs a Merge where its branches rejoin.` or `A Switch gate needs at least one case.`\n\nBranching problems (a Parallel without its Merge, a step on more than one branch, a loop) are found when the flow is compiled, after the rules above pass. In that case the graph has already been stored as you sent it: a new workflow is kept as a `draft` (find it with List workflows), and an updated one keeps running the last version that compiled. Fix the graph and save again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. Besides a missing `cosmos` permission: `You don't have permission to run \"<step>\". Ask an admin for access.` (the API key's role lacks the permission a step you added needs, listed in its `requires`), `Your organization does not have access to \"<step>\".` (the product is not in your plan), or a Drive file set in `config` that the role may not read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No workflow with this `id` in your organization, or it was deleted (`Flow <id> not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Get your copy of a ready-made workflow",
        "tags": [
          "Workflows"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:create`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Ready-made workflows are templates: they are never compiled, so they cannot run themselves. This returns the organization’s own copy of one, making it the first time (saved, compiled and published, owned by the caller) and reusing it after that, so repeated calls never pile up copies. Start a run on the returned workflow. For an organization workflow it returns the workflow itself. Free; runs are charged.",
        "x-orbitdocs-order": 7,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/flows/{id}/run": {
      "post": {
        "operationId": "start-a-run",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "ID of the workflow to run.",
            "schema": {
              "format": "uuid",
              "type": "string",
              "examples": [
                "3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartExecutionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The run was created and started; `status` is `RUNNING`. Its steps are charged as each one starts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionStatusResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Nothing was started. A field failed validation, or: `This flow has no runnable steps yet — add nodes and save first.` (the workflow is a `draft`), or a `stepOwners` problem: `Step \"<nodeId>\" is not part of this flow.`, `\"<step>\" is not a step that can be given an owner.` (only product steps and Approval gates take owners), or `Some members do not belong to this organization`. After a `stepOwners` problem the run is listed as `running` but never starts and charges nothing: cancel it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Your balance does not cover 1 credit for every step that charges, or your organization owes credits. Nothing was started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed. Besides a missing `cosmos:execute`: `You don't have permission to run \"<step>\". Ask an admin for access.` (the API key's role lacks the permission a step needs, listed in its `requires`), or `Your organization does not have access to \"<step>\".` (the product is not in your plan). Nothing was started or charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No workflow with this `id` in your organization, or it was deleted (`Flow <id> not found`). Or `projectId` is not a project in your organization (`Project not found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 404,
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Conductor would not start the run (`The run could not be started. Retry it, or start a new run.`). It is recorded as `FAILED` with that reason, and nothing was charged: Retry a run starts it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 503,
                      "message": "Error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Start a run",
        "tags": [
          "Runs"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:execute`. An API key acts with the role of the member who created it.\n\n**Credits:** Each step that does product work is charged when that step starts, at the rate of the product doing it (measured on its real input: minutes of video, words of a document, tokens of a prompt). Gates (Start, End, Delay, Approval, Switch, Parallel, Merge) are free. To start, your balance must cover at least 1 credit for every charging step; otherwise the API returns 402 and nothing starts. If the run fails on our side, the steps that did not finish are refunded and the finished ones stay charged. If you cancel the run or reject an Approval, every charge made so far is kept and the steps that never started are never charged.\n\n| Rate | What it covers | Price |\n| --- | --- | --- |\n| Video Dubbing | Dubbing a video, with or without instant voice cloning. Per minute of source video; a multi-speaker run is charged a third more, since each speaker is separately transcribed, voice-matched and synthesized. | 300 credits per minute |\n| Video → Subtitle | Subtitling a video. Charged per minute of source video. | 100 credits per minute |\n| Subtitle → Transcript Translation | Translating an uploaded subtitle file. Charged per minute of subtitle timeline (the file carries its own timings — there is no source video). | 60 credits per minute |\n| Transcript Autofix | Correcting the pipeline's own transcript output — free by design. | 0 credits per minute |\n| Video Export | Exporting the finished video — free. An export that applies lip-sync is charged as Lip-Sync on Export instead. | 0 credits per minute |\n| Image QC | Quality-control check of an image. | 150 credits per image |\n| Audio QC | Quality-control check of audio. Charged per minute. | 150 credits per minute |\n| Video QC | Quality-control check of video. Charged per minute. | 300 credits per minute |\n| Word translation | Translating a Word (.docx) file in the playground. Charged per source word. | 0.5 credits per word |\n| PowerPoint translation | Translating a PowerPoint (.pptx) file in the playground. Charged per source word. | 0.5 credits per word |\n| Excel translation | Translating an Excel (.xlsx) file in the playground. Charged per source word. | 0.5 credits per word |\n| PDF translation | Translating a PDF in the playground, keeping its layout. Charged per source word. | 0.5 credits per word |\n| InDesign translation | Translating an InDesign (.idml) file in the playground, keeping its layout and styles. Charged per source word. | 0.5 credits per word |\n| DITA translation | Translating a DITA topic or map in the playground, keeping its structure and markup. Charged per source word. | 0.5 credits per word |\n| JSON translation | Translating a JSON file in the playground. Charged per source word. | 0.5 credits per word |\n| XML translation | Translating an XML file in the playground. Charged per source word. | 0.5 credits per word |\n| HTML translation | Translating an HTML file in the playground. Charged per source word. | 0.5 credits per word |\n| XLIFF translation | Translating an XLIFF file in the playground. Charged per source word. | 0.5 credits per word |\n| Text translation | Translating plain text in the playground. Charged per source word. | 0.5 credits per word |\n| Text to speech | Synthesizing speech in the video playground. Charged per second of generated audio. | 120 credits per minute |\n| Instant voice clone | Creating one cloned voice from a sample in the video playground. Charged per cloned voice. | 500 credits |\n| Lip sync (sync-3) | Rendering a lip-synced video on sync-3 in the video playground. Charged per second of rendered output. | 2000 credits per minute |\n| Lip sync (lipsync-2-pro) | Rendering a lip-synced video on lipsync-2-pro in the video playground. Charged per second of rendered output. | 1200 credits per minute |\n| Lip sync (lipsync-2) | Rendering a lip-synced video on lipsync-2 in the video playground. Charged per second of rendered output. | 750 credits per minute |\n| Lip sync (latentsync) | Rendering a lip-synced video on latentsync in the video playground. Charged per second of rendered output. | 300 credits per minute |\n| Workflow LLM step (text) | A model call in a Cosmos workflow that produces text — including every step that delivers a document, since the document is written around the text. Charged per 1,000 prompt/completion tokens, by model. | Claude Opus 5: 24 credits per 1K tokens; Claude Sonnet 5: 16 credits per 1K tokens; Claude Haiku 4.5: 4 credits per 1K tokens; GPT-5.6 Sol: 16 credits per 1K tokens; GPT-5.6 Terra: 8 credits per 1K tokens; GPT-5.6 Luna: 2 credits per 1K tokens; Gemini 3.1 Pro: 16 credits per 1K tokens; Gemini 3.8 Flash: 4 credits per 1K tokens |\n| Workflow LLM step (image) | A model call in a Cosmos workflow that generates an image. Charged per image, the same for every model. | 300 credits per image |\n| Workflow LLM step (video) | A model call in a Cosmos workflow that generates video. Charged per second of output, the same for every model. | 200 credits per second |",
            "position": "after-description"
          }
        ],
        "description": "Run a published workflow. Pass the values its `inputSchema` asks for in `input`, keyed by each entry's `key`. Optionally name the run, file it in a project (`projectId`), and name the members responsible for its steps (`stepOwners`, keyed by node `id`). The run starts in the background: you get an `executionId` straight away. Poll it with Get a run. The run uses the workflow as it is now; later edits do not change it.",
        "x-orbitdocs-order": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/flows/validate": {
      "post": {
        "operationId": "validate-a-workflow",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateFlowDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The problems found, if any.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateFlowResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: a field failed validation, or a parameter is malformed (for example, an ID that is not a UUID).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 400,
                      "message": [
                        "email must be an email"
                      ],
                      "error": "Bad Request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Validate a workflow",
        "tags": [
          "Workflows"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:read`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Check a graph against the save rules without saving it, and get every problem at once instead of only the first. An empty `problems` list means a save will pass these rules. Branching rules checked only when the flow is compiled (a Parallel without its Merge, a step on more than one branch, a loop) are not covered, nor are step permissions. Returns 201 because it is a POST; nothing is created.",
        "x-orbitdocs-order": 4,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/v1/cosmos/node-types": {
      "get": {
        "operationId": "list-step-types",
        "parameters": [],
        "responses": {
          "200": {
            "description": "The step types and their metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeTypesResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "The `x-api-key` header is missing, or the key is invalid, expired or deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 401,
                      "message": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 403,
                      "message": "Forbidden resource",
                      "error": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 429,
                      "message": "ThrottlerException: Too Many Requests"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "default": {
                    "value": {
                      "statusCode": 500,
                      "message": "Internal server error"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "List step types",
        "tags": [
          "Step types"
        ],
        "x-orbitdocs-content": [
          {
            "markdown": "**Permission:** `cosmos:read`. An API key acts with the role of the member who created it.",
            "position": "after-description"
          }
        ],
        "description": "Everything a workflow can be built from. `nodeTypes` lists each step type with its `key` (a node's `nodeTypeKey`), its `inputSchema` and `outputSchema` (the field keys for `config`, `inputBindings` and edge handles), the permission it needs (`requires`) and whether it charges credits (`flags.charges`). Gates are the `logic.*` types. `portTypes` names what each `dataType` carries, `galaxies` the products, and `aiModels` the models the LLM step can use. The same for every organization.",
        "x-orbitdocs-order": 1,
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your organization API key (starts with `uvk_`). Create one in the Universe app under Settings → API keys."
      }
    },
    "schemas": {
      "AiModelDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Model id. Use it as the LLM step's `config.model`.",
            "examples": [
              "gpt-5.6-luna"
            ]
          },
          "provider": {
            "type": "string",
            "enum": [
              "openai",
              "google",
              "anthropic"
            ],
            "description": "Who provides the model.",
            "examples": [
              "openai"
            ]
          },
          "emits": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video"
            ],
            "description": "What the model produces. It must match the kind of output the step is set to produce.",
            "examples": [
              "text"
            ]
          },
          "label": {
            "type": "string",
            "description": "Display name.",
            "examples": [
              "GPT-5.6 Luna"
            ]
          },
          "hint": {
            "type": "string",
            "description": "Short description.",
            "examples": [
              "Cheapest here · OpenAI"
            ]
          },
          "acceptsNatively": {
            "description": "File kinds the model reads directly, beyond plain text, such as `image`, `pdf`, `audio` or `video`.",
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "image",
                "pdf"
              ]
            ]
          },
          "contextWindowTokens": {
            "type": "number",
            "description": "Largest input the model takes, in tokens.",
            "examples": [
              1050000
            ]
          },
          "rate": {
            "description": "Its price list rate. Your organization may have its own rates.",
            "allOf": [
              {
                "$ref": "#/components/schemas/AiModelRateDto"
              }
            ]
          }
        },
        "required": [
          "id",
          "provider",
          "emits",
          "label",
          "hint",
          "acceptsNatively",
          "rate"
        ]
      },
      "AiModelRateDto": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "tokens",
              "image",
              "video"
            ],
            "description": "How the model is billed: per 1,000 tokens (`input` and `output`), per image (`perImage`) or per second of video (`perSecond`).",
            "examples": [
              "tokens"
            ]
          },
          "input": {
            "type": "number",
            "description": "Credits per 1,000 input tokens (`tokens` only).",
            "examples": [
              1
            ]
          },
          "output": {
            "type": "number",
            "description": "Credits per 1,000 output tokens (`tokens` only).",
            "examples": [
              5
            ]
          },
          "perImage": {
            "type": "number",
            "description": "Credits per image (`image` only).",
            "examples": [
              6
            ]
          },
          "perSecond": {
            "type": "number",
            "description": "Credits per second of video (`video` only).",
            "examples": [
              60
            ]
          }
        },
        "required": [
          "kind"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "description": "Error body returned for every 4xx and 5xx response.",
        "required": [
          "statusCode",
          "message"
        ],
        "properties": {
          "statusCode": {
            "type": "integer",
            "description": "HTTP status code, repeated in the body.",
            "examples": [
              404
            ]
          },
          "message": {
            "description": "What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "examples": [
              "Booking not found"
            ]
          },
          "error": {
            "type": "string",
            "description": "Short name of the status.",
            "examples": [
              "Not Found"
            ]
          }
        }
      },
      "ExecutionListCountsDto": {
        "type": "object",
        "properties": {
          "all": {
            "type": "number",
            "description": "All runs.",
            "examples": [
              42
            ]
          },
          "live": {
            "type": "number",
            "description": "`RUNNING` runs.",
            "examples": [
              2
            ]
          },
          "awaiting_action": {
            "type": "number",
            "description": "`PAUSED` runs (an Approval gate is waiting).",
            "examples": [
              1
            ]
          },
          "completed": {
            "type": "number",
            "description": "`COMPLETED` runs.",
            "examples": [
              35
            ]
          },
          "failed": {
            "type": "number",
            "description": "`FAILED` and `TERMINATED` runs.",
            "examples": [
              4
            ]
          }
        },
        "required": [
          "all",
          "live",
          "awaiting_action",
          "completed",
          "failed"
        ]
      },
      "ExecutionListItemDto": {
        "type": "object",
        "properties": {
          "executionId": {
            "type": "string",
            "format": "uuid",
            "description": "Run ID.",
            "examples": [
              "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
            ]
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "description": "The workflow this is a run of.",
            "examples": [
              "3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e"
            ]
          },
          "name": {
            "type": "string",
            "description": "Name of the run.",
            "examples": [
              "product-launch.mp4"
            ]
          },
          "flowName": {
            "type": "string",
            "description": "Name of the workflow.",
            "examples": [
              "Dub to Hindi, review, export"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "RUNNING",
              "PAUSED",
              "COMPLETED",
              "FAILED",
              "TERMINATED"
            ],
            "description": "`RUNNING`, `PAUSED` (an Approval gate is waiting for Approve or Reject), `COMPLETED`, `FAILED` or `TERMINATED` (cancelled). The last three are final.",
            "examples": [
              "COMPLETED"
            ]
          },
          "progress": {
            "description": "A quick estimate: steps that have started, minus the one running now. Get a run has the exact status of each step.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ExecutionProgressDto"
              }
            ]
          },
          "startedBy": {
            "description": "Who started it. Null if that member has left.",
            "type": [
              "object",
              "null"
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/ExecutionStartedByDto"
              }
            ]
          },
          "projectId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Project the run is in. Null when it is in none.",
            "examples": [
              "6d5c4b3a-2e1f-4a0b-9c8d-7e6f5a4b3c2d"
            ]
          },
          "startedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the run started.",
            "examples": [
              "2026-10-02T14:10:00.000Z"
            ]
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the run reached a final status. Null while it is live.",
            "examples": [
              "2026-10-02T14:42:31.000Z"
            ]
          },
          "lastActivityAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the run last moved on: a step started or needed action, or the run finished, failed, was approved, rejected, retried or cancelled. A rename or a move to another project does not count.",
            "examples": [
              "2026-10-02T14:42:31.000Z"
            ]
          }
        },
        "required": [
          "executionId",
          "flowId",
          "name",
          "flowName",
          "status",
          "progress",
          "startedBy",
          "projectId",
          "startedAt",
          "finishedAt",
          "lastActivityAt"
        ]
      },
      "ExecutionListMetaDto": {
        "type": "object",
        "properties": {
          "page": {
            "type": "number",
            "description": "This page number.",
            "examples": [
              1
            ]
          },
          "limit": {
            "type": "number",
            "description": "Runs per page.",
            "examples": [
              20
            ]
          },
          "total": {
            "type": "number",
            "description": "Runs matching every filter.",
            "examples": [
              42
            ]
          },
          "totalPages": {
            "type": "number",
            "description": "Number of pages.",
            "examples": [
              3
            ]
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether there is a next page.",
            "examples": [
              true
            ]
          }
        },
        "required": [
          "page",
          "limit",
          "total",
          "totalPages",
          "hasMore"
        ]
      },
      "ExecutionNodeControlDto": {
        "type": "object",
        "properties": {
          "kind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "start",
              "end",
              "delay",
              "approval",
              "switch",
              "parallel",
              "merge"
            ],
            "description": "Which gate this is.",
            "examples": [
              "approval"
            ]
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "The gate's `config` from the flow, such as an Approval's `label` and `instructions`.",
            "examples": [
              {
                "label": "Review the Hindi dub",
                "instructions": "Check names and numbers in the editor."
              }
            ]
          }
        },
        "required": [
          "kind",
          "config"
        ]
      },
      "ExecutionNodeDto": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string",
            "description": "The step's node `id`.",
            "examples": [
              "dub"
            ]
          },
          "nodeTypeKey": {
            "type": "string",
            "description": "Step type key.",
            "examples": [
              "tv.instant_clone"
            ]
          },
          "galaxy": {
            "type": "string",
            "description": "Product that runs the step.",
            "examples": [
              "translate-video"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "awaiting_action",
              "succeeded",
              "failed",
              "skipped",
              "cancelled"
            ],
            "description": "`pending` (not reached yet), `running`, `awaiting_action` (waiting for a person: an Approval gate, or a dub waiting for its voices to be approved), `succeeded`, `failed`, `skipped` (on a branch the completed run did not take) or `cancelled`.",
            "examples": [
              "succeeded"
            ]
          },
          "output": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "The step's outputs, keyed by the step type's `outputSchema` keys, once it has succeeded. Null for gates and unfinished steps.",
            "examples": [
              {
                "processId": "9b1f6c2e-3d4a-4e5f-8a7b-1c2d3e4f5a6b"
              }
            ]
          },
          "navigation": {
            "description": "Where the work this step created opens in the Universe app. Null for gates and steps that have not started.",
            "type": [
              "object",
              "null"
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/NodeNavigationDto"
              }
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the step failed. Null unless it failed.",
            "examples": [
              null
            ]
          },
          "inputError": {
            "type": "boolean",
            "description": "True when the step refused its input before anything ran (an unreadable file, an unsupported language). `error` then says why, in words meant for the member; retrying the same input fails the same way."
          },
          "errorForMember": {
            "type": "boolean",
            "description": "True when `error` is the step's own message for the member (what went wrong, what was or was not charged, what to do next). Without it, `error` may be technical and is not shown as is."
          },
          "control": {
            "description": "Present on gates only.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ExecutionNodeControlDto"
              }
            ]
          }
        },
        "required": [
          "nodeId",
          "nodeTypeKey",
          "galaxy",
          "status",
          "output",
          "navigation",
          "error"
        ]
      },
      "ExecutionProgressDto": {
        "type": "object",
        "properties": {
          "completed": {
            "type": "number",
            "description": "Steps finished.",
            "examples": [
              1
            ]
          },
          "total": {
            "type": "number",
            "description": "Steps in the run.",
            "examples": [
              2
            ]
          }
        },
        "required": [
          "completed",
          "total"
        ]
      },
      "ExecutionResponseDto": {
        "type": "object",
        "properties": {
          "executionId": {
            "type": "string",
            "format": "uuid",
            "description": "Run ID.",
            "examples": [
              "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
            ]
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "description": "The workflow this is a run of.",
            "examples": [
              "3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e"
            ]
          },
          "name": {
            "type": "string",
            "description": "Name of the run: the one you gave, or one taken from its inputs (such as the source file name), or else the workflow name.",
            "examples": [
              "product-launch.mp4"
            ]
          },
          "flowName": {
            "type": "string",
            "description": "Name of the workflow.",
            "examples": [
              "Dub to Hindi, review, export"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "RUNNING",
              "PAUSED",
              "COMPLETED",
              "FAILED",
              "TERMINATED"
            ],
            "description": "`RUNNING`, `PAUSED` (an Approval gate is waiting for Approve or Reject), `COMPLETED`, `FAILED` or `TERMINATED` (cancelled). The last three are final.",
            "examples": [
              "PAUSED"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the run failed, or the reason given when an Approval gate was rejected. Null otherwise.",
            "examples": [
              null
            ]
          },
          "graph": {
            "description": "The flow as it was when the run started. Later edits to the workflow do not change a run.",
            "allOf": [
              {
                "$ref": "#/components/schemas/FlowGraphDto"
              }
            ],
            "examples": [
              {
                "nodes": [
                  {
                    "id": "start",
                    "nodeTypeKey": "logic.start",
                    "position": {
                      "x": 0,
                      "y": 0
                    }
                  },
                  {
                    "id": "dub",
                    "nodeTypeKey": "tv.instant_clone",
                    "position": {
                      "x": 240,
                      "y": 0
                    },
                    "config": {
                      "sourceLanguage": "en-US",
                      "targetLanguage": "hi-IN",
                      "speakerCount": "2"
                    }
                  },
                  {
                    "id": "review",
                    "nodeTypeKey": "logic.approval",
                    "position": {
                      "x": 480,
                      "y": 0
                    },
                    "config": {
                      "label": "Review the Hindi dub",
                      "instructions": "Check names and numbers in the editor."
                    }
                  },
                  {
                    "id": "export",
                    "nodeTypeKey": "tv.export",
                    "position": {
                      "x": 720,
                      "y": 0
                    },
                    "config": {
                      "targetLanguage": "hi-IN",
                      "withSubtitles": true
                    },
                    "inputBindings": {
                      "parentProcessId": {
                        "fromNodeId": "dub",
                        "outputKey": "processId"
                      }
                    }
                  },
                  {
                    "id": "end",
                    "nodeTypeKey": "logic.end",
                    "position": {
                      "x": 960,
                      "y": 0
                    }
                  }
                ],
                "edges": [
                  {
                    "id": "e1",
                    "source": "start",
                    "target": "dub",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e2",
                    "source": "dub",
                    "target": "review",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e3",
                    "source": "review",
                    "target": "export",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e4",
                    "source": "export",
                    "target": "end",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e5",
                    "source": "dub",
                    "target": "export",
                    "sourceHandle": "processId",
                    "targetHandle": "parentProcessId",
                    "kind": "binding"
                  }
                ]
              }
            ]
          },
          "input": {
            "type": "object",
            "additionalProperties": true,
            "description": "The `input` the run was started with.",
            "examples": [
              {
                "dub__source": {
                  "uploadIds": [
                    "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9"
                  ]
                },
                "dub__tmId": "8c7b6a5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d"
              }
            ]
          },
          "nodes": {
            "description": "Every step of the run, in run order, with its live status and outputs.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExecutionNodeDto"
            }
          },
          "stepOwners": {
            "description": "Who is responsible for which step. Empty when nobody is.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StepOwnerDto"
            }
          },
          "startedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the run started.",
            "examples": [
              "2026-10-02T14:10:00.000Z"
            ]
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the run reached a final status. Null while it is live.",
            "examples": [
              null
            ]
          },
          "lastActivityAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the run last moved on: a step started or needed action, or the run finished, failed, was approved, rejected, retried or cancelled. A rename or a move to another project does not count.",
            "examples": [
              "2026-10-02T14:31:05.000Z"
            ]
          },
          "live": {
            "type": "boolean",
            "description": "True while the run is `RUNNING` or `PAUSED`; false once it is final.",
            "examples": [
              true
            ]
          }
        },
        "required": [
          "executionId",
          "flowId",
          "name",
          "flowName",
          "status",
          "error",
          "graph",
          "input",
          "nodes",
          "stepOwners",
          "startedAt",
          "finishedAt",
          "lastActivityAt",
          "live"
        ]
      },
      "ExecutionStartedByDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name.",
            "examples": [
              "Priya Sharma"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Link to their profile picture.",
            "examples": [
              null
            ]
          }
        },
        "required": [
          "name",
          "image"
        ]
      },
      "ExecutionStatusResponseDto": {
        "type": "object",
        "properties": {
          "executionId": {
            "type": "string",
            "format": "uuid",
            "description": "Run ID. Poll it with Get a run.",
            "examples": [
              "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "RUNNING",
              "PAUSED",
              "COMPLETED",
              "FAILED",
              "TERMINATED"
            ],
            "description": "The run's status after the call. `RUNNING`, `PAUSED` (an Approval gate is waiting for Approve or Reject), `COMPLETED`, `FAILED` or `TERMINATED` (cancelled). The last three are final.",
            "examples": [
              "RUNNING"
            ]
          }
        },
        "required": [
          "executionId",
          "status"
        ]
      },
      "FlowEdgeConditionDto": {
        "type": "object",
        "properties": {
          "outputKey": {
            "type": "string",
            "description": "Output key of the source node to test.",
            "examples": [
              "verdict"
            ]
          },
          "equals": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ],
            "description": "The value the output must equal.",
            "examples": [
              "APPROVED"
            ]
          }
        },
        "required": [
          "outputKey",
          "equals"
        ]
      },
      "FlowEdgeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Your id for the edge.",
            "examples": [
              "e2"
            ]
          },
          "source": {
            "type": "string",
            "description": "`id` of the node the edge starts from.",
            "examples": [
              "dub"
            ]
          },
          "target": {
            "type": "string",
            "description": "`id` of the node the edge goes to.",
            "examples": [
              "review"
            ]
          },
          "sourceHandle": {
            "type": "string",
            "description": "Where the edge leaves the source. For a `control` edge: `__ctl_out`, or `case:<caseKey>` from a Switch. For a `binding` edge: the source's output key. For a `share` edge: an input key of the source.",
            "examples": [
              "__ctl_out"
            ]
          },
          "targetHandle": {
            "type": "string",
            "description": "Where the edge enters the target. For a `control` edge: `__ctl_in`. For a `binding` or `share` edge: the target's input key.",
            "examples": [
              "__ctl_in"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "binding",
              "share",
              "control"
            ],
            "default": "binding",
            "description": "`control`: run order and branching (Start → step → gate → … → End). `binding`: data from an output to an input (mirror it in the target's `inputBindings`). `share`: two inputs of the same type that take one value, asked for once when the flow runs. Left out, the edge is a `binding`.",
            "examples": [
              "control"
            ]
          },
          "condition": {
            "description": "Reserved. Stored with the flow but not used to route a run: branch with a Switch gate instead.",
            "allOf": [
              {
                "$ref": "#/components/schemas/FlowEdgeConditionDto"
              }
            ]
          }
        },
        "required": [
          "source",
          "target"
        ]
      },
      "FlowGraphDto": {
        "type": "object",
        "properties": {
          "nodes": {
            "description": "Every step, including exactly one `logic.start` and one `logic.end` once the flow has a real step.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowNodeDto"
            }
          },
          "edges": {
            "description": "Every connection between steps.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowEdgeDto"
            }
          }
        },
        "required": [
          "nodes",
          "edges"
        ]
      },
      "FlowInputBindingDto": {
        "type": "object",
        "properties": {
          "fromNodeId": {
            "type": "string",
            "description": "`id` of the upstream node whose output feeds this input.",
            "examples": [
              "dub"
            ]
          },
          "outputKey": {
            "type": "string",
            "description": "Key of the upstream node's output, from its step type's `outputSchema`.",
            "examples": [
              "processId"
            ]
          }
        },
        "required": [
          "fromNodeId",
          "outputKey"
        ]
      },
      "FlowNodeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Your id for the node, unique within the flow. Edges, `inputBindings`, run inputs and run steps refer to it. Letters, digits, `-` and `_` keep run-input keys readable.",
            "examples": [
              "dub"
            ]
          },
          "nodeTypeKey": {
            "type": "string",
            "description": "The step type, a `key` from List step types, such as `tv.instant_clone`, `logic.approval` or `logic.start`.",
            "examples": [
              "tv.instant_clone"
            ]
          },
          "position": {
            "description": "Canvas position, used only to draw the flow in the Universe app.",
            "allOf": [
              {
                "$ref": "#/components/schemas/FlowNodePositionDto"
              }
            ]
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "Values fixed when you save the flow, keyed by field `key` from the step type's `inputSchema` (and `configSchema`, for the LLM step). A field set here is not asked for when the flow runs. Gates keep their settings here too: a Delay's `durationSeconds`, an Approval's `label` and `instructions`, a Switch's `cases` and `defaultCase`.",
            "examples": [
              {
                "sourceLanguage": "en-US",
                "targetLanguage": "hi-IN",
                "speakerCount": "2"
              }
            ]
          },
          "inputBindings": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/FlowInputBindingDto"
            },
            "description": "Inputs read from an earlier step, keyed by input field `key`: `{ \"<inputKey>\": { \"fromNodeId\", \"outputKey\" } }`. This is what the run reads; draw a matching `binding` edge so the canvas shows the wire.",
            "examples": [
              {
                "parentProcessId": {
                  "fromNodeId": "dub",
                  "outputKey": "processId"
                }
              }
            ]
          }
        },
        "required": [
          "id",
          "nodeTypeKey"
        ]
      },
      "FlowNodePositionDto": {
        "type": "object",
        "properties": {
          "x": {
            "type": "number",
            "description": "Horizontal position on the canvas, in pixels.",
            "examples": [
              240
            ]
          },
          "y": {
            "type": "number",
            "description": "Vertical position on the canvas, in pixels.",
            "examples": [
              0
            ]
          }
        },
        "required": [
          "x",
          "y"
        ]
      },
      "FlowResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Workflow ID.",
            "examples": [
              "3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e"
            ]
          },
          "fk_orgId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Your organization. Null for a ready-made workflow (`isSystem: true`).",
            "examples": [
              "7f3e2d1c-0b9a-4c8d-9e7f-6a5b4c3d2e1f"
            ]
          },
          "fk_ownerId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Member who created it. Null for a ready-made workflow.",
            "examples": [
              "2b4d6f8a-1c3e-4a5b-8c7d-9e0f1a2b3c4d"
            ]
          },
          "name": {
            "type": "string",
            "description": "Name.",
            "examples": [
              "Dub to Hindi, review, export"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description, if you set one.",
            "examples": [
              "Dubs a video into Hindi and exports it after a review."
            ]
          },
          "isSystem": {
            "type": "boolean",
            "description": "True for a built-in workflow: every organization sees it and can run it, nobody can change or delete it.",
            "examples": [
              false
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "published"
            ],
            "description": "`published` once the flow has at least one real step and saved cleanly: it can run. `draft` while it has only its Start and End (or nothing).",
            "examples": [
              "published"
            ]
          },
          "graph": {
            "description": "The steps and their connections, as you saved them.",
            "allOf": [
              {
                "$ref": "#/components/schemas/FlowGraphDto"
              }
            ],
            "examples": [
              {
                "nodes": [
                  {
                    "id": "start",
                    "nodeTypeKey": "logic.start",
                    "position": {
                      "x": 0,
                      "y": 0
                    }
                  },
                  {
                    "id": "dub",
                    "nodeTypeKey": "tv.instant_clone",
                    "position": {
                      "x": 240,
                      "y": 0
                    },
                    "config": {
                      "sourceLanguage": "en-US",
                      "targetLanguage": "hi-IN",
                      "speakerCount": "2"
                    }
                  },
                  {
                    "id": "review",
                    "nodeTypeKey": "logic.approval",
                    "position": {
                      "x": 480,
                      "y": 0
                    },
                    "config": {
                      "label": "Review the Hindi dub",
                      "instructions": "Check names and numbers in the editor."
                    }
                  },
                  {
                    "id": "export",
                    "nodeTypeKey": "tv.export",
                    "position": {
                      "x": 720,
                      "y": 0
                    },
                    "config": {
                      "targetLanguage": "hi-IN",
                      "withSubtitles": true
                    },
                    "inputBindings": {
                      "parentProcessId": {
                        "fromNodeId": "dub",
                        "outputKey": "processId"
                      }
                    }
                  },
                  {
                    "id": "end",
                    "nodeTypeKey": "logic.end",
                    "position": {
                      "x": 960,
                      "y": 0
                    }
                  }
                ],
                "edges": [
                  {
                    "id": "e1",
                    "source": "start",
                    "target": "dub",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e2",
                    "source": "dub",
                    "target": "review",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e3",
                    "source": "review",
                    "target": "export",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e4",
                    "source": "export",
                    "target": "end",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e5",
                    "source": "dub",
                    "target": "export",
                    "sourceHandle": "processId",
                    "targetHandle": "parentProcessId",
                    "kind": "binding"
                  }
                ]
              }
            ]
          },
          "inputSchema": {
            "description": "What a run of this flow asks for: every step input that is neither set in `config` nor wired, in the order the steps run. Pass each one in `input` under its `key` when you start a run. Worked out from the current step types each time you read the flow.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunInputFieldDto"
            }
          },
          "conductorWorkflowName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal name of the compiled workflow. Null until the flow is published. Informational.",
            "examples": [
              "cosmos_flow_3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e"
            ]
          },
          "conductorWorkflowVersion": {
            "type": [
              "number",
              "null"
            ],
            "description": "Goes up by one each time a save publishes the flow. A run keeps the version it started with. Null until first published.",
            "examples": [
              3
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created.",
            "examples": [
              "2026-10-01T09:30:00.000Z"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it was last saved.",
            "examples": [
              "2026-10-02T14:05:12.000Z"
            ]
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Always null: deleted workflows are not returned.",
            "examples": [
              null
            ]
          },
          "shareGroups": {
            "description": "Inputs joined by `share` edges, which a run asks for once. Empty when the flow has none.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SharedInputDto"
            }
          },
          "summary": {
            "type": "string",
            "description": "The steps in run order, by label, without Start, End and Merge.",
            "examples": [
              "Dub with Voice Clone → Approval → Export Video"
            ]
          }
        },
        "required": [
          "id",
          "fk_orgId",
          "fk_ownerId",
          "name",
          "description",
          "isSystem",
          "status",
          "graph",
          "inputSchema",
          "conductorWorkflowName",
          "conductorWorkflowVersion",
          "createdAt",
          "updatedAt",
          "deletedAt",
          "shareGroups",
          "summary"
        ]
      },
      "InsufficientCreditsErrorDto": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code.",
            "examples": [
              402
            ]
          },
          "error": {
            "type": "string",
            "description": "Always `InsufficientCredits`.",
            "examples": [
              "InsufficientCredits"
            ]
          },
          "message": {
            "type": "string",
            "description": "What happened, in plain words.",
            "examples": [
              "You don't have enough credits to start this. It needs 120; you have 45."
            ]
          },
          "required": {
            "type": "number",
            "description": "Credits this request needs.",
            "examples": [
              120
            ]
          },
          "available": {
            "type": "number",
            "description": "Credits your organization can spend now.",
            "examples": [
              45
            ]
          },
          "owed": {
            "type": "number",
            "description": "Credits your organization owes from earlier jobs (0 when nothing is owed). While anything is owed, every paid request is refused until it is repaid.",
            "examples": [
              0
            ]
          }
        },
        "required": [
          "statusCode",
          "error",
          "message",
          "required",
          "available",
          "owed"
        ]
      },
      "ListExecutionsResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "One page of runs, newest first.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExecutionListItemDto"
            }
          },
          "meta": {
            "description": "Paging.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ExecutionListMetaDto"
              }
            ]
          },
          "counts": {
            "description": "Runs per `status` filter, with every other filter (`projectId`, `flowId`, `q`) applied.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ExecutionListCountsDto"
              }
            ]
          }
        },
        "required": [
          "data",
          "meta",
          "counts"
        ]
      },
      "MovedProjectDto": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The project the run is in now. Null when it is in none.",
            "examples": [
              "6d5c4b3a-2e1f-4a0b-9c8d-7e6f5a4b3c2d"
            ]
          }
        },
        "required": [
          "projectId"
        ]
      },
      "MoveExecutionProjectBodyDto": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Project in your organization to move the run into, or null to unassign it.",
            "examples": [
              "6d5c4b3a-2e1f-4a0b-9c8d-7e6f5a4b3c2d"
            ]
          }
        },
        "required": [
          "projectId"
        ]
      },
      "MoveExecutionProjectResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "The result.",
            "allOf": [
              {
                "$ref": "#/components/schemas/MovedProjectDto"
              }
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "NodeFieldDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Field key within the step: the key to use in `config`, `inputBindings` and edge handles.",
            "examples": [
              "targetLanguage"
            ]
          },
          "label": {
            "type": "string",
            "description": "Display name.",
            "examples": [
              "Target language"
            ]
          },
          "type": {
            "type": "string",
            "description": "What kind of value it is: `text`, `textarea`, `number`, `select`, `boolean`, `file`, `language` (a language code), `tm` (a translation memory id), `region` (a Quality Control region id), `upstreamRef` (a value wired from an earlier step, or for a file, uploaded at run time), or a type of the step's own, such as `voice`.",
            "examples": [
              "language"
            ]
          },
          "dataType": {
            "type": "string",
            "description": "Port type. A `binding` edge may join an output to an input only when their `dataType`s match (`any` matches everything). See `portTypes` for the list.",
            "examples": [
              "language"
            ]
          },
          "required": {
            "type": "boolean",
            "description": "Whether the step needs a value: set in `config`, wired, or given when the flow runs.",
            "examples": [
              true
            ]
          },
          "multiple": {
            "type": "boolean",
            "description": "Takes a list of values instead of one.",
            "examples": [
              true
            ]
          },
          "description": {
            "type": "string",
            "description": "Help text.",
            "examples": [
              "The language to translate and dub into."
            ]
          },
          "options": {
            "description": "The allowed values of a `select` field.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NodeFieldOptionDto"
            }
          },
          "optionsSource": {
            "type": "string",
            "description": "Where the Universe app loads the allowed values from, for example `cosmos_ai_models` (the `aiModels` list in this response).",
            "examples": [
              "cosmos_ai_models"
            ]
          },
          "default": {
            "type": "object",
            "description": "Value used when you set none.",
            "examples": [
              "auto-detect"
            ]
          },
          "refOutputKey": {
            "type": "string",
            "description": "For an `upstreamRef` input: the output key of an earlier step it usually reads. Informational; the wire is what counts.",
            "examples": [
              "deliverable"
            ]
          },
          "modalities": {
            "description": "What the port carries more precisely than `dataType`, such as `docx`, `pptx`, `image` or `text`. Two ports connect only when these overlap. Absent: unrestricted. Empty: the port carries nothing in this configuration.",
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "docx"
              ]
            ]
          },
          "dataTypeFrom": {
            "type": "string",
            "description": "The `config` key whose value sets this port's `dataType` (the LLM step's ports change with its input and output kinds).",
            "examples": [
              "inputModality"
            ]
          },
          "modalitiesFrom": {
            "type": "string",
            "description": "The `config` key whose value sets this port's `modalities`.",
            "examples": [
              "inputModality"
            ]
          },
          "modalitiesMap": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "For `modalitiesFrom`: `config` value → the modalities the port then carries. Values not listed carry themselves.",
            "examples": [
              {
                "image": []
              }
            ]
          }
        },
        "required": [
          "key",
          "label",
          "type",
          "dataType"
        ]
      },
      "NodeFieldOptionDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "What the Universe app shows.",
            "examples": [
              "2"
            ]
          },
          "value": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ],
            "description": "The value to send.",
            "examples": [
              "2"
            ]
          }
        },
        "required": [
          "label",
          "value"
        ]
      },
      "NodeFlagsDto": {
        "type": "object",
        "properties": {
          "charges": {
            "type": "boolean",
            "description": "The step charges credits when it starts, at the rate of the product that does the work.",
            "examples": [
              true
            ]
          },
          "humanGate": {
            "type": "boolean",
            "description": "The step can stop and wait for a person, which puts the run in `awaiting_action`.",
            "examples": [
              false
            ]
          },
          "requiresUpstream": {
            "type": "boolean",
            "description": "The step must be wired from an earlier step.",
            "examples": [
              false
            ]
          }
        }
      },
      "NodeNavigationDto": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "description": "What the link opens: `tv_editor` (a Video Dubbing job), `qc_decision` (a Quality Control result), `pg_document` (a document translation), and so on.",
            "examples": [
              "tv_editor"
            ]
          },
          "deepLink": {
            "type": "string",
            "description": "Path in the Universe web app, relative to your organization, once the step has created its job.",
            "examples": [
              "galaxy/translate-video/editor/9b1f6c2e-3d4a-4e5f-8a7b-1c2d3e4f5a6b"
            ]
          },
          "processId": {
            "type": "string",
            "format": "uuid",
            "description": "The job the link opens, where the step sets it.",
            "examples": [
              "9b1f6c2e-3d4a-4e5f-8a7b-1c2d3e4f5a6b"
            ]
          },
          "decisionId": {
            "type": "string",
            "format": "uuid",
            "description": "The Quality Control result the link opens, where set.",
            "examples": [
              "4a8e2b71-0c3d-4f5e-9a6b-7c8d9e0f1a2b"
            ]
          }
        },
        "required": [
          "kind"
        ]
      },
      "NodeRequirementDto": {
        "type": "object",
        "properties": {
          "resource": {
            "type": "string",
            "description": "Permission resource; also the product your organization's plan must include.",
            "examples": [
              "translate_video.process_log"
            ]
          },
          "action": {
            "type": "string",
            "description": "Permission action.",
            "examples": [
              "create"
            ]
          }
        },
        "required": [
          "resource",
          "action"
        ]
      },
      "NodeTypeDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Step type key. Use it as a node's `nodeTypeKey`.",
            "examples": [
              "tv.instant_clone"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "galaxy",
              "control"
            ],
            "description": "`control` for a logic gate (`logic.*`). Absent for a step that runs a product.",
            "examples": [
              "control"
            ]
          },
          "controlKind": {
            "type": "string",
            "enum": [
              "start",
              "end",
              "delay",
              "approval",
              "switch",
              "parallel",
              "merge"
            ],
            "description": "Which gate this is. Set only when `kind` is `control`.",
            "examples": [
              "approval"
            ]
          },
          "system": {
            "type": "boolean",
            "description": "True for `logic.start` and `logic.end`: every flow has exactly one of each, and the Universe app adds them for you.",
            "examples": [
              true
            ]
          },
          "galaxy": {
            "type": "string",
            "description": "Product that runs the step: `translate-video`, `playground`, `quality-control`, `ai` or `logic`.",
            "examples": [
              "translate-video"
            ]
          },
          "label": {
            "type": "string",
            "description": "Display name.",
            "examples": [
              "Dub with Voice Clone"
            ]
          },
          "description": {
            "type": "string",
            "description": "What the step does.",
            "examples": [
              "Dub a video into another language, re-voicing each speaker in their own cloned voice."
            ]
          },
          "icon": {
            "type": "string",
            "description": "Icon name used by the Universe app.",
            "examples": [
              "mic"
            ]
          },
          "category": {
            "type": "string",
            "description": "Palette section.",
            "examples": [
              "translate-video"
            ]
          },
          "inputSchema": {
            "description": "Inputs. Each one is set in `config`, wired from an earlier step, or asked for when the flow runs.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NodeFieldDto"
            }
          },
          "outputSchema": {
            "description": "Outputs that later steps can read through a `binding`.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NodeFieldDto"
            }
          },
          "outputsFrom": {
            "type": "object",
            "description": "Structured output: each name listed in the placed node’s `config[configKey]` is one more output of this `type` / `dataType` (the LLM step’s `outputFields`).",
            "examples": [
              {
                "configKey": "outputFields",
                "type": "text",
                "dataType": "text"
              }
            ]
          },
          "configSchema": {
            "description": "Settings fixed in `config` when you save the flow and never asked for at run time (the LLM step only).",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NodeFieldDto"
            }
          },
          "navigation": {
            "description": "How the Universe app links to the work the step created. Null for gates.",
            "type": [
              "object",
              "null"
            ],
            "allOf": [
              {
                "$ref": "#/components/schemas/NodeNavigationDto"
              }
            ]
          },
          "flags": {
            "description": "Behaviour flags.",
            "allOf": [
              {
                "$ref": "#/components/schemas/NodeFlagsDto"
              }
            ]
          },
          "requires": {
            "description": "Permission the step needs, checked when you save a flow that adds the step, when a run starts or is retried, and again just before the step runs.",
            "allOf": [
              {
                "$ref": "#/components/schemas/NodeRequirementDto"
              }
            ]
          },
          "requiresAll": {
            "description": "Additional permissions that must all hold for this step.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NodeRequirementDto"
            }
          },
          "subWorkflowName": {
            "type": "string",
            "description": "Internal name of the product workflow the step runs. Informational.",
            "examples": [
              "translate_video_dubbing"
            ]
          },
          "subWorkflowVersion": {
            "type": "number",
            "description": "Version of that workflow. Informational.",
            "examples": [
              1
            ]
          },
          "subWorkflowInputKeys": {
            "description": "Inputs of that workflow. Informational.",
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "processId",
                "orgId"
              ]
            ]
          }
        },
        "required": [
          "key",
          "galaxy",
          "label",
          "description",
          "inputSchema",
          "outputSchema",
          "navigation",
          "flags"
        ]
      },
      "NodeTypesResponseDto": {
        "type": "object",
        "properties": {
          "nodeTypes": {
            "description": "Every step type you can place in a flow, gates and the Start and End markers included.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NodeTypeDto"
            }
          },
          "portTypes": {
            "description": "Every port type a field's `dataType` can name.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortTypeDto"
            }
          },
          "galaxies": {
            "description": "The products that contribute step types.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StepGalaxyDto"
            }
          },
          "aiModels": {
            "description": "The models the LLM step (`ai.llm`) can use.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AiModelDto"
            }
          }
        },
        "required": [
          "nodeTypes",
          "portTypes",
          "galaxies",
          "aiModels"
        ]
      },
      "PortTypeDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Matches a field's `dataType`.",
            "examples": [
              "tv_process_id"
            ]
          },
          "label": {
            "type": "string",
            "description": "Display name.",
            "examples": [
              "Video run"
            ]
          },
          "color": {
            "type": "string",
            "description": "Colour the Universe app draws it in.",
            "examples": [
              "#2563EB"
            ]
          }
        },
        "required": [
          "key",
          "label",
          "color"
        ]
      },
      "RejectGateBodyDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Why you rejected it. Saved as the run's `error`. Left out: `Rejected at approval gate`.",
            "examples": [
              "The speaker names are mistranslated."
            ]
          }
        }
      },
      "RenameExecutionDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The run’s new name.",
            "maxLength": 200,
            "examples": [
              "Diwali campaign — hero cut"
            ]
          }
        },
        "required": [
          "name"
        ]
      },
      "RenameExecutionResponseDto": {
        "type": "object",
        "properties": {
          "executionId": {
            "type": "string",
            "format": "uuid",
            "description": "Run ID.",
            "examples": [
              "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
            ]
          },
          "name": {
            "type": "string",
            "description": "The new name, trimmed and cut to 200 characters.",
            "examples": [
              "Diwali campaign — hero cut"
            ]
          }
        },
        "required": [
          "executionId",
          "name"
        ]
      },
      "RunInputFieldDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Key to use in `input` when you start a run: `<nodeId>__<fieldKey>` (non-alphanumeric characters of the node id become `_`), or `share__<…>` for inputs joined by a `share` edge.",
            "examples": [
              "dub__tmId"
            ]
          },
          "label": {
            "type": "string",
            "description": "Display name.",
            "examples": [
              "Target language"
            ]
          },
          "type": {
            "type": "string",
            "description": "What kind of value it is: `text`, `textarea`, `number`, `select`, `boolean`, `file`, `language` (a language code), `tm` (a translation memory id), `region` (a Quality Control region id), `upstreamRef` (a value wired from an earlier step, or for a file, uploaded at run time), or a type of the step's own, such as `voice`.",
            "examples": [
              "language"
            ]
          },
          "dataType": {
            "type": "string",
            "description": "Port type. A `binding` edge may join an output to an input only when their `dataType`s match (`any` matches everything). See `portTypes` for the list.",
            "examples": [
              "language"
            ]
          },
          "required": {
            "type": "boolean",
            "description": "Whether the step needs a value: set in `config`, wired, or given when the flow runs.",
            "examples": [
              true
            ]
          },
          "multiple": {
            "type": "boolean",
            "description": "Takes a list of values instead of one.",
            "examples": [
              true
            ]
          },
          "description": {
            "type": "string",
            "description": "Help text.",
            "examples": [
              "The language to translate and dub into."
            ]
          },
          "options": {
            "description": "The allowed values of a `select` field.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NodeFieldOptionDto"
            }
          },
          "optionsSource": {
            "type": "string",
            "description": "Where the Universe app loads the allowed values from, for example `cosmos_ai_models` (the `aiModels` list in this response).",
            "examples": [
              "cosmos_ai_models"
            ]
          },
          "default": {
            "type": "object",
            "description": "Value used when you set none.",
            "examples": [
              "auto-detect"
            ]
          },
          "refOutputKey": {
            "type": "string",
            "description": "For an `upstreamRef` input: the output key of an earlier step it usually reads. Informational; the wire is what counts.",
            "examples": [
              "deliverable"
            ]
          },
          "modalities": {
            "description": "What the port carries more precisely than `dataType`, such as `docx`, `pptx`, `image` or `text`. Two ports connect only when these overlap. Absent: unrestricted. Empty: the port carries nothing in this configuration.",
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "docx"
              ]
            ]
          },
          "dataTypeFrom": {
            "type": "string",
            "description": "The `config` key whose value sets this port's `dataType` (the LLM step's ports change with its input and output kinds).",
            "examples": [
              "inputModality"
            ]
          },
          "modalitiesFrom": {
            "type": "string",
            "description": "The `config` key whose value sets this port's `modalities`.",
            "examples": [
              "inputModality"
            ]
          },
          "modalitiesMap": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "For `modalitiesFrom`: `config` value → the modalities the port then carries. Values not listed carry themselves.",
            "examples": [
              {
                "image": []
              }
            ]
          },
          "fieldKey": {
            "type": "string",
            "description": "The field's own key within its step.",
            "examples": [
              "tmId"
            ]
          },
          "nodeId": {
            "type": "string",
            "description": "`id` of the node that asks for it.",
            "examples": [
              "dub"
            ]
          },
          "group": {
            "type": "string",
            "description": "Label of that step, for grouping the inputs.",
            "examples": [
              "Dub with Voice Clone"
            ]
          }
        },
        "required": [
          "key",
          "label",
          "type",
          "dataType",
          "fieldKey",
          "nodeId",
          "group"
        ]
      },
      "SaveFlowDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the workflow. Left out or blank: `Untitled flow` on create, unchanged on update.",
            "maxLength": 200,
            "examples": [
              "Dub to Hindi, review, export"
            ]
          },
          "description": {
            "type": "string",
            "description": "What the workflow is for. Left out: unchanged on update.",
            "maxLength": 2000,
            "examples": [
              "Dubs a video into Hindi and exports it after a review."
            ]
          },
          "graph": {
            "description": "The steps and the edges between them. Left out: an empty flow on create, unchanged on update. When sent, it replaces the whole graph.",
            "allOf": [
              {
                "$ref": "#/components/schemas/FlowGraphDto"
              }
            ],
            "examples": [
              {
                "nodes": [
                  {
                    "id": "start",
                    "nodeTypeKey": "logic.start",
                    "position": {
                      "x": 0,
                      "y": 0
                    }
                  },
                  {
                    "id": "dub",
                    "nodeTypeKey": "tv.instant_clone",
                    "position": {
                      "x": 240,
                      "y": 0
                    },
                    "config": {
                      "sourceLanguage": "en-US",
                      "targetLanguage": "hi-IN",
                      "speakerCount": "2"
                    }
                  },
                  {
                    "id": "review",
                    "nodeTypeKey": "logic.approval",
                    "position": {
                      "x": 480,
                      "y": 0
                    },
                    "config": {
                      "label": "Review the Hindi dub",
                      "instructions": "Check names and numbers in the editor."
                    }
                  },
                  {
                    "id": "export",
                    "nodeTypeKey": "tv.export",
                    "position": {
                      "x": 720,
                      "y": 0
                    },
                    "config": {
                      "targetLanguage": "hi-IN",
                      "withSubtitles": true
                    },
                    "inputBindings": {
                      "parentProcessId": {
                        "fromNodeId": "dub",
                        "outputKey": "processId"
                      }
                    }
                  },
                  {
                    "id": "end",
                    "nodeTypeKey": "logic.end",
                    "position": {
                      "x": 960,
                      "y": 0
                    }
                  }
                ],
                "edges": [
                  {
                    "id": "e1",
                    "source": "start",
                    "target": "dub",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e2",
                    "source": "dub",
                    "target": "review",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e3",
                    "source": "review",
                    "target": "export",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e4",
                    "source": "export",
                    "target": "end",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e5",
                    "source": "dub",
                    "target": "export",
                    "sourceHandle": "processId",
                    "targetHandle": "parentProcessId",
                    "kind": "binding"
                  }
                ]
              }
            ]
          }
        }
      },
      "SaveRunImagesDto": {
        "type": "object",
        "properties": {
          "folderId": {
            "type": "string",
            "format": "uuid",
            "description": "The Drive folder to save into. Leave it out for a `Workflows/<run name>` folder."
          }
        }
      },
      "SetStepOwnersDto": {
        "type": "object",
        "properties": {
          "memberIds": {
            "description": "Member IDs in your organization responsible for this step. They replace the current owners; an empty list (or none) removes them all.",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "examples": [
              [
                "2b4d6f8a-1c3e-4a5b-8c7d-9e0f1a2b3c4d"
              ]
            ]
          }
        }
      },
      "SharedInputDto": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string",
            "description": "`id` of the node.",
            "examples": [
              "translate-fr"
            ]
          },
          "fieldKey": {
            "type": "string",
            "description": "Input field key within that node.",
            "examples": [
              "sourceLanguage"
            ]
          },
          "groupKey": {
            "type": "string",
            "description": "The `input` key the whole group is given under when the flow runs.",
            "examples": [
              "share__translate_de__sourceLanguage"
            ]
          },
          "canonical": {
            "type": "boolean",
            "description": "True for the one member that appears in `inputSchema`; the others read its value.",
            "examples": [
              true
            ]
          }
        },
        "required": [
          "nodeId",
          "fieldKey",
          "groupKey",
          "canonical"
        ]
      },
      "StartExecutionDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "What to call this RUN. Optional — left out, one is derived from the inputs the run was started with (the source file, then the first identifying text), falling back to the flow name. On the run, not the flow: the flow name is the same for every run of it.",
            "maxLength": 200,
            "examples": [
              "Product launch — Hindi"
            ]
          },
          "input": {
            "type": "object",
            "additionalProperties": true,
            "description": "The values the flow asks for, keyed by the `key` of each entry in the workflow's `inputSchema` (`<nodeId>__<fieldKey>`). A file input takes a reference to a file: for Dub with Voice Clone, `{ \"uploadIds\": [\"<upload id>\"] }` from the Video Dubbing uploads. Language inputs take a language code such as `hi-IN`. Left out: `{}`. A required input left empty fails its step when the step starts.",
            "examples": [
              {
                "dub__source": {
                  "uploadIds": [
                    "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9"
                  ]
                },
                "dub__tmId": "8c7b6a5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d"
              }
            ]
          },
          "projectId": {
            "type": "string",
            "description": "Project to file this RUN under. Optional — omit for none. See List projects. Set on the run, not the flow: a flow is a reusable definition, a run belongs to one engagement.",
            "format": "uuid",
            "examples": [
              "6d5c4b3a-2e1f-4a0b-9c8d-7e6f5a4b3c2d"
            ]
          },
          "stepOwners": {
            "type": "object",
            "description": "Who is responsible for each step of THIS run, as `{ nodeId: memberId[] }`. Owners are notified when their step completes, and at an approval gate they are the people expected to act. Per-run, never part of the flow: the same flow run twice is staffed twice. Only galaxy steps and approval gates accept an owner — other logic gates are rejected.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            },
            "examples": [
              {
                "review": [
                  "2b4d6f8a-1c3e-4a5b-8c7d-9e0f1a2b3c4d"
                ]
              }
            ]
          },
          "stepSettings": {
            "type": "object",
            "description": "This run's own values for settings the workflow's builder fixed, as `{ nodeId: { fieldKey: value } }`: a step's settings and the inputs set in it (not wired), an approval's `label` and `instructions`, and a switch's `cases` (each case's `operator` and `value` only — the cases and their branches stay). Applied to this run only; the workflow is not changed. Delay, Parallel and Merge gates have nothing to set. `null` clears a value back to the step's default.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            },
            "examples": [
              {
                "n_4f2a9c1d": {
                  "targetLanguage": "de-DE"
                },
                "n_7b3e0a52": {
                  "instructions": "Check the brand terms."
                }
              }
            ]
          }
        }
      },
      "StepGalaxyDto": {
        "type": "object",
        "properties": {
          "galaxy": {
            "type": "string",
            "description": "Matches a step type's `galaxy`.",
            "examples": [
              "translate-video"
            ]
          },
          "label": {
            "type": "string",
            "description": "Display name.",
            "examples": [
              "Video Dubbing"
            ]
          },
          "accent": {
            "type": "string",
            "description": "Accent colour the Universe app uses.",
            "examples": [
              "#6366F1"
            ]
          }
        },
        "required": [
          "galaxy",
          "label",
          "accent"
        ]
      },
      "StepOwnerDto": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string",
            "description": "The step's node `id`.",
            "examples": [
              "review"
            ]
          },
          "memberId": {
            "type": "string",
            "format": "uuid",
            "description": "Member ID in your organization.",
            "examples": [
              "2b4d6f8a-1c3e-4a5b-8c7d-9e0f1a2b3c4d"
            ]
          },
          "userId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The member's user ID.",
            "examples": [
              "Uq3x9KpL2vT8wYz1"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The member's name.",
            "examples": [
              "Priya Sharma"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "The member's email address.",
            "examples": [
              "priya@example.com"
            ]
          }
        },
        "required": [
          "nodeId",
          "memberId",
          "userId",
          "name",
          "email"
        ]
      },
      "StepOwnersResponseDto": {
        "type": "object",
        "properties": {
          "stepOwners": {
            "description": "The owners of every step of the run after the change.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StepOwnerDto"
            }
          }
        },
        "required": [
          "stepOwners"
        ]
      },
      "ValidateFlowDto": {
        "type": "object",
        "properties": {
          "graph": {
            "description": "The graph to check, in the same shape as a save.",
            "allOf": [
              {
                "$ref": "#/components/schemas/FlowGraphDto"
              }
            ],
            "examples": [
              {
                "nodes": [
                  {
                    "id": "start",
                    "nodeTypeKey": "logic.start",
                    "position": {
                      "x": 0,
                      "y": 0
                    }
                  },
                  {
                    "id": "dub",
                    "nodeTypeKey": "tv.instant_clone",
                    "position": {
                      "x": 240,
                      "y": 0
                    },
                    "config": {
                      "sourceLanguage": "en-US",
                      "targetLanguage": "hi-IN",
                      "speakerCount": "2"
                    }
                  },
                  {
                    "id": "review",
                    "nodeTypeKey": "logic.approval",
                    "position": {
                      "x": 480,
                      "y": 0
                    },
                    "config": {
                      "label": "Review the Hindi dub",
                      "instructions": "Check names and numbers in the editor."
                    }
                  },
                  {
                    "id": "export",
                    "nodeTypeKey": "tv.export",
                    "position": {
                      "x": 720,
                      "y": 0
                    },
                    "config": {
                      "targetLanguage": "hi-IN",
                      "withSubtitles": true
                    },
                    "inputBindings": {
                      "parentProcessId": {
                        "fromNodeId": "dub",
                        "outputKey": "processId"
                      }
                    }
                  },
                  {
                    "id": "end",
                    "nodeTypeKey": "logic.end",
                    "position": {
                      "x": 960,
                      "y": 0
                    }
                  }
                ],
                "edges": [
                  {
                    "id": "e1",
                    "source": "start",
                    "target": "dub",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e2",
                    "source": "dub",
                    "target": "review",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e3",
                    "source": "review",
                    "target": "export",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e4",
                    "source": "export",
                    "target": "end",
                    "sourceHandle": "__ctl_out",
                    "targetHandle": "__ctl_in",
                    "kind": "control"
                  },
                  {
                    "id": "e5",
                    "source": "dub",
                    "target": "export",
                    "sourceHandle": "processId",
                    "targetHandle": "parentProcessId",
                    "kind": "binding"
                  }
                ]
              }
            ]
          }
        },
        "required": [
          "graph"
        ]
      },
      "ValidateFlowResponseDto": {
        "type": "object",
        "properties": {
          "problems": {
            "description": "Every problem a save would refuse, each as the message the save would give. Empty when none was found.",
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "Connect the last step to the End node.",
                "\"Export Video\" needs its \"Parent run\" wired from an upstream node."
              ]
            ]
          }
        },
        "required": [
          "problems"
        ]
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}
