{
  "openapi": "3.2.1",
  "info": {
    "title": "NDNCI Public API",
    "version": "1.0.0",
    "description": "Run authorized NDNCI operations and manage resources within explicitly selected workspaces. Monetary credits and nonmonetary usage points are accounted separately."
  },
  "servers": [
    {
      "url": "https://api.ndnci.com"
    }
  ],
  "paths": {
    "/v1/workspaces": {
      "get": {
        "operationId": "workspaces.list",
        "summary": "List authorized workspaces",
        "description": "Return the personal and organization workspaces explicitly included in this key and still authorized for its owner.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_WORKSPACES_LIST"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "name": {
                                "type": "string",
                                "maxLength": 200
                              },
                              "organizationId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "role": {
                                "type": "string",
                                "enum": [
                                  "owner",
                                  "admin"
                                ]
                              },
                              "plan": {
                                "type": "string",
                                "maxLength": 64
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "organizationId",
                              "role",
                              "plan"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_WORKSPACES_LIST",
                  "message": "Successful response",
                  "data": {
                    "items": [
                      {
                        "id": "123e4567-e89b-42d3-a456-426614174001",
                        "name": "Personal workspace",
                        "organizationId": null,
                        "role": "owner",
                        "plan": "free"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "workspaces:read",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/tools": {
      "get": {
        "operationId": "tools.list",
        "summary": "Discover available Tool operations",
        "description": "List the server operations authorized for the selected workspace and access grant, including their input contracts and execution mode.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_TOOLS_LIST"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "operations": {
                                "maxItems": 20,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "operationId": {
                                      "type": "string"
                                    },
                                    "summaryKey": {
                                      "type": "string"
                                    },
                                    "inputSchema": {
                                      "type": "object",
                                      "propertyNames": {
                                        "type": "string",
                                        "maxLength": 100
                                      },
                                      "additionalProperties": {
                                        "$ref": "#/components/schemas/tools.list.response.__schema0"
                                      }
                                    },
                                    "usagePoints": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "asynchronous": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "operationId",
                                    "summaryKey",
                                    "inputSchema",
                                    "usagePoints",
                                    "asynchronous"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "slug",
                              "name",
                              "description",
                              "operations"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_TOOLS_LIST",
                  "message": "Successful response",
                  "data": {
                    "items": []
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "tools:read",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/estimates": {
      "post": {
        "operationId": "tools.estimate",
        "summary": "Estimate an operation",
        "description": "Validate the operation input and return its estimated and maximum monetary cost before starting work. The estimate does not reserve credits.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "link.preview",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "link.preview",
                        "enum": [
                          "link.preview"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.link.preview.input"
                      }
                    }
                  },
                  {
                    "title": "image.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "image.generate",
                        "enum": [
                          "image.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.image.generate.input"
                      }
                    }
                  },
                  {
                    "title": "headshot.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "headshot.generate",
                        "enum": [
                          "headshot.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.headshot.generate.input"
                      }
                    }
                  },
                  {
                    "title": "background.remove",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "background.remove",
                        "enum": [
                          "background.remove"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.background.remove.input"
                      }
                    }
                  },
                  {
                    "title": "video.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "video.generate",
                        "enum": [
                          "video.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.video.generate.input"
                      }
                    }
                  },
                  {
                    "title": "video.edit",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "video.edit",
                        "enum": [
                          "video.edit"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.video.edit.input"
                      }
                    }
                  },
                  {
                    "title": "music.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "music.generate",
                        "enum": [
                          "music.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.music.generate.input"
                      }
                    }
                  },
                  {
                    "title": "three-d.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "three-d.generate",
                        "enum": [
                          "three-d.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.three-d.generate.input"
                      }
                    }
                  },
                  {
                    "title": "three-d.rig",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "three-d.rig",
                        "enum": [
                          "three-d.rig"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.three-d.rig.input"
                      }
                    }
                  },
                  {
                    "title": "chat.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "chat.generate",
                        "enum": [
                          "chat.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.chat.generate.input"
                      }
                    }
                  },
                  {
                    "title": "sprite.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "sprite.generate",
                        "enum": [
                          "sprite.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.sprite.generate.input"
                      }
                    }
                  },
                  {
                    "title": "speech.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "speech.generate",
                        "enum": [
                          "speech.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.speech.generate.input"
                      }
                    }
                  },
                  {
                    "title": "voice.clone",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "voice.clone",
                        "enum": [
                          "voice.clone"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.voice.clone.input"
                      }
                    }
                  },
                  {
                    "title": "security.scan",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "security.scan",
                        "enum": [
                          "security.scan"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.security.scan.input"
                      }
                    }
                  }
                ],
                "discriminator": {
                  "propertyName": "operationId"
                }
              },
              "example": {
                "operationId": "link.preview",
                "input": {
                  "url": "https://example.org"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_TOOLS_ESTIMATE"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "operationId": {
                          "type": "string"
                        },
                        "estimatedCostMillicents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "maximumCostMillicents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "usagePoints": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "operationId",
                        "estimatedCostMillicents",
                        "maximumCostMillicents",
                        "usagePoints"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_TOOLS_ESTIMATE",
                  "message": "Successful response",
                  "data": {
                    "operationId": "link.preview",
                    "estimatedCostMillicents": 0,
                    "maximumCostMillicents": 0,
                    "usagePoints": 4
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "tools:run",
        "x-ndnci-usage-points": 4,
        "x-ndnci-max-input-bytes": 65536,
        "x-ndnci-max-input-depth": 16,
        "x-ndnci-max-input-nodes": 4096
      }
    },
    "/v1/runs": {
      "post": {
        "operationId": "tools.run",
        "summary": "Run a Tool operation",
        "description": "Execute a bounded, authorized operation. Immediate operations return a result; queued operations return an accepted job identifier. Send a stable idempotency key for safe retries.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "link.preview",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "link.preview",
                        "enum": [
                          "link.preview"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.link.preview.input"
                      }
                    }
                  },
                  {
                    "title": "image.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "image.generate",
                        "enum": [
                          "image.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.image.generate.input"
                      }
                    }
                  },
                  {
                    "title": "headshot.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "headshot.generate",
                        "enum": [
                          "headshot.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.headshot.generate.input"
                      }
                    }
                  },
                  {
                    "title": "background.remove",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "background.remove",
                        "enum": [
                          "background.remove"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.background.remove.input"
                      }
                    }
                  },
                  {
                    "title": "video.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "video.generate",
                        "enum": [
                          "video.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.video.generate.input"
                      }
                    }
                  },
                  {
                    "title": "video.edit",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "video.edit",
                        "enum": [
                          "video.edit"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.video.edit.input"
                      }
                    }
                  },
                  {
                    "title": "music.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "music.generate",
                        "enum": [
                          "music.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.music.generate.input"
                      }
                    }
                  },
                  {
                    "title": "three-d.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "three-d.generate",
                        "enum": [
                          "three-d.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.three-d.generate.input"
                      }
                    }
                  },
                  {
                    "title": "three-d.rig",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "three-d.rig",
                        "enum": [
                          "three-d.rig"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.three-d.rig.input"
                      }
                    }
                  },
                  {
                    "title": "chat.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "chat.generate",
                        "enum": [
                          "chat.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.chat.generate.input"
                      }
                    }
                  },
                  {
                    "title": "sprite.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "sprite.generate",
                        "enum": [
                          "sprite.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.sprite.generate.input"
                      }
                    }
                  },
                  {
                    "title": "speech.generate",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "speech.generate",
                        "enum": [
                          "speech.generate"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.speech.generate.input"
                      }
                    }
                  },
                  {
                    "title": "voice.clone",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "voice.clone",
                        "enum": [
                          "voice.clone"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.voice.clone.input"
                      }
                    }
                  },
                  {
                    "title": "security.scan",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "operationId",
                      "input"
                    ],
                    "properties": {
                      "operationId": {
                        "type": "string",
                        "const": "security.scan",
                        "enum": [
                          "security.scan"
                        ]
                      },
                      "input": {
                        "$ref": "#/components/schemas/tool.security.scan.input"
                      }
                    }
                  }
                ],
                "discriminator": {
                  "propertyName": "operationId"
                }
              },
              "example": {
                "operationId": "link.preview",
                "input": {
                  "url": "https://example.org"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_TOOLS_RUN"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "job"
                            },
                            "jobId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "status": {
                              "type": "string",
                              "const": "pending"
                            },
                            "maximumCostMillicents": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "jobId",
                            "status",
                            "maximumCostMillicents"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "result"
                            },
                            "result": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 100
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/tools.run.response.__schema0"
                              }
                            },
                            "costMillicents": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "result",
                            "costMillicents"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_TOOLS_RUN",
                  "message": "Successful response",
                  "data": {
                    "kind": "result",
                    "result": {
                      "metadata": {
                        "title": "Example Domain",
                        "description": null,
                        "image": null,
                        "url": "https://example.org",
                        "siteName": null,
                        "favicon": null
                      }
                    },
                    "costMillicents": 0
                  }
                }
              }
            }
          },
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_TOOLS_RUN"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "job"
                            },
                            "jobId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "status": {
                              "type": "string",
                              "const": "pending"
                            },
                            "maximumCostMillicents": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "jobId",
                            "status",
                            "maximumCostMillicents"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "result"
                            },
                            "result": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 100
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/tools.run.response.__schema0"
                              }
                            },
                            "costMillicents": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "result",
                            "costMillicents"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_TOOLS_RUN",
                  "message": "Successful response",
                  "data": {
                    "kind": "job",
                    "jobId": "123e4567-e89b-42d3-a456-426614174002",
                    "status": "pending",
                    "maximumCostMillicents": 1000
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "tools:run",
        "x-ndnci-usage-points": 20,
        "x-ndnci-weighted-operation": true,
        "x-ndnci-max-input-bytes": 65536,
        "x-ndnci-max-input-depth": 16,
        "x-ndnci-max-input-nodes": 4096
      }
    },
    "/v1/jobs": {
      "get": {
        "operationId": "jobs.list",
        "summary": "List workspace jobs",
        "description": "Read a bounded, cursor-paginated page of jobs in the selected workspace, including status, output and execution origin.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_JOBS_LIST"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "workspaceId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "toolSlug": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "processing",
                                  "completed",
                                  "failed",
                                  "cancelled"
                                ]
                              },
                              "executionOrigin": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "web",
                                      "api",
                                      "mcp",
                                      "system"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "progress": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string",
                                  "maxLength": 100
                                },
                                "additionalProperties": {
                                  "$ref": "#/components/schemas/jobs.list.response.__schema0"
                                }
                              },
                              "output": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "propertyNames": {
                                      "type": "string",
                                      "maxLength": 100
                                    },
                                    "additionalProperties": {
                                      "$ref": "#/components/schemas/jobs.list.response.__schema0"
                                    }
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "costMillicents": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "maximumCostMillicents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "errorCode": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^[A-Z][A-Z0-9_]*$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                              },
                              "startedAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "completedAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "workspaceId",
                              "toolSlug",
                              "status",
                              "executionOrigin",
                              "progress",
                              "output",
                              "costMillicents",
                              "maximumCostMillicents",
                              "errorCode",
                              "createdAt",
                              "startedAt",
                              "completedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "items",
                        "nextCursor"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_JOBS_LIST",
                  "message": "Successful response",
                  "data": {
                    "items": [],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "jobs:read",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/jobs/{jobId}": {
      "get": {
        "operationId": "jobs.get",
        "summary": "Read a job",
        "description": "Retrieve one job in the selected workspace. Completed output may include workspace media identifiers and temporary download URLs.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_JOBS_GET"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "workspaceId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "toolSlug": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "processing",
                            "completed",
                            "failed",
                            "cancelled"
                          ]
                        },
                        "executionOrigin": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "web",
                                "api",
                                "mcp",
                                "system"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "progress": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "maxLength": 100
                          },
                          "additionalProperties": {
                            "$ref": "#/components/schemas/jobs.get.response.__schema0"
                          }
                        },
                        "output": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 100
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/jobs.get.response.__schema0"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "costMillicents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "maximumCostMillicents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "errorCode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[A-Z][A-Z0-9_]*$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "startedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "completedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "workspaceId",
                        "toolSlug",
                        "status",
                        "executionOrigin",
                        "progress",
                        "output",
                        "costMillicents",
                        "maximumCostMillicents",
                        "errorCode",
                        "createdAt",
                        "startedAt",
                        "completedAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_JOBS_GET",
                  "message": "Successful response",
                  "data": {
                    "id": "123e4567-e89b-42d3-a456-426614174002",
                    "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                    "toolSlug": "ai-image-generator",
                    "status": "completed",
                    "executionOrigin": "api",
                    "progress": {
                      "percentage": 100
                    },
                    "output": {
                      "metadata": {
                        "title": "Example Domain",
                        "url": "https://example.org"
                      }
                    },
                    "costMillicents": 0,
                    "maximumCostMillicents": 0,
                    "errorCode": null,
                    "createdAt": "2026-10-01T12:00:00Z",
                    "startedAt": "2026-10-01T12:00:01Z",
                    "completedAt": "2026-10-01T12:00:02Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "jobs:read",
        "x-ndnci-usage-points": 1
      }
    },
    "/v1/jobs/{jobId}/cancel": {
      "post": {
        "operationId": "jobs.cancel",
        "summary": "Cancel a job",
        "description": "Request cancellation within the selected workspace. Work already accepted by an external provider may still incur a charge.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_JOBS_CANCEL"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "accepted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "accepted"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_JOBS_CANCEL",
                  "message": "Successful response",
                  "data": {
                    "accepted": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "jobs:write",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/jobs/{jobId}/retry": {
      "post": {
        "operationId": "jobs.retry",
        "summary": "Retry a job",
        "description": "Retry eligible failed work using its existing checkpoints and a new idempotency key. Authorization, available credits and budget ceilings are checked again.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_JOBS_RETRY"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "job"
                            },
                            "jobId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "status": {
                              "type": "string",
                              "const": "pending"
                            },
                            "maximumCostMillicents": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "jobId",
                            "status",
                            "maximumCostMillicents"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "result"
                            },
                            "result": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 100
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/jobs.retry.response.__schema0"
                              }
                            },
                            "costMillicents": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "result",
                            "costMillicents"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_JOBS_RETRY",
                  "message": "Successful response",
                  "data": {
                    "kind": "job",
                    "jobId": "123e4567-e89b-42d3-a456-426614174002",
                    "status": "pending",
                    "maximumCostMillicents": 1000
                  }
                }
              }
            }
          },
          "202": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_JOBS_RETRY"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "job"
                            },
                            "jobId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "status": {
                              "type": "string",
                              "const": "pending"
                            },
                            "maximumCostMillicents": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "jobId",
                            "status",
                            "maximumCostMillicents"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "result"
                            },
                            "result": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 100
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/jobs.retry.response.__schema0"
                              }
                            },
                            "costMillicents": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "result",
                            "costMillicents"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_JOBS_RETRY",
                  "message": "Successful response",
                  "data": {
                    "kind": "job",
                    "jobId": "123e4567-e89b-42d3-a456-426614174002",
                    "status": "pending",
                    "maximumCostMillicents": 1000
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "jobs:write",
        "x-ndnci-usage-points": 20,
        "x-ndnci-weighted-operation": true
      }
    },
    "/v1/queue": {
      "get": {
        "operationId": "queue.get",
        "summary": "Read queue capacity",
        "description": "Return running and waiting job counts alongside the selected workspace's current concurrency and waiting limits.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_QUEUE_GET"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "pending": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "processing": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "maxConcurrentJobs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "maxQueuedJobs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "pending",
                        "processing",
                        "maxConcurrentJobs",
                        "maxQueuedJobs"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_QUEUE_GET",
                  "message": "Successful response",
                  "data": {
                    "pending": 0,
                    "processing": 0,
                    "maxConcurrentJobs": 1,
                    "maxQueuedJobs": 3
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "queue:read",
        "x-ndnci-usage-points": 1
      }
    },
    "/v1/balance": {
      "get": {
        "operationId": "balance.get",
        "summary": "Read credits and allocations",
        "description": "Return total, reserved and spendable credits together with a bounded page of allocations, expiration dates and funding provenance.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_BALANCE_GET"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "workspaceId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "totalMillicents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "reservedMillicents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "spendableMillicents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "allocations": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "remainingMillicents": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "expiresAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "provenance": {
                                "type": "string",
                                "maxLength": 100
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                              }
                            },
                            "required": [
                              "id",
                              "remainingMillicents",
                              "expiresAt",
                              "provenance",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "workspaceId",
                        "totalMillicents",
                        "reservedMillicents",
                        "spendableMillicents",
                        "allocations",
                        "nextCursor"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_BALANCE_GET",
                  "message": "Successful response",
                  "data": {
                    "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                    "totalMillicents": 100000,
                    "reservedMillicents": 1000,
                    "spendableMillicents": 99000,
                    "allocations": [
                      {
                        "id": "123e4567-e89b-42d3-a456-426614174003",
                        "remainingMillicents": 100000,
                        "expiresAt": "2027-10-01T12:00:00Z",
                        "provenance": "purchase",
                        "createdAt": "2026-10-01T12:00:00Z"
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "billing:read",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/transactions": {
      "get": {
        "operationId": "transactions.list",
        "summary": "List credit transactions",
        "description": "Read a cursor-paginated ledger page with signed monetary amounts, related jobs and known execution origins.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_TRANSACTIONS_LIST"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "type": {
                                "type": "string",
                                "maxLength": 50
                              },
                              "amountMillicents": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "toolSlug": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "jobId": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "executionOrigin": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "web",
                                      "api",
                                      "mcp",
                                      "system"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                              }
                            },
                            "required": [
                              "id",
                              "type",
                              "amountMillicents",
                              "toolSlug",
                              "jobId",
                              "executionOrigin",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "items",
                        "nextCursor"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_TRANSACTIONS_LIST",
                  "message": "Successful response",
                  "data": {
                    "items": [
                      {
                        "id": "123e4567-e89b-42d3-a456-426614174004",
                        "type": "usage",
                        "amountMillicents": -1000,
                        "toolSlug": "ai-image-generator",
                        "jobId": "123e4567-e89b-42d3-a456-426614174002",
                        "executionOrigin": "api",
                        "createdAt": "2026-10-01T12:00:02Z"
                      }
                    ],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "billing:read",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/media": {
      "get": {
        "operationId": "media.list",
        "summary": "List workspace media",
        "description": "Return a cursor-paginated page of media metadata from the selected workspace's library.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_MEDIA_LIST"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "workspaceId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "name": {
                                "type": "string",
                                "maxLength": 255
                              },
                              "mimeType": {
                                "type": "string",
                                "maxLength": 100
                              },
                              "sizeBytes": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                              },
                              "downloadUrl": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "workspaceId",
                              "name",
                              "mimeType",
                              "sizeBytes",
                              "createdAt",
                              "downloadUrl"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "items",
                        "nextCursor"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_MEDIA_LIST",
                  "message": "Successful response",
                  "data": {
                    "items": [],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "media:read",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/media/{mediaId}": {
      "get": {
        "operationId": "media.get",
        "summary": "Read media metadata",
        "description": "Retrieve one media item belonging to the selected workspace.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_MEDIA_GET"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "workspaceId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 255
                        },
                        "mimeType": {
                          "type": "string",
                          "maxLength": 100
                        },
                        "sizeBytes": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "downloadUrl": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "workspaceId",
                        "name",
                        "mimeType",
                        "sizeBytes",
                        "createdAt",
                        "downloadUrl"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_MEDIA_GET",
                  "message": "Successful response",
                  "data": {
                    "id": "123e4567-e89b-42d3-a456-426614174005",
                    "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                    "name": "sample.png",
                    "mimeType": "image/png",
                    "sizeBytes": 4096,
                    "createdAt": "2026-10-01T12:00:00Z",
                    "downloadUrl": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "media:read",
        "x-ndnci-usage-points": 1
      }
    },
    "/v1/media/upload": {
      "post": {
        "operationId": "media.upload",
        "summary": "Upload workspace media",
        "description": "Upload a file through the workspace's normal type, size and storage quota checks. This API grants no direct media deletion operation.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "contentMediaType": "application/octet-stream"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_MEDIA_UPLOAD"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "workspaceId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 255
                        },
                        "mimeType": {
                          "type": "string",
                          "maxLength": 100
                        },
                        "sizeBytes": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "downloadUrl": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "workspaceId",
                        "name",
                        "mimeType",
                        "sizeBytes",
                        "createdAt",
                        "downloadUrl"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_MEDIA_UPLOAD",
                  "message": "Successful response",
                  "data": {
                    "id": "123e4567-e89b-42d3-a456-426614174005",
                    "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                    "name": "sample.png",
                    "mimeType": "image/png",
                    "sizeBytes": 4096,
                    "createdAt": "2026-10-01T12:00:00Z",
                    "downloadUrl": null
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "media:write",
        "x-ndnci-usage-points": 10
      }
    },
    "/v1/media/{mediaId}/download": {
      "get": {
        "operationId": "media.download",
        "summary": "Create a download URL",
        "description": "Retrieve a temporary authorized download URL for one workspace media item. Treat the URL as a secret until it expires.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_MEDIA_DOWNLOAD"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        }
                      },
                      "required": [
                        "url",
                        "expiresAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_MEDIA_DOWNLOAD",
                  "message": "Successful response",
                  "data": {
                    "url": "https://media.example.org/signed-download",
                    "expiresAt": "2026-10-01T12:10:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "media:read",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/jobs/{jobId}/stream": {
      "get": {
        "operationId": "jobs.stream",
        "summary": "Follow job updates",
        "description": "Receive bounded server-sent job updates for one authorized workspace job. Available with Pro; reconnect and read the job when an event gap is detected.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "itemSchema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_JOBS_STREAM"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "workspaceId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "toolSlug": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "processing",
                            "completed",
                            "failed",
                            "cancelled"
                          ]
                        },
                        "executionOrigin": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "web",
                                "api",
                                "mcp",
                                "system"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "progress": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "maxLength": 100
                          },
                          "additionalProperties": {
                            "$ref": "#/components/schemas/jobs.stream.response.__schema0"
                          }
                        },
                        "output": {
                          "anyOf": [
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string",
                                "maxLength": 100
                              },
                              "additionalProperties": {
                                "$ref": "#/components/schemas/jobs.stream.response.__schema0"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "costMillicents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "maximumCostMillicents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "errorCode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[A-Z][A-Z0-9_]*$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "startedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "completedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "workspaceId",
                        "toolSlug",
                        "status",
                        "executionOrigin",
                        "progress",
                        "output",
                        "costMillicents",
                        "maximumCostMillicents",
                        "errorCode",
                        "createdAt",
                        "startedAt",
                        "completedAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": "event: job\ndata: {\"success\":true,\"code\":\"PUBLIC_JOBS_STREAM\",\"message\":\"Successful response\",\"data\":{\"id\":\"123e4567-e89b-42d3-a456-426614174002\",\"workspaceId\":\"123e4567-e89b-42d3-a456-426614174001\",\"toolSlug\":\"ai-image-generator\",\"status\":\"completed\",\"executionOrigin\":\"api\",\"progress\":{\"percentage\":100},\"output\":{\"metadata\":{\"title\":\"Example Domain\",\"url\":\"https://example.org\"}},\"costMillicents\":0,\"maximumCostMillicents\":0,\"errorCode\":null,\"createdAt\":\"2026-10-01T12:00:00Z\",\"startedAt\":\"2026-10-01T12:00:01Z\",\"completedAt\":\"2026-10-01T12:00:02Z\"}}\n\n"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "jobs:read",
        "x-ndnci-usage-points": 3
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "usage.get",
        "summary": "Read usage and budget limits",
        "description": "Return weighted usage counters, reset times, financial budget reservations and stream availability for the selected workspace.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_USAGE_GET"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "workspaceId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "plan": {
                          "type": "string",
                          "maxLength": 64
                        },
                        "points": {
                          "type": "object",
                          "properties": {
                            "minuteLimit": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "minuteUsed": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "minuteResetsAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            },
                            "monthlyLimit": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "monthlyUsed": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "monthlyResetsAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            }
                          },
                          "required": [
                            "minuteLimit",
                            "minuteUsed",
                            "minuteResetsAt",
                            "monthlyLimit",
                            "monthlyUsed",
                            "monthlyResetsAt"
                          ],
                          "additionalProperties": false
                        },
                        "budgets": {
                          "maxItems": 6,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "scope": {
                                "type": "string",
                                "enum": [
                                  "key",
                                  "workspace"
                                ]
                              },
                              "period": {
                                "type": "string",
                                "enum": [
                                  "day",
                                  "week",
                                  "month"
                                ]
                              },
                              "limitMillicents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "spentMillicents": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "reservedMillicents": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "resetsAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                              }
                            },
                            "required": [
                              "scope",
                              "period",
                              "limitMillicents",
                              "spentMillicents",
                              "reservedMillicents",
                              "resetsAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "streams": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean"
                            },
                            "maximum": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "enabled",
                            "maximum"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "workspaceId",
                        "plan",
                        "points",
                        "budgets",
                        "streams"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_USAGE_GET",
                  "message": "Successful response",
                  "data": {
                    "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                    "plan": "free",
                    "points": {
                      "minuteLimit": 240,
                      "minuteUsed": 2,
                      "minuteResetsAt": "2026-10-01T12:01:00Z",
                      "monthlyLimit": 10000,
                      "monthlyUsed": 100,
                      "monthlyResetsAt": "2026-11-01T00:00:00Z"
                    },
                    "budgets": [
                      {
                        "scope": "key",
                        "period": "day",
                        "limitMillicents": 100000,
                        "spentMillicents": 1000,
                        "reservedMillicents": 1000,
                        "resetsAt": "2026-10-02T00:00:00Z"
                      }
                    ],
                    "streams": {
                      "enabled": false,
                      "maximum": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "usage:read",
        "x-ndnci-usage-points": 1
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "events.list",
        "summary": "Read workspace events",
        "description": "Read a bounded event page for the selected workspace. Persist the returned cursor only after processing each event successfully; events never grant access outside the approved workspace.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 256
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_EVENTS_LIST"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "job.completed",
                                  "job.failed",
                                  "job.cancelled",
                                  "budget.threshold",
                                  "access.changed"
                                ]
                              },
                              "workspaceId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "occurredAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                              },
                              "data": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string",
                                  "maxLength": 100
                                },
                                "additionalProperties": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 2048
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "type",
                              "workspaceId",
                              "occurredAt",
                              "data"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "items",
                        "nextCursor"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_EVENTS_LIST",
                  "message": "Successful response",
                  "data": {
                    "items": [
                      {
                        "id": "123e4567-e89b-42d3-a456-426614174006",
                        "type": "job.completed",
                        "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                        "occurredAt": "2026-10-01T12:00:02Z",
                        "data": {
                          "jobId": "123e4567-e89b-42d3-a456-426614174002",
                          "executionOrigin": "api"
                        }
                      }
                    ],
                    "nextCursor": "example-opaque-cursor"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "events:read",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "webhooks.list",
        "summary": "List workspace webhooks",
        "description": "List registered webhook destinations in the selected workspace without returning their signing secrets.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_WEBHOOKS_LIST"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "workspaceId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "eventTypes": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "job.completed",
                                    "job.failed",
                                    "job.cancelled",
                                    "budget.threshold",
                                    "access.changed"
                                  ]
                                }
                              },
                              "enabled": {
                                "type": "boolean"
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                              }
                            },
                            "required": [
                              "id",
                              "workspaceId",
                              "url",
                              "eventTypes",
                              "enabled",
                              "createdAt",
                              "updatedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_WEBHOOKS_LIST",
                  "message": "Successful response",
                  "data": {
                    "items": [
                      {
                        "id": "123e4567-e89b-42d3-a456-426614174007",
                        "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                        "url": "https://hooks.example.org/ndnci",
                        "eventTypes": [
                          "job.completed",
                          "job.failed"
                        ],
                        "enabled": true,
                        "createdAt": "2026-10-01T12:00:00Z",
                        "updatedAt": "2026-10-01T12:00:00Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "webhooks:read",
        "x-ndnci-usage-points": 2
      },
      "post": {
        "operationId": "webhooks.create",
        "summary": "Create a signed webhook",
        "description": "Register an HTTPS endpoint on an exact hostname verified in the selected workspace. The signing secret is shown once in this response.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  "eventTypes": {
                    "minItems": 1,
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "job.completed",
                        "job.failed",
                        "job.cancelled",
                        "budget.threshold",
                        "access.changed"
                      ]
                    }
                  },
                  "enabled": {
                    "default": true,
                    "type": "boolean"
                  }
                },
                "required": [
                  "url",
                  "eventTypes",
                  "enabled"
                ],
                "additionalProperties": false
              },
              "example": {
                "url": "https://hooks.example.org/ndnci",
                "eventTypes": [
                  "job.completed",
                  "job.failed"
                ],
                "enabled": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_WEBHOOKS_CREATE"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "webhook": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "workspaceId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "url": {
                              "type": "string",
                              "format": "uri"
                            },
                            "eventTypes": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "job.completed",
                                  "job.failed",
                                  "job.cancelled",
                                  "budget.threshold",
                                  "access.changed"
                                ]
                              }
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "workspaceId",
                            "url",
                            "eventTypes",
                            "enabled",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "secret": {
                          "type": "string",
                          "pattern": "^whsec_[A-Za-z0-9_-]{43}$"
                        }
                      },
                      "required": [
                        "webhook",
                        "secret"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_WEBHOOKS_CREATE",
                  "message": "Successful response",
                  "data": {
                    "webhook": {
                      "id": "123e4567-e89b-42d3-a456-426614174007",
                      "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                      "url": "https://hooks.example.org/ndnci",
                      "eventTypes": [
                        "job.completed",
                        "job.failed"
                      ],
                      "enabled": true,
                      "createdAt": "2026-10-01T12:00:00Z",
                      "updatedAt": "2026-10-01T12:00:00Z"
                    },
                    "secret": "whsec_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "webhooks:write",
        "x-ndnci-usage-points": 5,
        "x-ndnci-max-input-bytes": 65536,
        "x-ndnci-max-input-depth": 16,
        "x-ndnci-max-input-nodes": 4096
      }
    },
    "/v1/webhooks/{webhookId}/update": {
      "post": {
        "operationId": "webhooks.update",
        "summary": "Update a webhook",
        "description": "Replace the webhook destination, subscribed events and enabled state after checking the verified hostname and current workspace authorization again.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  "eventTypes": {
                    "minItems": 1,
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "job.completed",
                        "job.failed",
                        "job.cancelled",
                        "budget.threshold",
                        "access.changed"
                      ]
                    }
                  },
                  "enabled": {
                    "default": true,
                    "type": "boolean"
                  }
                },
                "required": [
                  "url",
                  "eventTypes",
                  "enabled"
                ],
                "additionalProperties": false
              },
              "example": {
                "url": "https://hooks.example.org/ndnci",
                "eventTypes": [
                  "job.completed",
                  "job.failed"
                ],
                "enabled": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_WEBHOOKS_UPDATE"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "workspaceId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "eventTypes": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "job.completed",
                              "job.failed",
                              "job.cancelled",
                              "budget.threshold",
                              "access.changed"
                            ]
                          }
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "workspaceId",
                        "url",
                        "eventTypes",
                        "enabled",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_WEBHOOKS_UPDATE",
                  "message": "Successful response",
                  "data": {
                    "id": "123e4567-e89b-42d3-a456-426614174007",
                    "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                    "url": "https://hooks.example.org/ndnci",
                    "eventTypes": [
                      "job.completed",
                      "job.failed"
                    ],
                    "enabled": true,
                    "createdAt": "2026-10-01T12:00:00Z",
                    "updatedAt": "2026-10-01T12:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "webhooks:write",
        "x-ndnci-usage-points": 5,
        "x-ndnci-max-input-bytes": 65536,
        "x-ndnci-max-input-depth": 16,
        "x-ndnci-max-input-nodes": 4096
      }
    },
    "/v1/webhooks/{webhookId}/revoke": {
      "post": {
        "operationId": "webhooks.revoke",
        "summary": "Revoke a webhook",
        "description": "Disable the webhook and stop its remaining deliveries in the selected workspace.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_WEBHOOKS_REVOKE"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "accepted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "accepted"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_WEBHOOKS_REVOKE",
                  "message": "Successful response",
                  "data": {
                    "accepted": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "webhooks:write",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/webhooks/{webhookId}/rotate": {
      "post": {
        "operationId": "webhooks.rotate",
        "summary": "Rotate a webhook secret",
        "description": "Replace the signing secret for one workspace webhook. Store the returned new secret securely; the previous secret is invalidated.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_WEBHOOKS_ROTATE"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "webhook": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "workspaceId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "url": {
                              "type": "string",
                              "format": "uri"
                            },
                            "eventTypes": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "job.completed",
                                  "job.failed",
                                  "job.cancelled",
                                  "budget.threshold",
                                  "access.changed"
                                ]
                              }
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            },
                            "updatedAt": {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                            }
                          },
                          "required": [
                            "id",
                            "workspaceId",
                            "url",
                            "eventTypes",
                            "enabled",
                            "createdAt",
                            "updatedAt"
                          ],
                          "additionalProperties": false
                        },
                        "secret": {
                          "type": "string",
                          "pattern": "^whsec_[A-Za-z0-9_-]{43}$"
                        }
                      },
                      "required": [
                        "webhook",
                        "secret"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_WEBHOOKS_ROTATE",
                  "message": "Successful response",
                  "data": {
                    "webhook": {
                      "id": "123e4567-e89b-42d3-a456-426614174007",
                      "workspaceId": "123e4567-e89b-42d3-a456-426614174001",
                      "url": "https://hooks.example.org/ndnci",
                      "eventTypes": [
                        "job.completed",
                        "job.failed"
                      ],
                      "enabled": true,
                      "createdAt": "2026-10-01T12:00:00Z",
                      "updatedAt": "2026-10-01T12:00:00Z"
                    },
                    "secret": "whsec_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "webhooks:write",
        "x-ndnci-usage-points": 5
      }
    },
    "/v1/webhooks/{webhookId}/deliveries": {
      "get": {
        "operationId": "webhooks.deliveries",
        "summary": "Read webhook delivery history",
        "description": "Read a bounded delivery history containing status, attempt counts and redacted failure codes without secrets or request payloads.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_WEBHOOKS_DELIVERIES"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 100,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "webhookId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "eventId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "processing",
                                  "delivered",
                                  "failed",
                                  "cancelled"
                                ]
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "replayCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 3
                              },
                              "lastStatusCode": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 100,
                                    "maximum": 599
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "lastErrorCode": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^[A-Z][A-Z0-9_]*$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                              },
                              "deliveredAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "webhookId",
                              "eventId",
                              "status",
                              "attempts",
                              "replayCount",
                              "lastStatusCode",
                              "lastErrorCode",
                              "createdAt",
                              "deliveredAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "items"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_WEBHOOKS_DELIVERIES",
                  "message": "Successful response",
                  "data": {
                    "items": [
                      {
                        "id": "123e4567-e89b-42d3-a456-426614174008",
                        "webhookId": "123e4567-e89b-42d3-a456-426614174007",
                        "eventId": "123e4567-e89b-42d3-a456-426614174006",
                        "status": "failed",
                        "attempts": 12,
                        "replayCount": 0,
                        "lastStatusCode": 503,
                        "lastErrorCode": "WEBHOOK_HTTP_ERROR",
                        "createdAt": "2026-10-01T12:00:00Z",
                        "deliveredAt": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "webhooks:read",
        "x-ndnci-usage-points": 2
      }
    },
    "/v1/webhooks/{webhookId}/deliveries/{deliveryId}/replay": {
      "post": {
        "operationId": "webhooks.replay",
        "summary": "Replay a failed delivery",
        "description": "Request a bounded replay of an eligible failed delivery. The event identifier is preserved for duplicate detection; authorization and destination safety are checked again.",
        "security": [
          {
            "bearerKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Ndnci-Workspace",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Select a workspace explicitly included in this access grant."
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "success",
                    "code",
                    "message",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "code": {
                      "const": "PUBLIC_WEBHOOKS_REPLAY"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "accepted": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "accepted"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "example": {
                  "success": true,
                  "code": "PUBLIC_WEBHOOKS_REPLAY",
                  "message": "Successful response",
                  "data": {
                    "accepted": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-ndnci-scope": "webhooks:write",
        "x-ndnci-usage-points": 10
      }
    }
  },
  "components": {
    "schemas": {
      "tools.list.response.__schema0": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/tools.list.response.__schema0"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/tools.list.response.__schema0"
            }
          }
        ]
      },
      "tools.estimate.request.__schema0": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/tools.estimate.request.__schema0"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/tools.estimate.request.__schema0"
            }
          }
        ]
      },
      "tools.run.response.__schema0": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/tools.run.response.__schema0"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/tools.run.response.__schema0"
            }
          }
        ]
      },
      "tools.run.request.__schema0": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/tools.run.request.__schema0"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/tools.run.request.__schema0"
            }
          }
        ]
      },
      "jobs.list.response.__schema0": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/jobs.list.response.__schema0"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/jobs.list.response.__schema0"
            }
          }
        ]
      },
      "jobs.get.response.__schema0": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/jobs.get.response.__schema0"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/jobs.get.response.__schema0"
            }
          }
        ]
      },
      "jobs.retry.response.__schema0": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/jobs.retry.response.__schema0"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/jobs.retry.response.__schema0"
            }
          }
        ]
      },
      "jobs.stream.response.__schema0": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/jobs.stream.response.__schema0"
            }
          },
          {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "$ref": "#/components/schemas/jobs.stream.response.__schema0"
            }
          }
        ]
      },
      "tool.link.preview.input": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "tool.image.generate.input": {
        "type": "object",
        "properties": {
          "fundingSource": {
            "default": "ndnci_credits",
            "type": "string",
            "const": "ndnci_credits"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          },
          "serviceSlug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[a-z0-9][a-z0-9._/-]*$"
          },
          "additionalServiceSlugs": {
            "default": [],
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[a-z0-9][a-z0-9._/-]*$"
            }
          },
          "resolution": {
            "default": "",
            "type": "string",
            "maxLength": 32
          },
          "imageSize": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "ultra"
            ]
          },
          "aspectRatio": {
            "default": "",
            "type": "string",
            "maxLength": 32
          },
          "quality": {
            "default": "",
            "type": "string",
            "maxLength": 32
          },
          "background": {
            "default": "",
            "type": "string",
            "maxLength": 32
          },
          "outputFormat": {
            "default": "",
            "type": "string",
            "enum": [
              "",
              "png",
              "jpeg",
              "webp"
            ]
          },
          "outputCount": {
            "default": 1,
            "type": "integer",
            "minimum": 1,
            "maximum": 4
          },
          "seed": {
            "default": "",
            "anyOf": [
              {
                "type": "string",
                "const": ""
              },
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 2147483647
              }
            ]
          },
          "referenceMediaIds": {
            "anyOf": [
              {
                "minItems": 0,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "prompt",
          "serviceSlug"
        ],
        "additionalProperties": false
      },
      "tool.headshot.generate.input": {
        "type": "object",
        "properties": {
          "style": {
            "type": "string",
            "enum": [
              "corporate",
              "studio",
              "creative",
              "outdoor"
            ]
          },
          "outputCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4
          },
          "serviceChoiceKey": {
            "default": "standard",
            "type": "string",
            "enum": [
              "standard",
              "premium"
            ]
          },
          "customization": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "simple",
                  "advanced"
                ]
              },
              "assistedReferences": {
                "default": false,
                "type": "boolean"
              },
              "includeEyewear": {
                "type": "boolean"
              },
              "removePersonalStyling": {
                "type": "boolean"
              },
              "outfit": {
                "type": "string",
                "enum": [
                  "shirt",
                  "tshirt",
                  "polo"
                ]
              },
              "outfitColor": {
                "type": "string",
                "pattern": "^#[0-9a-f]{6}$"
              },
              "customPrompt": {
                "type": "string",
                "maxLength": 500
              },
              "logoPlacement": {
                "type": "string",
                "enum": [
                  "left",
                  "center",
                  "right"
                ]
              },
              "expression": {
                "default": "preserve",
                "type": "string",
                "enum": [
                  "preserve",
                  "smile",
                  "smile-teeth",
                  "neutral"
                ]
              },
              "logoSize": {
                "default": "medium",
                "type": "string",
                "enum": [
                  "small",
                  "medium",
                  "large"
                ]
              }
            },
            "required": [
              "mode",
              "includeEyewear",
              "removePersonalStyling",
              "outfit",
              "outfitColor",
              "customPrompt",
              "logoPlacement"
            ],
            "additionalProperties": false
          },
          "regenerateFromPortrait": {
            "default": false,
            "type": "boolean"
          },
          "referenceMediaIds": {
            "anyOf": [
              {
                "minItems": 0,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "backgroundMediaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "logoMediaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "style",
          "outputCount",
          "customization"
        ],
        "additionalProperties": false
      },
      "tool.background.remove.input": {
        "type": "object",
        "properties": {
          "serviceSlug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[a-z0-9][a-z0-9._/-]*$"
          },
          "sourceMediaIds": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        },
        "required": [
          "serviceSlug",
          "sourceMediaIds"
        ],
        "additionalProperties": false
      },
      "tool.video.generate.input": {
        "type": "object",
        "properties": {
          "fundingSource": {
            "default": "ndnci_credits",
            "type": "string",
            "const": "ndnci_credits"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "serviceSlug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[a-z0-9][a-z0-9._/-]*$"
          },
          "additionalServiceSlugs": {
            "default": [],
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[a-z0-9][a-z0-9._/-]*$"
            }
          },
          "aspectRatio": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "resolution": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "durationSeconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 120
          },
          "outputCount": {
            "default": 1,
            "type": "integer",
            "minimum": 1,
            "maximum": 4
          },
          "generateAudio": {
            "default": false,
            "type": "boolean"
          },
          "seed": {
            "default": "",
            "anyOf": [
              {
                "type": "string",
                "const": ""
              },
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 2147483647
              }
            ]
          },
          "videoInputMode": {
            "default": "frames",
            "type": "string",
            "enum": [
              "none",
              "reference",
              "frames"
            ]
          },
          "referenceMediaIds": {
            "anyOf": [
              {
                "minItems": 0,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "sourceVideoMediaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "firstFrameMediaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastFrameMediaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "prompt",
          "serviceSlug",
          "aspectRatio",
          "resolution",
          "durationSeconds"
        ],
        "additionalProperties": false
      },
      "tool.video.edit.input": {
        "type": "object",
        "properties": {
          "fundingSource": {
            "default": "ndnci_credits",
            "type": "string",
            "const": "ndnci_credits"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "serviceSlug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[a-z0-9][a-z0-9._/-]*$"
          },
          "additionalServiceSlugs": {
            "default": [],
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[a-z0-9][a-z0-9._/-]*$"
            }
          },
          "aspectRatio": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "resolution": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "durationSeconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 120
          },
          "outputCount": {
            "default": 1,
            "type": "integer",
            "minimum": 1,
            "maximum": 4
          },
          "generateAudio": {
            "default": false,
            "type": "boolean"
          },
          "seed": {
            "default": "",
            "anyOf": [
              {
                "type": "string",
                "const": ""
              },
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 2147483647
              }
            ]
          },
          "videoInputMode": {
            "default": "frames",
            "type": "string",
            "enum": [
              "none",
              "reference",
              "frames"
            ]
          },
          "referenceMediaIds": {
            "anyOf": [
              {
                "minItems": 0,
                "maxItems": 32,
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "sourceVideoMediaId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "firstFrameMediaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastFrameMediaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "prompt",
          "serviceSlug",
          "aspectRatio",
          "resolution",
          "durationSeconds",
          "sourceVideoMediaId"
        ],
        "additionalProperties": false
      },
      "tool.music.generate.input": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "serviceSlug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[a-z0-9][a-z0-9._/-]*$"
          },
          "durationSeconds": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "options": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string",
              "maxLength": 40
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 80
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "lyrics": {
            "default": "",
            "type": "string",
            "maxLength": 3500
          }
        },
        "required": [
          "prompt",
          "serviceSlug",
          "durationSeconds"
        ],
        "additionalProperties": false
      },
      "tool.three-d.generate.input": {
        "type": "object",
        "properties": {
          "serviceSlug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[a-z0-9][a-z0-9._/-]*$"
          },
          "meshStyle": {
            "default": "auto",
            "type": "string",
            "enum": [
              "auto",
              "low-poly",
              "detailed",
              "custom"
            ]
          },
          "resolution": {
            "type": "string",
            "enum": [
              "512p",
              "1024p",
              "1536p"
            ]
          },
          "textureSize": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "1024",
                  "2048",
                  "4096"
                ]
              },
              {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 1024
                  },
                  {
                    "type": "number",
                    "const": 2048
                  },
                  {
                    "type": "number",
                    "const": 4096
                  }
                ]
              }
            ]
          },
          "decimationTarget": {
            "type": "integer",
            "minimum": 100,
            "maximum": 2000000
          },
          "remesh": {
            "type": "boolean"
          },
          "poseMode": {
            "default": "",
            "type": "string",
            "enum": [
              "",
              "a-pose",
              "t-pose"
            ]
          },
          "enableRigging": {
            "default": false,
            "type": "boolean"
          },
          "riggingHeightMeters": {
            "default": 1.7,
            "type": "number",
            "minimum": 0.5,
            "maximum": 3
          },
          "enableAnimation": {
            "default": false,
            "type": "boolean"
          },
          "animationActionId": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "pattern": "^\\d{1,3}$"
              }
            ]
          },
          "referenceMediaIds": {
            "minItems": 1,
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        },
        "required": [
          "serviceSlug",
          "resolution",
          "textureSize",
          "decimationTarget",
          "remesh",
          "referenceMediaIds"
        ],
        "additionalProperties": false
      },
      "tool.three-d.rig.input": {
        "type": "object",
        "properties": {
          "serviceSlug": {
            "type": "string",
            "const": "fal-ai/meshy/rigging"
          },
          "heightMeters": {
            "type": "number",
            "minimum": 0.5,
            "maximum": 3
          },
          "sourceModelMediaId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "serviceSlug",
          "heightMeters",
          "sourceModelMediaId"
        ],
        "additionalProperties": false
      },
      "tool.chat.generate.input": {
        "type": "object",
        "properties": {
          "serviceSlug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "messages": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "const": "user"
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 20000
                        },
                        {
                          "minItems": 1,
                          "maxItems": 2,
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "text"
                                  },
                                  "text": {
                                    "type": "string",
                                    "maxLength": 20000
                                  }
                                },
                                "required": [
                                  "type",
                                  "text"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "image_url"
                                  },
                                  "image_url": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string",
                                        "maxLength": 7000000,
                                        "pattern": "^data:image\\/(?:jpeg|png|webp);base64,[A-Za-z0-9+/]+={0,2}$"
                                      },
                                      "detail": {
                                        "type": "string",
                                        "enum": [
                                          "auto",
                                          "low",
                                          "high"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "url"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "type",
                                  "image_url"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "const": "assistant"
                    },
                    "content": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 20000
                    }
                  },
                  "required": [
                    "role",
                    "content"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "clientSessionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "clientUserMessageId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "clientAssistantMessageId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "clientSessionName": {
            "type": "string",
            "maxLength": 100
          },
          "clientIsIncognito": {
            "type": "boolean"
          },
          "locale": {
            "default": "en",
            "type": "string",
            "pattern": "^[a-z]{2}$"
          },
          "maxOutputTokens": {
            "default": 4096,
            "type": "integer",
            "minimum": 1,
            "maximum": 4096
          }
        },
        "required": [
          "serviceSlug",
          "messages"
        ],
        "additionalProperties": false
      },
      "tool.sprite.generate.input": {
        "type": "object",
        "properties": {
          "sourceMode": {
            "type": "string",
            "enum": [
              "prompt",
              "upload"
            ]
          },
          "characterPrompt": {
            "type": "string",
            "maxLength": 5000
          },
          "promptNotes": {
            "type": "string",
            "maxLength": 1000
          },
          "selectedAnimations": {
            "minItems": 1,
            "maxItems": 9,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "idle",
                "walk",
                "run",
                "jump",
                "attack",
                "cast",
                "hurt",
                "death",
                "interact"
              ]
            }
          },
          "directionMode": {
            "type": "string",
            "enum": [
              "single",
              "four-way"
            ]
          },
          "engineTargets": {
            "minItems": 1,
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "generic-atlas",
                "unity",
                "godot",
                "phaser",
                "gamemaker",
                "rpg-maker"
              ]
            }
          },
          "spriteStyle": {
            "type": "string",
            "enum": [
              "pixel-art",
              "painted-2d",
              "clean-vector"
            ]
          },
          "frameSize": {
            "type": "string",
            "enum": [
              "96",
              "128",
              "192"
            ]
          },
          "imageResolution": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "ultra"
            ]
          },
          "serviceChoiceKey": {
            "type": "string",
            "enum": [
              "standard",
              "premium"
            ]
          },
          "defaultFps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "sourceImageMediaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "sourceMode",
          "characterPrompt",
          "selectedAnimations",
          "directionMode",
          "engineTargets",
          "spriteStyle",
          "frameSize",
          "imageResolution",
          "serviceChoiceKey",
          "defaultFps"
        ],
        "additionalProperties": false
      },
      "tool.speech.generate.input": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "voiceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "responseFormat": {
            "type": "string",
            "enum": [
              "wav"
            ]
          },
          "serviceSlug": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[a-z0-9][a-z0-9._/-]*$"
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "text",
          "voiceId",
          "responseFormat"
        ],
        "additionalProperties": false
      },
      "tool.voice.clone.input": {
        "type": "object",
        "properties": {
          "gender": {
            "type": "string",
            "enum": [
              "male",
              "female",
              "neutral"
            ]
          },
          "languages": {
            "minItems": 1,
            "maxItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 16
            }
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "audioMediaId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "gender",
          "languages",
          "name",
          "audioMediaId"
        ],
        "additionalProperties": false
      },
      "tool.security.scan.input": {
        "type": "object",
        "properties": {
          "authorizationId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "authorizationId"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A scoped automation key authorized for the REST API."
      }
    },
    "responses": {
      "Error": {
        "description": "Request rejected",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "success",
                "code",
                "message"
              ],
              "properties": {
                "success": {
                  "const": false
                },
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "params": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "RateLimited": {
        "description": "Request rejected",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "success",
                "code",
                "message"
              ],
              "properties": {
                "success": {
                  "const": false
                },
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "params": {
                  "type": "object"
                }
              }
            }
          }
        },
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Seconds to wait before another attempt."
          }
        }
      }
    }
  }
}
