{
  "openapi": "3.0.1",
  "info": {
    "title": "PBR channel packing with texture audit (ORM, Unity mask)",
    "description": "Pack PBR maps into glTF/Unreal ORM or Unity mask maps, with an audit of the set: value ranges, roughness/smoothness consistency, normal-map normalization, resolution mismatches, per-channel provenance. Data maps written raw, never colour-managed. PNG or EXR out.",
    "version": "0.1",
    "x-build-id": "jfjarGyVy0F2lRea4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ernestx~pbr-channel-packer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ernestx-pbr-channel-packer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/ernestx~pbr-channel-packer/runs": {
      "post": {
        "operationId": "runs-sync-ernestx-pbr-channel-packer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/ernestx~pbr-channel-packer/run-sync": {
      "post": {
        "operationId": "run-sync-ernestx-pbr-channel-packer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "convention": {
            "title": "Target convention",
            "enum": [
              "gltf-orm",
              "unreal-orm",
              "unity-mask",
              "unity-metallic"
            ],
            "type": "string",
            "description": "gltf-orm and unreal-orm write R=occlusion, G=roughness, B=metallic. The two Unity layouts store SMOOTHNESS in alpha (computed as 1-roughness unless a smoothness map is supplied - inverted exactly once, never twice): unity-mask is the HDRP/URP mask map, unity-metallic the Built-in Standard MetallicGlossMap. Every output ships with an engine import checklist (sRGB off, compression preset, slot).",
            "default": "gltf-orm"
          },
          "roughnessUrl": {
            "title": "Roughness map URL",
            "type": "string",
            "description": "Grayscale roughness. At least one of roughnessUrl, smoothnessUrl or metalRoughUrl is required - the Actor refuses to invent roughness."
          },
          "smoothnessUrl": {
            "title": "Smoothness (gloss) map URL",
            "type": "string",
            "description": "Grayscale smoothness/gloss; converted as roughness = 1 - smoothness. If both roughness and smoothness are supplied, their consistency is audited."
          },
          "metalRoughUrl": {
            "title": "Packed metallicRoughness URL (glTF style)",
            "type": "string",
            "description": "A glTF metallicRoughness texture: G channel = roughness, B channel = metallic. Typical when re-packing an existing glTF asset with a separate AO map."
          },
          "occlusionUrl": {
            "title": "Ambient occlusion map URL",
            "type": "string",
            "description": "Grayscale AO. Defaults to neutral white if omitted (reported, never silent)."
          },
          "metallicUrl": {
            "title": "Metallic map URL",
            "type": "string",
            "description": "Grayscale metallic. Defaults to 0 (dielectric) if omitted and no metalRough source is given."
          },
          "normalUrl": {
            "title": "Normal map URL (audit only)",
            "type": "string",
            "description": "Optional. Not packed into the output - audited instead: vector normalization statistics catch maps damaged by resizing or colour management upstream."
          },
          "normalConvert": {
            "title": "Normal map convention conversion",
            "enum": [
              "none",
              "opengl-to-directx",
              "directx-to-opengl"
            ],
            "type": "string",
            "description": "glTF, Unity and Blender use OpenGL normals (green = Y up); Unreal uses DirectX (green = Y down). The flip (G' = 1-G) is exact and needs no renormalization, but the SOURCE convention cannot be detected from pixels - you declare it, the converted map is emitted alongside the packed texture, and the report records your declaration. Flipping an already-correct map breaks it: bumps become dents.",
            "default": "none"
          },
          "metalRoughHasOcclusion": {
            "title": "Packed source already carries AO in R",
            "type": "boolean",
            "description": "Some pipelines ship a full ORM as 'metallicRoughness'. If enabled and no separate AO map is given, the R channel of metalRoughUrl is used as occlusion.",
            "default": false
          },
          "resolution": {
            "title": "Output resolution",
            "minimum": 0,
            "maximum": 8192,
            "type": "integer",
            "description": "Square output size in pixels, 4..8192. 0 = use the largest source resolution. Sources at other sizes are resampled (reported).",
            "default": 0
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "png",
              "exr"
            ],
            "type": "string",
            "description": "PNG (8-bit, lossless) or EXR (float, lossless). JPEG is deliberately not offered: chroma subsampling corrupts independently-meaningful channels.",
            "default": "png"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}