{
  "openapi": "3.1.0",
  "info": {
    "title": "LogicBoostKit Media API",
    "version": "1.0.0",
    "summary": "FFmpeg and ffprobe over HTTP.",
    "description": "Send a task as JSON; the API runs FFmpeg or ffprobe on your files and returns the outputs, the usage and the price. USD 0.01332 per GB-second: (input GB + output GB) × processing seconds, charged only for requests that succeed."
  },
  "externalDocs": {
    "description": "Docs",
    "url": "https://media.logicboostkit.com/docs"
  },
  "servers": [
    {
      "url": "https://media.logicboostkit.com"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/file": {
      "post": {
        "operationId": "postFile",
        "summary": "Register a file name and get a URL to upload it to",
        "description": "Register a file name and get a signed URL to upload it to, before you process it with FFmpeg. Request, response and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/post-file"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file_name": {
                    "type": "string",
                    "description": "1 to 255 characters, no slashes."
                  },
                  "dir_id": {
                    "type": "string",
                    "description": "An existing directory. Left out, a new one is made."
                  }
                },
                "required": [
                  "file_name"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example": {
                  "value": {
                    "file_name": "source.mp4"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The file's path and where to PUT its bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "file": {
                      "type": "object",
                      "properties": {
                        "dir_id": {
                          "type": "string"
                        },
                        "file_name": {
                          "type": "string"
                        },
                        "file_path": {
                          "type": "string"
                        },
                        "added_on": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "dir_id",
                        "file_name",
                        "file_path",
                        "added_on"
                      ],
                      "additionalProperties": false
                    },
                    "upload": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "method": {
                          "type": "string",
                          "const": "PUT"
                        },
                        "headers": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "expiresInSeconds": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "url",
                        "method",
                        "headers",
                        "expiresInSeconds"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "file",
                    "upload"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "file": {
                        "dir_id": "dir_pi23jgy1yxlmigi873bz",
                        "file_name": "source.mp4",
                        "file_path": "dir_pi23jgy1yxlmigi873bz/source.mp4",
                        "added_on": "2026-10-13T09:41:07.214Z"
                      },
                      "upload": {
                        "url": "https://…",
                        "method": "PUT",
                        "headers": {},
                        "expiresInSeconds": 300
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/file/{dirId}/{fileName}": {
      "get": {
        "operationId": "getFile",
        "summary": "A file's path, type and size",
        "description": "Read a stored file’s path, type and size. Request, response fields and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/get-file"
        },
        "parameters": [
          {
            "name": "dirId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The directory's id."
          },
          {
            "name": "fileName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The file's name."
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "file_info": {
                      "type": "object",
                      "properties": {
                        "file_path": {
                          "type": "string"
                        },
                        "file_type": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "file_size": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "file_path",
                        "file_type",
                        "file_size"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "file_info"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "file_info": {
                        "file_path": "dir_pi23jgy1yxlmigi873bz/source.mp4",
                        "file_type": "video/mp4",
                        "file_size": 1937244979
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteFile",
        "summary": "Delete a file now",
        "description": "Delete a stored file at once, before its directory expires. Request, response and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/delete-file"
        },
        "parameters": [
          {
            "name": "dirId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The directory's id."
          },
          {
            "name": "fileName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The file's name."
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "deleted": {
                      "type": "object",
                      "properties": {
                        "file_path": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "file_path"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "deleted"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "deleted": {
                        "file_path": "dir_pi23jgy1yxlmigi873bz/source.mp4"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/file/download/{dirId}/{fileName}": {
      "get": {
        "operationId": "getFileDownload",
        "summary": "A URL to download a file from",
        "description": "Get a signed URL to download a stored file, valid for 5 minutes. Request, response fields and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/get-file-download"
        },
        "parameters": [
          {
            "name": "dirId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The directory's id."
          },
          {
            "name": "fileName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The file's name."
          }
        ],
        "responses": {
          "200": {
            "description": "A signed download URL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "download": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "method": {
                          "type": "string",
                          "const": "GET"
                        },
                        "expiresInSeconds": {
                          "type": "integer"
                        },
                        "file_path": {
                          "type": "string"
                        },
                        "file_size": {
                          "type": "integer"
                        },
                        "file_type": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "url",
                        "method",
                        "expiresInSeconds",
                        "file_path",
                        "file_size",
                        "file_type"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "download"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "download": {
                        "url": "https://…",
                        "method": "GET",
                        "expiresInSeconds": 300,
                        "file_path": "dir_pi23jgy1yxlmigi873bz/thumb.jpg",
                        "file_size": 84213,
                        "file_type": "image/jpeg"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/directory": {
      "post": {
        "operationId": "postDirectory",
        "summary": "Create a directory with a lifetime",
        "description": "Create a directory for your files with its own lifetime: 24 hours by default, 7 days at most. Request, response and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/post-directory"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ttl": {
                    "type": "number",
                    "description": "Seconds: 86400 by default, 604800 at most."
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "examples": {
                "example": {
                  "value": {
                    "ttl": 3600
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new directory.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "directory": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "ttl": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "id",
                        "ttl"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "directory"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "directory": {
                        "id": "dir_m8papv92jrn8rx6186g8",
                        "ttl": 3600
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getDirectory",
        "summary": "List your directories",
        "description": "List the directories in your account, with their lifetimes. Request, response fields and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/get-directory"
        },
        "responses": {
          "200": {
            "description": "Every directory that has not expired.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "directories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "ttl": {
                            "type": "integer"
                          },
                          "added_on": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "ttl",
                          "added_on"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "directories"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "directories": [
                        {
                          "id": "dir_pi23jgy1yxlmigi873bz",
                          "ttl": 86400,
                          "added_on": "2026-10-13T09:41:07.214Z"
                        },
                        {
                          "id": "dir_m8papv92jrn8rx6186g8",
                          "ttl": 3600,
                          "added_on": "2026-10-13T10:05:40.019Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/directory/{dirId}": {
      "get": {
        "operationId": "getDirectoryId",
        "summary": "List the files in a directory",
        "description": "List the files in one directory with GET /directory/{dirId}. Request, response fields and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/get-directory-id"
        },
        "parameters": [
          {
            "name": "dirId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The directory's id."
          }
        ],
        "responses": {
          "200": {
            "description": "The directory's files.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "file_name": {
                            "type": "string"
                          },
                          "added_on": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "file_name",
                          "added_on"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "ok",
                    "files"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "files": [
                        {
                          "file_name": "source.mp4",
                          "added_on": "2026-10-13T09:41:07.214Z"
                        },
                        {
                          "file_name": "thumb.jpg",
                          "added_on": "2026-10-13T09:43:21.870Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ffmpeg/process": {
      "post": {
        "operationId": "postFfmpegProcess",
        "summary": "Run a task and wait for the result",
        "description": "Run an FFmpeg task over HTTP and get the output files, the usage and the price in one response. Inputs, outputs, options and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/post-ffmpeg-process"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "task": {
                    "$ref": "#/components/schemas/Task"
                  }
                },
                "required": [
                  "task"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example": {
                  "value": {
                    "task": {
                      "inputs": [
                        {
                          "file_path": "dir_pi23jgy1yxlmigi873bz/source.mp4"
                        }
                      ],
                      "outputs": [
                        {
                          "file": "thumb.jpg",
                          "options": [
                            "-ss",
                            "5",
                            "-vframes",
                            "1"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The outputs, the usage and the price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessResult"
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "result": [
                        {
                          "file_name": "thumb.jpg",
                          "size_bytes": 84213,
                          "download_url": "https://…"
                        }
                      ],
                      "usage": {
                        "time_sec": 0.62,
                        "input_size_gb": 1.804199982,
                        "output_size_gb": 0.000078429,
                        "gb_sec": 1.118652615
                      },
                      "request_id": "job_0mv6hqvpqkiwproi518azpod",
                      "amount_usd": 0.014900453
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ffmpeg/process/async": {
      "post": {
        "operationId": "postFfmpegProcessAsync",
        "summary": "Queue a task; read the result later or receive a webhook",
        "description": "Queue an FFmpeg job, then read its result or receive a webhook. For jobs of up to 60 min. Request, webhook payload and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/post-ffmpeg-process-async"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "task": {
                    "$ref": "#/components/schemas/Task"
                  },
                  "webhook_url": {
                    "type": "string",
                    "description": "A public HTTPS URL to POST the result to."
                  }
                },
                "required": [
                  "task"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example": {
                  "value": {
                    "task": {
                      "inputs": [
                        {
                          "file_path": "dir_pi23jgy1yxlmigi873bz/source.mp4"
                        }
                      ],
                      "outputs": [
                        {
                          "file": "source-720p.mp4",
                          "options": [
                            "-vf",
                            "scale=-2:720",
                            "-crf",
                            "23"
                          ]
                        }
                      ]
                    },
                    "webhook_url": "https://example.com/hooks/media"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "const": "pending"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok",
                    "job_id",
                    "status",
                    "request_id"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "job_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
                      "status": "pending",
                      "request_id": "job_0mv6ihz6vfx5ua0h05x8bmql"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/job/{jobId}": {
      "get": {
        "operationId": "getJob",
        "summary": "An async job's status and result",
        "description": "Read an async FFmpeg job’s status, result files, usage and price. Request, response fields and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/get-job"
        },
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The job's id."
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "job_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
                      "status": "completed",
                      "request_id": "job_0mv6ihz6vfx5ua0h05x8bmql",
                      "result": [
                        {
                          "file_name": "source-720p.mp4",
                          "size_bytes": 412316860,
                          "download_url": "https://…"
                        }
                      ],
                      "usage": {
                        "time_sec": 41.27,
                        "input_size_gb": 1.804199982,
                        "output_size_gb": 0.384,
                        "gb_sec": 90.307013221
                      },
                      "amount_usd": 1.202889416
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteJob",
        "summary": "Cancel a job that is still pending",
        "description": "Cancel an async FFmpeg job that has not started yet. Request, response and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/delete-job"
        },
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The job's id."
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok",
                    "message"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "message": "Job cancelled successfully"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/jobs": {
      "get": {
        "operationId": "getJobs",
        "summary": "List your async jobs",
        "description": "List your async FFmpeg jobs, filtered by status and paged. Query parameters, response fields and status codes.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/get-jobs"
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only jobs in these states, separated by commas."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "description": "How many to return; 20 when left out."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "How many to skip; 0 when left out."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "created_at_desc",
                "created_at_asc"
              ]
            },
            "description": "created_at_desc when left out."
          }
        ],
        "responses": {
          "200": {
            "description": "One page of jobs.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "jobs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "processing",
                              "completed",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "webhook_url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string"
                          },
                          "completed_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "input_count": {
                            "type": "integer"
                          },
                          "output_count": {
                            "type": "integer"
                          },
                          "has_error": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "status",
                          "webhook_url",
                          "created_at",
                          "updated_at",
                          "completed_at",
                          "input_count",
                          "output_count",
                          "has_error"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "offset": {
                          "type": "integer"
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "total",
                        "limit",
                        "offset",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "jobs",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "jobs": [
                        {
                          "id": "job_0mv6ihz6vfx5ua0h05x8bmql",
                          "status": "completed",
                          "webhook_url": null,
                          "created_at": "2026-10-13T10:02:11.431Z",
                          "updated_at": "2026-10-13T10:03:02.118Z",
                          "completed_at": "2026-10-13T10:03:02.118Z",
                          "input_count": 1,
                          "output_count": 1,
                          "has_error": false
                        },
                        {
                          "id": "job_0mv6hcx5429ir9i0kjnput8u",
                          "status": "failed",
                          "webhook_url": null,
                          "created_at": "2026-10-13T09:30:15.880Z",
                          "updated_at": "2026-10-13T09:30:19.402Z",
                          "completed_at": "2026-10-13T09:30:19.402Z",
                          "input_count": 2,
                          "output_count": 1,
                          "has_error": true
                        }
                      ],
                      "pagination": {
                        "total": 14,
                        "limit": 2,
                        "offset": 0,
                        "has_more": true
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ffprobe/analyze": {
      "post": {
        "operationId": "postFfprobeAnalyze",
        "summary": "Run ffprobe on a file",
        "description": "Run ffprobe over HTTP on an uploaded file or a public URL, and get its format, streams, duration, codecs and resolution as JSON.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/post-ffprobe-analyze"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file_path": {
                    "type": "string",
                    "description": "dir_id/file_name of an uploaded file, or a public HTTPS URL."
                  },
                  "probe": {
                    "type": "object",
                    "description": "What to report: format, streams, chapters, programs, frames, packets, error and their controls."
                  }
                },
                "required": [
                  "file_path"
                ],
                "additionalProperties": false
              },
              "examples": {
                "example": {
                  "value": {
                    "file_path": "dir_pi23jgy1yxlmigi873bz/source.mp4",
                    "probe": {
                      "format": [
                        "duration",
                        "size",
                        "bit_rate"
                      ],
                      "streams": [
                        "codec_name",
                        "width",
                        "height"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ffprobe's JSON, the usage and the price.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "result": {
                      "type": "object",
                      "description": "ffprobe's JSON: one member per section asked for."
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "amount_usd": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "ok",
                    "result",
                    "usage",
                    "request_id",
                    "amount_usd"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "example": {
                    "value": {
                      "ok": true,
                      "result": {
                        "streams": [
                          {
                            "codec_name": "h264",
                            "width": 1920,
                            "height": 1080
                          },
                          {
                            "codec_name": "aac"
                          }
                        ],
                        "format": {
                          "duration": "634.533333",
                          "size": "1937244979",
                          "bit_rate": "24424185"
                        }
                      },
                      "usage": {
                        "time_sec": 0.31,
                        "input_size_gb": 1.804199982,
                        "output_size_gb": 1.49e-7,
                        "gb_sec": 0.55930204
                      },
                      "request_id": "job_0mv6iygbcl43togsnvc4g2wc",
                      "amount_usd": 0.007449903
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/usage": {
      "get": {
        "operationId": "getAccountUsage",
        "summary": "One row per charged request, as CSV or JSON",
        "description": "Export one row per charged request, as CSV or JSON, for a month or a date range, to check every charge against your own records.",
        "externalDocs": {
          "url": "https://media.logicboostkit.com/docs/get-account-usage"
        },
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A calendar month in UTC, as YYYY-MM."
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A date or an ISO 8601 time; with to."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A date (that whole day) or an ISO 8601 time; with from."
          },
          {
            "name": "key_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only the requests made with this key."
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "json"
              ]
            },
            "description": "csv when left out."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            },
            "description": "JSON only; 1000 when left out."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "JSON only: the next_cursor of the page before."
          }
        ],
        "responses": {
          "200": {
            "description": "The rows, as CSV (the default) or JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "request_id": {
                            "type": "string"
                          },
                          "completed_at": {
                            "type": "string"
                          },
                          "key_id": {
                            "type": "string"
                          },
                          "gb_sec": {
                            "type": "number"
                          },
                          "amount_usd": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "request_id",
                          "completed_at",
                          "key_id",
                          "gb_sec",
                          "amount_usd"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "ok",
                    "from",
                    "to",
                    "rows",
                    "next_cursor"
                  ],
                  "additionalProperties": false
                },
                "examples": {
                  "as-json": {
                    "value": {
                      "ok": true,
                      "from": "2026-10-13T00:00:00.000Z",
                      "to": "2026-10-14T00:00:00.000Z",
                      "rows": [
                        {
                          "request_id": "job_0mv6hcx5429ir9i0kjnput8u",
                          "completed_at": "2026-10-13T09:30:15.880Z",
                          "key_id": "key_r927c1t0v2p6",
                          "gb_sec": 90.307013221,
                          "amount_usd": 1.202889416
                        },
                        {
                          "request_id": "job_0mv6hqvpqkiwproi518azpod",
                          "completed_at": "2026-10-13T09:41:07.214Z",
                          "key_id": "key_r927c1t0v2p6",
                          "gb_sec": 3.53625,
                          "amount_usd": 0.04710285
                        }
                      ],
                      "next_cursor": null
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "request_id,completed_at,key_id,gb_sec,amount_usd\njob_0mv6hcx5429ir9i0kjnput8u,2026-10-13T09:30:15.880Z,key_r927c1t0v2p6,90.307013221,1.202889416\njob_0mv6hnzdy93wuugau1rys4cn,2026-10-13T09:38:52.006Z,key_sbdjfopoebls,1.118652615,0.014900453\njob_0mv6hqvpqkiwproi518azpod,2026-10-13T09:41:07.214Z,key_r927c1t0v2p6,3.536250000,0.047102850"
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account": {
      "get": {
        "operationId": "getAccount",
        "summary": "The account's usage this month and its limits",
        "responses": {
          "200": {
            "description": "There is no quota: usage is billed, not capped, so limit_gb_sec and remaining_gb_sec are null.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "account_id": {
                      "type": "string"
                    },
                    "plan": {
                      "type": "string",
                      "const": "pay-as-you-go"
                    },
                    "quota": {
                      "type": "object",
                      "properties": {
                        "used_gb_sec": {
                          "type": "number"
                        },
                        "limit_gb_sec": {
                          "type": "null"
                        },
                        "remaining_gb_sec": {
                          "type": "null"
                        },
                        "year_month": {
                          "type": "string"
                        },
                        "resets_on": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "used_gb_sec",
                        "limit_gb_sec",
                        "remaining_gb_sec",
                        "year_month",
                        "resets_on"
                      ],
                      "additionalProperties": false
                    },
                    "limits": {
                      "type": "object",
                      "properties": {
                        "requests_per_minute": {
                          "type": "integer"
                        },
                        "max_file_size_mb": {
                          "type": "integer"
                        },
                        "parallel_jobs": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "requests_per_minute",
                        "max_file_size_mb",
                        "parallel_jobs"
                      ],
                      "additionalProperties": false
                    },
                    "jobs": {
                      "type": "object",
                      "properties": {
                        "active": {
                          "type": "integer"
                        },
                        "available_slots": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "active",
                        "available_slots"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "ok",
                    "account_id",
                    "plan",
                    "quota",
                    "limits",
                    "jobs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ffmpeg/run": {
      "post": {
        "operationId": "postFfmpegRun",
        "summary": "Retired: use POST /ffmpeg/process",
        "deprecated": true,
        "responses": {
          "410": {
            "description": "Retired. Use POST /ffmpeg/process.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai/ffmpeg/process": {
      "post": {
        "operationId": "postAiFfmpegProcess",
        "summary": "Not offered",
        "responses": {
          "501": {
            "description": "The /ai endpoints are not offered. Use /ffmpeg/process or /ffprobe/analyze.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai/ffmpeg/process/async": {
      "post": {
        "operationId": "postAiFfmpegProcessAsync",
        "summary": "Not offered",
        "responses": {
          "501": {
            "description": "The /ai endpoints are not offered. Use /ffmpeg/process or /ffprobe/analyze.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai/ffprobe/analyze": {
      "post": {
        "operationId": "postAiFfprobeAnalyze",
        "summary": "Not offered",
        "responses": {
          "501": {
            "description": "The /ai endpoints are not offered. Use /ffmpeg/process or /ffprobe/analyze.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "An error. The status code says which; see the error reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Basic <key>: the header value the console shows when a key is created. The key may also be sent base64-encoded."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string",
            "description": "What went wrong, in a sentence."
          }
        },
        "required": [
          "ok",
          "error"
        ],
        "additionalProperties": false,
        "description": "Every error has this shape, and no error is charged."
      },
      "Usage": {
        "type": "object",
        "properties": {
          "time_sec": {
            "type": "number",
            "description": "Processing seconds, measured on the reference machine."
          },
          "input_size_gb": {
            "type": "number",
            "description": "Total size of the inputs."
          },
          "output_size_gb": {
            "type": "number",
            "description": "Total size of the outputs."
          },
          "gb_sec": {
            "type": "number",
            "description": "What the request is charged on: (input GB + output GB) × time_sec."
          }
        },
        "required": [
          "time_sec",
          "input_size_gb",
          "output_size_gb",
          "gb_sec"
        ],
        "additionalProperties": false
      },
      "ResultFile": {
        "type": "object",
        "properties": {
          "file_name": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "download_url": {
            "type": "string",
            "description": "A signed URL, valid for 3600 seconds."
          }
        },
        "required": [
          "file_name",
          "size_bytes",
          "download_url"
        ],
        "additionalProperties": false
      },
      "Task": {
        "type": "object",
        "properties": {
          "inputs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "properties": {
                "file_path": {
                  "type": "string",
                  "description": "dir_id/file_name of an uploaded file, or a public HTTPS URL."
                },
                "options": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "FFmpeg options placed before this input."
                }
              },
              "required": [
                "file_path"
              ],
              "additionalProperties": false
            }
          },
          "outputs": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "object",
              "properties": {
                "file": {
                  "type": "string",
                  "description": "The output's file name. A numbered pattern such as frame_%03d.png returns every file it produces."
                },
                "options": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "FFmpeg options for this output."
                },
                "maps": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Streams to map into this output, each passed as -map."
                }
              },
              "required": [
                "file"
              ],
              "additionalProperties": false
            }
          },
          "filter_complex": {
            "type": "string",
            "description": "A filter graph across the inputs."
          },
          "output_dir_id": {
            "type": "string",
            "description": "Where the outputs go. By default the inputs' directory."
          }
        },
        "required": [
          "inputs",
          "outputs"
        ],
        "additionalProperties": false
      },
      "ProcessResult": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResultFile"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          },
          "request_id": {
            "type": "string"
          },
          "amount_usd": {
            "type": "number"
          }
        },
        "required": [
          "ok",
          "result",
          "usage",
          "request_id",
          "amount_usd"
        ],
        "additionalProperties": false
      },
      "Job": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "true while pending or processing and when completed; false when failed or cancelled."
          },
          "job_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "request_id": {
            "type": "string",
            "description": "The same value as job_id."
          },
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResultFile"
            },
            "description": "Completed only."
          },
          "usage": {
            "$ref": "#/components/schemas/Usage",
            "description": "Completed only."
          },
          "amount_usd": {
            "type": "number",
            "description": "Completed only."
          },
          "error": {
            "type": "string",
            "description": "Failed only."
          }
        },
        "required": [
          "ok",
          "job_id",
          "status",
          "request_id"
        ],
        "additionalProperties": false
      }
    }
  }
}