{
  "openapi": "3.1.0",
  "info": {
    "title": "Joip Public API",
    "version": "1.1.0",
    "description": "Generate and rewrite captions from server-side integrations using the same Joip credits as the web app. This API is live-only and has no sandbox."
  },
  "servers": [
    {
      "url": "https://api.joip.io",
      "description": "Live"
    }
  ],
  "externalDocs": {
    "description": "Joip API documentation",
    "url": "https://docs.joip.io/api-reference/overview"
  },
  "tags": [
    {
      "name": "Status",
      "description": "Public service health."
    },
    {
      "name": "Account",
      "description": "API account metadata."
    },
    {
      "name": "Credits",
      "description": "Shared Joip credits and server-authoritative pricing."
    },
    {
      "name": "Jobs",
      "description": "Asynchronous caption work and per-item results."
    },
    {
      "name": "Captions",
      "description": "Caption generation and rewriting."
    }
  ],
  "paths": {
    "/status": {
      "get": {
        "operationId": "get_status",
        "summary": "Get API status",
        "description": "Check whether the live Joip API edge is available. This operation does not require authentication.",
        "tags": [
          "Status"
        ],
        "security": [],
        "x-joip-scopes": [],
        "x-joip-idempotency": "forbidden",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/status"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "media_urls[0] must be an https:// URL.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_request",
                  "param": "media_urls",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, malformed, expired, or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_api_key",
                  "title": "Invalid API key",
                  "status": 401,
                  "detail": "The public API key is invalid.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_api_key",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "402": {
            "description": "The account does not have enough available Joip credits.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "detail": "There are not enough available credits for this request.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_credits",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "403": {
            "description": "The key does not grant the required scope or IP access.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This API key does not grant the required operation scope.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_scope",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource does not exist for this account.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#job_not_found",
                  "title": "Job not found",
                  "status": 404,
                  "detail": "Job not found.",
                  "instance": "/v1/captions/generate",
                  "code": "job_not_found",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with existing state or idempotency history.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#idempotency_conflict",
                  "title": "Idempotency key conflict",
                  "status": 409,
                  "detail": "This idempotency key was used for a different request.",
                  "instance": "/v1/captions/generate",
                  "code": "idempotency_conflict",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "429": {
            "description": "The per-key request limit or job-admission limit was exceeded.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#rate_limit_exceeded",
                  "title": "Rate limit exceeded",
                  "status": 429,
                  "detail": "This API key has exceeded 120 requests in the current minute.",
                  "instance": "/v1/captions/generate",
                  "code": "rate_limit_exceeded",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "500": {
            "description": "Joip could not complete the request.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#internal_error",
                  "title": "Internal error",
                  "status": 500,
                  "detail": "The API could not complete this request.",
                  "instance": "/v1/captions/generate",
                  "code": "internal_error",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "502": {
            "description": "The API edge received an invalid response from the API service.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_upstream_response",
                  "title": "Invalid upstream response",
                  "status": 502,
                  "detail": "The API service returned an invalid response.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_upstream_response",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "503": {
            "description": "The API or one of its required services is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#pricing_unavailable",
                  "title": "Pricing unavailable",
                  "status": 503,
                  "detail": "Caption pricing is temporarily unavailable.",
                  "instance": "/v1/captions/generate",
                  "code": "pricing_unavailable",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "operationId": "get_account",
        "summary": "Get API account",
        "description": "Return the Joip account associated with the API key, including its current API access state.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "joip_api_key": []
          }
        ],
        "x-joip-scopes": [
          "account:read"
        ],
        "x-joip-idempotency": "forbidden",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/account"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "media_urls[0] must be an https:// URL.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_request",
                  "param": "media_urls",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, malformed, expired, or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_api_key",
                  "title": "Invalid API key",
                  "status": 401,
                  "detail": "The public API key is invalid.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_api_key",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "402": {
            "description": "The account does not have enough available Joip credits.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "detail": "There are not enough available credits for this request.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_credits",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "403": {
            "description": "The key does not grant the required scope or IP access.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This API key does not grant the required operation scope.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_scope",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource does not exist for this account.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#job_not_found",
                  "title": "Job not found",
                  "status": 404,
                  "detail": "Job not found.",
                  "instance": "/v1/captions/generate",
                  "code": "job_not_found",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with existing state or idempotency history.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#idempotency_conflict",
                  "title": "Idempotency key conflict",
                  "status": 409,
                  "detail": "This idempotency key was used for a different request.",
                  "instance": "/v1/captions/generate",
                  "code": "idempotency_conflict",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "429": {
            "description": "The per-key request limit or job-admission limit was exceeded.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#rate_limit_exceeded",
                  "title": "Rate limit exceeded",
                  "status": 429,
                  "detail": "This API key has exceeded 120 requests in the current minute.",
                  "instance": "/v1/captions/generate",
                  "code": "rate_limit_exceeded",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "500": {
            "description": "Joip could not complete the request.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#internal_error",
                  "title": "Internal error",
                  "status": 500,
                  "detail": "The API could not complete this request.",
                  "instance": "/v1/captions/generate",
                  "code": "internal_error",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "502": {
            "description": "The API edge received an invalid response from the API service.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_upstream_response",
                  "title": "Invalid upstream response",
                  "status": 502,
                  "detail": "The API service returned an invalid response.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_upstream_response",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "503": {
            "description": "The API or one of its required services is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#pricing_unavailable",
                  "title": "Pricing unavailable",
                  "status": 503,
                  "detail": "Caption pricing is temporarily unavailable.",
                  "instance": "/v1/captions/generate",
                  "code": "pricing_unavailable",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                }
              }
            }
          }
        }
      }
    },
    "/v1/credits": {
      "get": {
        "operationId": "get_credit_balance",
        "summary": "Get credit balance",
        "description": "Return the same total, reserved, and available Joip credit balance used by the web app.",
        "tags": [
          "Credits"
        ],
        "security": [
          {
            "joip_api_key": []
          }
        ],
        "x-joip-scopes": [
          "credits:read"
        ],
        "x-joip-idempotency": "forbidden",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/credit_balance"
                },
                "example": {
                  "total_credits": 1200,
                  "reserved_credits": 15,
                  "available_credits": 1185,
                  "currency": "credits",
                  "updated_at": "2026-11-29T18:04:11.000Z"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "media_urls[0] must be an https:// URL.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_request",
                  "param": "media_urls",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, malformed, expired, or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_api_key",
                  "title": "Invalid API key",
                  "status": 401,
                  "detail": "The public API key is invalid.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_api_key",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "402": {
            "description": "The account does not have enough available Joip credits.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "detail": "There are not enough available credits for this request.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_credits",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "403": {
            "description": "The key does not grant the required scope or IP access.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This API key does not grant the required operation scope.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_scope",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource does not exist for this account.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#job_not_found",
                  "title": "Job not found",
                  "status": 404,
                  "detail": "Job not found.",
                  "instance": "/v1/captions/generate",
                  "code": "job_not_found",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with existing state or idempotency history.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#idempotency_conflict",
                  "title": "Idempotency key conflict",
                  "status": 409,
                  "detail": "This idempotency key was used for a different request.",
                  "instance": "/v1/captions/generate",
                  "code": "idempotency_conflict",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "429": {
            "description": "The per-key request limit or job-admission limit was exceeded.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#rate_limit_exceeded",
                  "title": "Rate limit exceeded",
                  "status": 429,
                  "detail": "This API key has exceeded 120 requests in the current minute.",
                  "instance": "/v1/captions/generate",
                  "code": "rate_limit_exceeded",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "500": {
            "description": "Joip could not complete the request.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#internal_error",
                  "title": "Internal error",
                  "status": 500,
                  "detail": "The API could not complete this request.",
                  "instance": "/v1/captions/generate",
                  "code": "internal_error",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "502": {
            "description": "The API edge received an invalid response from the API service.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_upstream_response",
                  "title": "Invalid upstream response",
                  "status": 502,
                  "detail": "The API service returned an invalid response.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_upstream_response",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "503": {
            "description": "The API or one of its required services is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#pricing_unavailable",
                  "title": "Pricing unavailable",
                  "status": 503,
                  "detail": "Caption pricing is temporarily unavailable.",
                  "instance": "/v1/captions/generate",
                  "code": "pricing_unavailable",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pricing": {
      "get": {
        "operationId": "list_pricing",
        "summary": "List public pricing",
        "description": "List the current server-authoritative credit prices for public caption operations.",
        "tags": [
          "Credits"
        ],
        "security": [
          {
            "joip_api_key": []
          }
        ],
        "x-joip-scopes": [
          "pricing:read"
        ],
        "x-joip-idempotency": "forbidden",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/pricing_entry_page"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "media_urls[0] must be an https:// URL.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_request",
                  "param": "media_urls",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, malformed, expired, or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_api_key",
                  "title": "Invalid API key",
                  "status": 401,
                  "detail": "The public API key is invalid.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_api_key",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "402": {
            "description": "The account does not have enough available Joip credits.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "detail": "There are not enough available credits for this request.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_credits",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "403": {
            "description": "The key does not grant the required scope or IP access.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This API key does not grant the required operation scope.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_scope",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource does not exist for this account.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#job_not_found",
                  "title": "Job not found",
                  "status": 404,
                  "detail": "Job not found.",
                  "instance": "/v1/captions/generate",
                  "code": "job_not_found",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with existing state or idempotency history.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#idempotency_conflict",
                  "title": "Idempotency key conflict",
                  "status": 409,
                  "detail": "This idempotency key was used for a different request.",
                  "instance": "/v1/captions/generate",
                  "code": "idempotency_conflict",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "429": {
            "description": "The per-key request limit or job-admission limit was exceeded.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#rate_limit_exceeded",
                  "title": "Rate limit exceeded",
                  "status": 429,
                  "detail": "This API key has exceeded 120 requests in the current minute.",
                  "instance": "/v1/captions/generate",
                  "code": "rate_limit_exceeded",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "500": {
            "description": "Joip could not complete the request.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#internal_error",
                  "title": "Internal error",
                  "status": 500,
                  "detail": "The API could not complete this request.",
                  "instance": "/v1/captions/generate",
                  "code": "internal_error",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "502": {
            "description": "The API edge received an invalid response from the API service.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_upstream_response",
                  "title": "Invalid upstream response",
                  "status": 502,
                  "detail": "The API service returned an invalid response.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_upstream_response",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "503": {
            "description": "The API or one of its required services is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#pricing_unavailable",
                  "title": "Pricing unavailable",
                  "status": 503,
                  "detail": "Caption pricing is temporarily unavailable.",
                  "instance": "/v1/captions/generate",
                  "code": "pricing_unavailable",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 1024,
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
            },
            "description": "Opaque cursor returned by the preceding page. Do not inspect or modify it."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25,
              "x-joip-wire-normalization": [
                "canonical base-10 integer query string is normalized to number; arrays, floats, leading zeroes, and noncanonical forms reject"
              ]
            },
            "description": "Maximum resources to return (1-100; default 25)."
          }
        ]
      }
    },
    "/v1/jobs": {
      "get": {
        "operationId": "list_jobs",
        "summary": "List jobs",
        "description": "List caption jobs newest first, optionally filtered by state or type. Use the opaque next_cursor value to continue pagination.",
        "tags": [
          "Jobs"
        ],
        "security": [
          {
            "joip_api_key": []
          }
        ],
        "x-joip-scopes": [
          "jobs:read"
        ],
        "x-joip-idempotency": "forbidden",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/job_page"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "media_urls[0] must be an https:// URL.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_request",
                  "param": "media_urls",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, malformed, expired, or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_api_key",
                  "title": "Invalid API key",
                  "status": 401,
                  "detail": "The public API key is invalid.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_api_key",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "402": {
            "description": "The account does not have enough available Joip credits.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "detail": "There are not enough available credits for this request.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_credits",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "403": {
            "description": "The key does not grant the required scope or IP access.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This API key does not grant the required operation scope.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_scope",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource does not exist for this account.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#job_not_found",
                  "title": "Job not found",
                  "status": 404,
                  "detail": "Job not found.",
                  "instance": "/v1/captions/generate",
                  "code": "job_not_found",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with existing state or idempotency history.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#idempotency_conflict",
                  "title": "Idempotency key conflict",
                  "status": 409,
                  "detail": "This idempotency key was used for a different request.",
                  "instance": "/v1/captions/generate",
                  "code": "idempotency_conflict",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "429": {
            "description": "The per-key request limit or job-admission limit was exceeded.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#rate_limit_exceeded",
                  "title": "Rate limit exceeded",
                  "status": 429,
                  "detail": "This API key has exceeded 120 requests in the current minute.",
                  "instance": "/v1/captions/generate",
                  "code": "rate_limit_exceeded",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "500": {
            "description": "Joip could not complete the request.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#internal_error",
                  "title": "Internal error",
                  "status": 500,
                  "detail": "The API could not complete this request.",
                  "instance": "/v1/captions/generate",
                  "code": "internal_error",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "502": {
            "description": "The API edge received an invalid response from the API service.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_upstream_response",
                  "title": "Invalid upstream response",
                  "status": 502,
                  "detail": "The API service returned an invalid response.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_upstream_response",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "503": {
            "description": "The API or one of its required services is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#pricing_unavailable",
                  "title": "Pricing unavailable",
                  "status": 503,
                  "detail": "Caption pricing is temporarily unavailable.",
                  "instance": "/v1/captions/generate",
                  "code": "pricing_unavailable",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 1024,
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
            },
            "description": "Opaque cursor returned by the preceding page. Do not inspect or modify it."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25,
              "x-joip-wire-normalization": [
                "canonical base-10 integer query string is normalized to number; arrays, floats, leading zeroes, and noncanonical forms reject"
              ]
            },
            "description": "Maximum resources to return (1-100; default 25)."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "dispatching",
                "submitted",
                "polling",
                "processing",
                "needs_review",
                "completed",
                "partially_completed",
                "failed",
                "redacted"
              ]
            },
            "description": "Return only jobs in this state."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "caption_generation",
                "caption_rewrite"
              ]
            },
            "description": "Return only jobs of this type."
          }
        ]
      }
    },
    "/v1/jobs/{job_id}": {
      "get": {
        "operationId": "get_job",
        "summary": "Get a job",
        "description": "Retrieve one caption job, its lifecycle state, and its credit reservation and settlement summary. Pass include=items to receive every job item in the same response.",
        "tags": [
          "Jobs"
        ],
        "security": [
          {
            "joip_api_key": []
          }
        ],
        "x-joip-scopes": [
          "jobs:read"
        ],
        "x-joip-idempotency": "forbidden",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/job"
                },
                "example": {
                  "id": "6f1c2a7e-3b5d-4c8e-9a0f-1d2e3f4a5b6c",
                  "type": "caption_generation",
                  "state": "completed",
                  "created_at": "2026-11-29T18:04:11.000Z",
                  "updated_at": "2026-11-29T18:04:19.000Z",
                  "completed_at": "2026-11-29T18:04:19.000Z",
                  "item_count": 1,
                  "completed_item_count": 1,
                  "failed_item_count": 0,
                  "billing": {
                    "reserved_credits": 5,
                    "settled_credits": 5,
                    "released_credits": 0,
                    "currency": "credits"
                  },
                  "items": [
                    {
                      "id": "0b9e8d7c-6a5f-4e3d-8c2b-1a0f9e8d7c6b",
                      "job_id": "6f1c2a7e-3b5d-4c8e-9a0f-1d2e3f4a5b6c",
                      "job_type": "caption_generation",
                      "index": 0,
                      "state": "completed",
                      "input_asset_ids": [
                        "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a"
                      ],
                      "output_asset_ids": [],
                      "created_at": "2026-11-29T18:04:11.000Z",
                      "updated_at": "2026-11-29T18:04:19.000Z",
                      "completed_at": "2026-11-29T18:04:19.000Z",
                      "result": {
                        "type": "caption",
                        "source_asset_id": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
                        "caption_text": "Eyes on her. Hands where she can see them. You stroke only when she says so."
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "media_urls[0] must be an https:// URL.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_request",
                  "param": "media_urls",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, malformed, expired, or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_api_key",
                  "title": "Invalid API key",
                  "status": 401,
                  "detail": "The public API key is invalid.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_api_key",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "402": {
            "description": "The account does not have enough available Joip credits.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "detail": "There are not enough available credits for this request.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_credits",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "403": {
            "description": "The key does not grant the required scope or IP access.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This API key does not grant the required operation scope.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_scope",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource does not exist for this account.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#job_not_found",
                  "title": "Job not found",
                  "status": 404,
                  "detail": "Job not found.",
                  "instance": "/v1/captions/generate",
                  "code": "job_not_found",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with existing state or idempotency history.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#idempotency_conflict",
                  "title": "Idempotency key conflict",
                  "status": 409,
                  "detail": "This idempotency key was used for a different request.",
                  "instance": "/v1/captions/generate",
                  "code": "idempotency_conflict",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "429": {
            "description": "The per-key request limit or job-admission limit was exceeded.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#rate_limit_exceeded",
                  "title": "Rate limit exceeded",
                  "status": 429,
                  "detail": "This API key has exceeded 120 requests in the current minute.",
                  "instance": "/v1/captions/generate",
                  "code": "rate_limit_exceeded",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "500": {
            "description": "Joip could not complete the request.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#internal_error",
                  "title": "Internal error",
                  "status": 500,
                  "detail": "The API could not complete this request.",
                  "instance": "/v1/captions/generate",
                  "code": "internal_error",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "502": {
            "description": "The API edge received an invalid response from the API service.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_upstream_response",
                  "title": "Invalid upstream response",
                  "status": 502,
                  "detail": "The API service returned an invalid response.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_upstream_response",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "503": {
            "description": "The API or one of its required services is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#pricing_unavailable",
                  "title": "Pricing unavailable",
                  "status": 503,
                  "detail": "Caption pricing is temporarily unavailable.",
                  "instance": "/v1/captions/generate",
                  "code": "pricing_unavailable",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "items"
              ]
            },
            "description": "Pass items to embed every job item, in input order, as the job's items array."
          }
        ]
      }
    },
    "/v1/jobs/{job_id}/items": {
      "get": {
        "operationId": "list_job_items",
        "summary": "List job items",
        "description": "List a job's individual caption results or sanitized failures in input order.",
        "tags": [
          "Jobs"
        ],
        "security": [
          {
            "joip_api_key": []
          }
        ],
        "x-joip-scopes": [
          "jobs:read"
        ],
        "x-joip-idempotency": "forbidden",
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/job_item_page"
                },
                "example": {
                  "data": [
                    {
                      "id": "0b9e8d7c-6a5f-4e3d-8c2b-1a0f9e8d7c6b",
                      "job_id": "6f1c2a7e-3b5d-4c8e-9a0f-1d2e3f4a5b6c",
                      "job_type": "caption_generation",
                      "index": 0,
                      "state": "completed",
                      "input_asset_ids": [
                        "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a"
                      ],
                      "output_asset_ids": [],
                      "created_at": "2026-11-29T18:04:11.000Z",
                      "updated_at": "2026-11-29T18:04:19.000Z",
                      "completed_at": "2026-11-29T18:04:19.000Z",
                      "result": {
                        "type": "caption",
                        "source_asset_id": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a",
                        "caption_text": "Eyes on her. Hands where she can see them. You stroke only when she says so."
                      }
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "media_urls[0] must be an https:// URL.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_request",
                  "param": "media_urls",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, malformed, expired, or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_api_key",
                  "title": "Invalid API key",
                  "status": 401,
                  "detail": "The public API key is invalid.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_api_key",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "402": {
            "description": "The account does not have enough available Joip credits.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "detail": "There are not enough available credits for this request.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_credits",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "403": {
            "description": "The key does not grant the required scope or IP access.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This API key does not grant the required operation scope.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_scope",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource does not exist for this account.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#job_not_found",
                  "title": "Job not found",
                  "status": 404,
                  "detail": "Job not found.",
                  "instance": "/v1/captions/generate",
                  "code": "job_not_found",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with existing state or idempotency history.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#idempotency_conflict",
                  "title": "Idempotency key conflict",
                  "status": 409,
                  "detail": "This idempotency key was used for a different request.",
                  "instance": "/v1/captions/generate",
                  "code": "idempotency_conflict",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "429": {
            "description": "The per-key request limit or job-admission limit was exceeded.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#rate_limit_exceeded",
                  "title": "Rate limit exceeded",
                  "status": 429,
                  "detail": "This API key has exceeded 120 requests in the current minute.",
                  "instance": "/v1/captions/generate",
                  "code": "rate_limit_exceeded",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "500": {
            "description": "Joip could not complete the request.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#internal_error",
                  "title": "Internal error",
                  "status": 500,
                  "detail": "The API could not complete this request.",
                  "instance": "/v1/captions/generate",
                  "code": "internal_error",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "502": {
            "description": "The API edge received an invalid response from the API service.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_upstream_response",
                  "title": "Invalid upstream response",
                  "status": 502,
                  "detail": "The API service returned an invalid response.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_upstream_response",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "503": {
            "description": "The API or one of its required services is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#pricing_unavailable",
                  "title": "Pricing unavailable",
                  "status": 503,
                  "detail": "Caption pricing is temporarily unavailable.",
                  "instance": "/v1/captions/generate",
                  "code": "pricing_unavailable",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 1024,
              "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
            },
            "description": "Opaque cursor returned by the preceding page. Do not inspect or modify it."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25,
              "x-joip-wire-normalization": [
                "canonical base-10 integer query string is normalized to number; arrays, floats, leading zeroes, and noncanonical forms reject"
              ]
            },
            "description": "Maximum resources to return (1-100; default 25)."
          }
        ]
      }
    },
    "/v1/captions/generate": {
      "post": {
        "operationId": "generate_captions",
        "summary": "Generate captions",
        "description": "Create an asynchronous caption-generation job for one to ten public HTTPS media URLs. Repeating the request with the same Idempotency-Key returns the original job with Idempotent-Replayed: true.",
        "tags": [
          "Captions"
        ],
        "security": [
          {
            "joip_api_key": []
          }
        ],
        "x-joip-scopes": [
          "captions:write"
        ],
        "x-joip-idempotency": "required",
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present and true when this response replays an earlier acceptance with the same Idempotency-Key. Absent on the first acceptance.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/job"
                },
                "example": {
                  "id": "6f1c2a7e-3b5d-4c8e-9a0f-1d2e3f4a5b6c",
                  "type": "caption_generation",
                  "state": "queued",
                  "created_at": "2026-11-29T18:04:11.000Z",
                  "updated_at": "2026-11-29T18:04:11.000Z",
                  "item_count": 1,
                  "completed_item_count": 0,
                  "failed_item_count": 0,
                  "billing": {
                    "reserved_credits": 5,
                    "settled_credits": 0,
                    "released_credits": 0,
                    "currency": "credits"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "media_urls[0] must be an https:// URL.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_request",
                  "param": "media_urls",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, malformed, expired, or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_api_key",
                  "title": "Invalid API key",
                  "status": 401,
                  "detail": "The public API key is invalid.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_api_key",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "402": {
            "description": "The account does not have enough available Joip credits.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "detail": "There are not enough available credits for this request.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_credits",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "403": {
            "description": "The key does not grant the required scope or IP access.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This API key does not grant the required operation scope.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_scope",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource does not exist for this account.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#job_not_found",
                  "title": "Job not found",
                  "status": 404,
                  "detail": "Job not found.",
                  "instance": "/v1/captions/generate",
                  "code": "job_not_found",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with existing state or idempotency history.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#idempotency_conflict",
                  "title": "Idempotency key conflict",
                  "status": 409,
                  "detail": "This idempotency key was used for a different request.",
                  "instance": "/v1/captions/generate",
                  "code": "idempotency_conflict",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "413": {
            "description": "The JSON request body exceeds 1 MiB.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#request_too_large",
                  "title": "Request too large",
                  "status": 413,
                  "detail": "Public API JSON request bodies cannot exceed 1 MiB.",
                  "instance": "/v1/captions/generate",
                  "code": "request_too_large",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "415": {
            "description": "The request body is not application/json.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#json_required",
                  "title": "JSON body required",
                  "status": 415,
                  "detail": "Public API request bodies must use application/json.",
                  "instance": "/v1/captions/generate",
                  "code": "json_required",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "429": {
            "description": "The per-key request limit or job-admission limit was exceeded.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#rate_limit_exceeded",
                  "title": "Rate limit exceeded",
                  "status": 429,
                  "detail": "This API key has exceeded 120 requests in the current minute.",
                  "instance": "/v1/captions/generate",
                  "code": "rate_limit_exceeded",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "500": {
            "description": "Joip could not complete the request.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#internal_error",
                  "title": "Internal error",
                  "status": 500,
                  "detail": "The API could not complete this request.",
                  "instance": "/v1/captions/generate",
                  "code": "internal_error",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "502": {
            "description": "The API edge received an invalid response from the API service.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_upstream_response",
                  "title": "Invalid upstream response",
                  "status": 502,
                  "detail": "The API service returned an invalid response.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_upstream_response",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "503": {
            "description": "The API or one of its required services is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#pricing_unavailable",
                  "title": "Pricing unavailable",
                  "status": 503,
                  "detail": "Caption pricing is temporarily unavailable.",
                  "instance": "/v1/captions/generate",
                  "code": "pricing_unavailable",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 255
            },
            "description": "Client-generated key scoped by account, method, canonical route, and key value."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/caption_generate_request"
              },
              "example": {
                "media_urls": [
                  "https://cdn.example.com/photo.jpg"
                ],
                "style": "joi"
              }
            }
          }
        }
      }
    },
    "/v1/captions/rewrite": {
      "post": {
        "operationId": "rewrite_captions",
        "summary": "Rewrite captions",
        "description": "Create an asynchronous job that rewrites supplied captions for one to ten public HTTPS media URLs. Repeating the request with the same Idempotency-Key returns the original job with Idempotent-Replayed: true.",
        "tags": [
          "Captions"
        ],
        "security": [
          {
            "joip_api_key": []
          }
        ],
        "x-joip-scopes": [
          "captions:write"
        ],
        "x-joip-idempotency": "required",
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "Idempotent-Replayed": {
                "description": "Present and true when this response replays an earlier acceptance with the same Idempotency-Key. Absent on the first acceptance.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/job"
                },
                "example": {
                  "id": "6f1c2a7e-3b5d-4c8e-9a0f-1d2e3f4a5b6c",
                  "type": "caption_rewrite",
                  "state": "queued",
                  "created_at": "2026-11-29T18:04:11.000Z",
                  "updated_at": "2026-11-29T18:04:11.000Z",
                  "item_count": 1,
                  "completed_item_count": 0,
                  "failed_item_count": 0,
                  "billing": {
                    "reserved_credits": 5,
                    "settled_credits": 0,
                    "released_credits": 0,
                    "currency": "credits"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_request",
                  "title": "Invalid request",
                  "status": 400,
                  "detail": "media_urls[0] must be an https:// URL.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_request",
                  "param": "media_urls",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, malformed, expired, or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_api_key",
                  "title": "Invalid API key",
                  "status": 401,
                  "detail": "The public API key is invalid.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_api_key",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "402": {
            "description": "The account does not have enough available Joip credits.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_credits",
                  "title": "Insufficient credits",
                  "status": 402,
                  "detail": "There are not enough available credits for this request.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_credits",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "403": {
            "description": "The key does not grant the required scope or IP access.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#insufficient_scope",
                  "title": "Insufficient scope",
                  "status": 403,
                  "detail": "This API key does not grant the required operation scope.",
                  "instance": "/v1/captions/generate",
                  "code": "insufficient_scope",
                  "param": "authorization",
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource does not exist for this account.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#job_not_found",
                  "title": "Job not found",
                  "status": 404,
                  "detail": "Job not found.",
                  "instance": "/v1/captions/generate",
                  "code": "job_not_found",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with existing state or idempotency history.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#idempotency_conflict",
                  "title": "Idempotency key conflict",
                  "status": 409,
                  "detail": "This idempotency key was used for a different request.",
                  "instance": "/v1/captions/generate",
                  "code": "idempotency_conflict",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "413": {
            "description": "The JSON request body exceeds 1 MiB.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#request_too_large",
                  "title": "Request too large",
                  "status": 413,
                  "detail": "Public API JSON request bodies cannot exceed 1 MiB.",
                  "instance": "/v1/captions/generate",
                  "code": "request_too_large",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "415": {
            "description": "The request body is not application/json.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#json_required",
                  "title": "JSON body required",
                  "status": 415,
                  "detail": "Public API request bodies must use application/json.",
                  "instance": "/v1/captions/generate",
                  "code": "json_required",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "429": {
            "description": "The per-key request limit or job-admission limit was exceeded.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests this API key may make in the current one-minute window.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left for this API key in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Whole seconds until this API key's rate-limit window resets.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#rate_limit_exceeded",
                  "title": "Rate limit exceeded",
                  "status": 429,
                  "detail": "This API key has exceeded 120 requests in the current minute.",
                  "instance": "/v1/captions/generate",
                  "code": "rate_limit_exceeded",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "500": {
            "description": "Joip could not complete the request.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#internal_error",
                  "title": "Internal error",
                  "status": 500,
                  "detail": "The API could not complete this request.",
                  "instance": "/v1/captions/generate",
                  "code": "internal_error",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "502": {
            "description": "The API edge received an invalid response from the API service.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#invalid_upstream_response",
                  "title": "Invalid upstream response",
                  "status": 502,
                  "detail": "The API service returned an invalid response.",
                  "instance": "/v1/captions/generate",
                  "code": "invalid_upstream_response",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "503": {
            "description": "The API or one of its required services is temporarily unavailable.",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                },
                "example": {
                  "type": "https://docs.joip.io/api-reference/errors#pricing_unavailable",
                  "title": "Pricing unavailable",
                  "status": 503,
                  "detail": "Caption pricing is temporarily unavailable.",
                  "instance": "/v1/captions/generate",
                  "code": "pricing_unavailable",
                  "param": null,
                  "request_id": "req_4f9c2b7a1e6d3c8b5a0f9e2d7c4b1a6e"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "headers": {
              "X-Request-Id": {
                "description": "Canonical Joip request identifier.",
                "schema": {
                  "type": "string",
                  "pattern": "^req_[a-z0-9]{16,64}$"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/problem_details"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 255
            },
            "description": "Client-generated key scoped by account, method, canonical route, and key value."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/caption_rewrite_request"
              },
              "example": {
                "items": [
                  {
                    "media_url": "https://cdn.example.com/photo.jpg",
                    "caption": "Original caption"
                  }
                ],
                "rewrite_mode": "improve"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "joip_api_key": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "joip_live_..."
      }
    },
    "schemas": {
      "account": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "api_access": {
            "type": "string",
            "enum": [
              "active",
              "suspended"
            ]
          },
          "tier": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "api_access",
          "tier",
          "created_at"
        ]
      },
      "caption_generate_request": {
        "anyOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "media_urls": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https:\\/\\/"
                },
                "minItems": 1,
                "maxItems": 10
              },
              "style": {
                "type": "string",
                "enum": [
                  "joi",
                  "forced-bi",
                  "beta",
                  "cbt",
                  "cuckold"
                ],
                "default": "joi"
              },
              "custom_instructions": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4000,
                "pattern": "\\S"
              }
            },
            "required": [
              "media_urls"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "media_urls": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048,
                  "pattern": "^https:\\/\\/"
                },
                "minItems": 1,
                "maxItems": 10
              },
              "style": {
                "const": "custom",
                "type": "string"
              },
              "custom_instructions": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4000,
                "pattern": "\\S"
              }
            },
            "required": [
              "media_urls",
              "style",
              "custom_instructions"
            ]
          }
        ]
      },
      "caption_result": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "caption",
            "type": "string"
          },
          "source_asset_id": {
            "type": "string",
            "format": "uuid"
          },
          "caption_text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000,
            "pattern": "\\S"
          }
        },
        "required": [
          "type",
          "source_asset_id",
          "caption_text"
        ]
      },
      "caption_rewrite_request": {
        "anyOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "media_url": {
                      "type": "string",
                      "format": "uri",
                      "maxLength": 2048,
                      "pattern": "^https:\\/\\/"
                    },
                    "caption": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4000,
                      "pattern": "\\S"
                    }
                  },
                  "required": [
                    "media_url",
                    "caption"
                  ]
                },
                "minItems": 1,
                "maxItems": 10
              },
              "rewrite_mode": {
                "type": "string",
                "enum": [
                  "improve",
                  "spicier",
                  "milder",
                  "different"
                ]
              },
              "custom_instructions": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4000,
                "pattern": "\\S"
              }
            },
            "required": [
              "items",
              "rewrite_mode"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "media_url": {
                      "type": "string",
                      "format": "uri",
                      "maxLength": 2048,
                      "pattern": "^https:\\/\\/"
                    },
                    "caption": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4000,
                      "pattern": "\\S"
                    }
                  },
                  "required": [
                    "media_url",
                    "caption"
                  ]
                },
                "minItems": 1,
                "maxItems": 10
              },
              "rewrite_mode": {
                "const": "custom",
                "type": "string"
              },
              "custom_instructions": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4000,
                "pattern": "\\S"
              }
            },
            "required": [
              "items",
              "rewrite_mode",
              "custom_instructions"
            ]
          }
        ]
      },
      "credit_balance": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "total_credits": {
            "type": "integer",
            "minimum": 0
          },
          "reserved_credits": {
            "type": "integer",
            "minimum": 0
          },
          "available_credits": {
            "type": "integer",
            "minimum": 0
          },
          "currency": {
            "const": "credits",
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "total_credits",
          "reserved_credits",
          "available_credits",
          "currency",
          "updated_at"
        ],
        "x-joip-cross-field-rules": [
          "reserved_credits <= total_credits",
          "available_credits = total_credits - reserved_credits"
        ]
      },
      "job": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "asset_import",
              "caption_generation",
              "caption_rewrite",
              "censor",
              "censor_ruin",
              "babecock_generation",
              "babecock_remix",
              "undress_generation",
              "session_reddit_import",
              "session_manual_import",
              "session_archive_import"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "dispatching",
              "submitted",
              "polling",
              "processing",
              "needs_review",
              "completed",
              "partially_completed",
              "failed",
              "redacted"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "item_count": {
            "type": "integer",
            "minimum": 0
          },
          "completed_item_count": {
            "type": "integer",
            "minimum": 0
          },
          "failed_item_count": {
            "type": "integer",
            "minimum": 0
          },
          "billing": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "reserved_credits": {
                "type": "integer",
                "minimum": 0
              },
              "settled_credits": {
                "type": "integer",
                "minimum": 0
              },
              "released_credits": {
                "type": "integer",
                "minimum": 0
              },
              "currency": {
                "const": "credits",
                "type": "string"
              }
            },
            "required": [
              "reserved_credits",
              "settled_credits",
              "released_credits",
              "currency"
            ],
            "x-joip-cross-field-rules": [
              "settled_credits + released_credits <= reserved_credits"
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]*$"
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "job_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "job_type": {
                  "type": "string",
                  "enum": [
                    "asset_import",
                    "caption_generation",
                    "caption_rewrite",
                    "censor",
                    "censor_ruin",
                    "babecock_generation",
                    "babecock_remix",
                    "undress_generation",
                    "session_reddit_import",
                    "session_manual_import",
                    "session_archive_import"
                  ]
                },
                "index": {
                  "type": "integer",
                  "minimum": 0
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "dispatching",
                    "submitted",
                    "polling",
                    "processing",
                    "needs_review",
                    "completed",
                    "failed",
                    "redacted"
                  ]
                },
                "input_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "completed_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "result": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "const": "caption",
                      "type": "string"
                    },
                    "source_asset_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "caption_text": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4000,
                      "pattern": "\\S"
                    }
                  },
                  "required": [
                    "type",
                    "source_asset_id",
                    "caption_text"
                  ]
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "job_id",
                "job_type",
                "index",
                "state",
                "input_asset_ids",
                "output_asset_ids",
                "created_at",
                "updated_at"
              ],
              "x-joip-cross-field-rules": [
                "terminal state requires completed_at; nonterminal state forbids completed_at",
                "completed caption job type requires result.type = caption; every other job type or state forbids result",
                "caption job types require output_asset_ids.length = 0",
                "caption result source_asset_id must be one of input_asset_ids"
              ]
            }
          }
        },
        "required": [
          "id",
          "type",
          "state",
          "created_at",
          "updated_at",
          "item_count",
          "completed_item_count",
          "failed_item_count",
          "billing"
        ],
        "x-joip-cross-field-rules": [
          "completed_item_count <= item_count",
          "failed_item_count <= item_count",
          "completed_item_count + failed_item_count <= item_count",
          "terminal state requires completed_at; nonterminal state forbids completed_at",
          "completed state requires completed_item_count = item_count and failed_item_count = 0",
          "partially_completed state requires completed_item_count > 0, failed_item_count > 0, and their sum = item_count",
          "failed state requires failed_item_count = item_count and completed_item_count = 0",
          "redacted state requires completed_item_count + failed_item_count = item_count",
          "terminal state requires settled_credits + released_credits = reserved_credits",
          "items, when present, belong to this job (job_id = id, job_type = type), are in ascending index order, and number at most item_count"
        ]
      },
      "job_get_query": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "include": {
            "type": "string",
            "enum": [
              "items"
            ]
          }
        }
      },
      "job_id_path": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "job_id"
        ]
      },
      "job_item_page": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "job_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "job_type": {
                  "type": "string",
                  "enum": [
                    "asset_import",
                    "caption_generation",
                    "caption_rewrite",
                    "censor",
                    "censor_ruin",
                    "babecock_generation",
                    "babecock_remix",
                    "undress_generation",
                    "session_reddit_import",
                    "session_manual_import",
                    "session_archive_import"
                  ]
                },
                "index": {
                  "type": "integer",
                  "minimum": 0
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "dispatching",
                    "submitted",
                    "polling",
                    "processing",
                    "needs_review",
                    "completed",
                    "failed",
                    "redacted"
                  ]
                },
                "input_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "output_asset_ids": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "completed_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "result": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "const": "caption",
                      "type": "string"
                    },
                    "source_asset_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "caption_text": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 4000,
                      "pattern": "\\S"
                    }
                  },
                  "required": [
                    "type",
                    "source_asset_id",
                    "caption_text"
                  ]
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "job_id",
                "job_type",
                "index",
                "state",
                "input_asset_ids",
                "output_asset_ids",
                "created_at",
                "updated_at"
              ],
              "x-joip-cross-field-rules": [
                "terminal state requires completed_at; nonterminal state forbids completed_at",
                "completed caption job type requires result.type = caption; every other job type or state forbids result",
                "caption job types require output_asset_ids.length = 0",
                "caption result source_asset_id must be one of input_asset_ids"
              ]
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 16,
                "maxLength": 1024,
                "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "has_more"
        ]
      },
      "job_list_query": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "cursor": {
            "type": "string",
            "minLength": 16,
            "maxLength": 1024,
            "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 25,
            "x-joip-wire-normalization": [
              "canonical base-10 integer query string is normalized to number; arrays, floats, leading zeroes, and noncanonical forms reject"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "dispatching",
              "submitted",
              "polling",
              "processing",
              "needs_review",
              "completed",
              "partially_completed",
              "failed",
              "redacted"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "caption_generation",
              "caption_rewrite"
            ]
          }
        }
      },
      "job_page": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "asset_import",
                    "caption_generation",
                    "caption_rewrite",
                    "censor",
                    "censor_ruin",
                    "babecock_generation",
                    "babecock_remix",
                    "undress_generation",
                    "session_reddit_import",
                    "session_manual_import",
                    "session_archive_import"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "dispatching",
                    "submitted",
                    "polling",
                    "processing",
                    "needs_review",
                    "completed",
                    "partially_completed",
                    "failed",
                    "redacted"
                  ]
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "completed_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "item_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "completed_item_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "failed_item_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "billing": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "reserved_credits": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "settled_credits": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "released_credits": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "currency": {
                      "const": "credits",
                      "type": "string"
                    }
                  },
                  "required": [
                    "reserved_credits",
                    "settled_credits",
                    "released_credits",
                    "currency"
                  ],
                  "x-joip-cross-field-rules": [
                    "settled_credits + released_credits <= reserved_credits"
                  ]
                },
                "error": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "code": {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "job_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "job_type": {
                        "type": "string",
                        "enum": [
                          "asset_import",
                          "caption_generation",
                          "caption_rewrite",
                          "censor",
                          "censor_ruin",
                          "babecock_generation",
                          "babecock_remix",
                          "undress_generation",
                          "session_reddit_import",
                          "session_manual_import",
                          "session_archive_import"
                        ]
                      },
                      "index": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "queued",
                          "dispatching",
                          "submitted",
                          "polling",
                          "processing",
                          "needs_review",
                          "completed",
                          "failed",
                          "redacted"
                        ]
                      },
                      "input_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "output_asset_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updated_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "completed_at": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "result": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "type": {
                            "const": "caption",
                            "type": "string"
                          },
                          "source_asset_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "caption_text": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 4000,
                            "pattern": "\\S"
                          }
                        },
                        "required": [
                          "type",
                          "source_asset_id",
                          "caption_text"
                        ]
                      },
                      "error": {
                        "anyOf": [
                          {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "code": {
                                "type": "string",
                                "pattern": "^[a-z][a-z0-9_]*$"
                              },
                              "message": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 2000
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "job_id",
                      "job_type",
                      "index",
                      "state",
                      "input_asset_ids",
                      "output_asset_ids",
                      "created_at",
                      "updated_at"
                    ],
                    "x-joip-cross-field-rules": [
                      "terminal state requires completed_at; nonterminal state forbids completed_at",
                      "completed caption job type requires result.type = caption; every other job type or state forbids result",
                      "caption job types require output_asset_ids.length = 0",
                      "caption result source_asset_id must be one of input_asset_ids"
                    ]
                  }
                }
              },
              "required": [
                "id",
                "type",
                "state",
                "created_at",
                "updated_at",
                "item_count",
                "completed_item_count",
                "failed_item_count",
                "billing"
              ],
              "x-joip-cross-field-rules": [
                "completed_item_count <= item_count",
                "failed_item_count <= item_count",
                "completed_item_count + failed_item_count <= item_count",
                "terminal state requires completed_at; nonterminal state forbids completed_at",
                "completed state requires completed_item_count = item_count and failed_item_count = 0",
                "partially_completed state requires completed_item_count > 0, failed_item_count > 0, and their sum = item_count",
                "failed state requires failed_item_count = item_count and completed_item_count = 0",
                "redacted state requires completed_item_count + failed_item_count = item_count",
                "terminal state requires settled_credits + released_credits = reserved_credits",
                "items, when present, belong to this job (job_id = id, job_type = type), are in ascending index order, and number at most item_count"
              ]
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 16,
                "maxLength": 1024,
                "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "has_more"
        ]
      },
      "pagination_query": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "cursor": {
            "type": "string",
            "minLength": 16,
            "maxLength": 1024,
            "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 25,
            "x-joip-wire-normalization": [
              "canonical base-10 integer query string is normalized to number; arrays, floats, leading zeroes, and noncanonical forms reject"
            ]
          }
        }
      },
      "pricing_entry_page": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "feature_key": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]*$"
                },
                "display_name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "credits_per_unit": {
                  "type": "integer",
                  "minimum": 0
                },
                "unit": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "minimum_tier": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "available": {
                  "type": "boolean"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "feature_key",
                "display_name",
                "credits_per_unit",
                "unit",
                "minimum_tier",
                "available",
                "updated_at"
              ]
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 16,
                "maxLength": 1024,
                "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "has_more"
        ]
      },
      "problem_details": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599
          },
          "detail": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "instance": {
            "type": "string",
            "maxLength": 500
          },
          "code": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]*$"
          },
          "param": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_.]*$"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "request_id": {
            "type": "string",
            "pattern": "^req_[a-z0-9]{16,64}$"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code",
          "request_id"
        ]
      },
      "status": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "const": "ok",
            "type": "string"
          },
          "api_version": {
            "const": "v1",
            "type": "string"
          },
          "environment": {
            "const": "live",
            "type": "string"
          },
          "time": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "status",
          "api_version",
          "environment",
          "time"
        ]
      },
      "webhook_event": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "job.queued",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "const": "queued",
                    "type": "string"
                  },
                  "asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "state",
                  "asset_ids",
                  "billing"
                ],
                "x-joip-cross-field-rules": [
                  "terminal state requires settled_credits + released_credits = reserved_credits"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "job.processing",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "dispatching",
                      "submitted",
                      "polling",
                      "processing"
                    ]
                  },
                  "asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "state",
                  "asset_ids",
                  "billing"
                ],
                "x-joip-cross-field-rules": [
                  "terminal state requires settled_credits + released_credits = reserved_credits"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "job.needs_review",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "const": "needs_review",
                    "type": "string"
                  },
                  "asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "state",
                  "asset_ids",
                  "billing"
                ],
                "x-joip-cross-field-rules": [
                  "terminal state requires settled_credits + released_credits = reserved_credits"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "job.completed",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "const": "completed",
                    "type": "string"
                  },
                  "asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "state",
                  "asset_ids",
                  "billing"
                ],
                "x-joip-cross-field-rules": [
                  "terminal state requires settled_credits + released_credits = reserved_credits"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "job.partially_completed",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "const": "partially_completed",
                    "type": "string"
                  },
                  "asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "state",
                  "asset_ids",
                  "billing"
                ],
                "x-joip-cross-field-rules": [
                  "terminal state requires settled_credits + released_credits = reserved_credits"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "job.failed",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "const": "failed",
                    "type": "string"
                  },
                  "asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "state",
                  "asset_ids",
                  "billing"
                ],
                "x-joip-cross-field-rules": [
                  "terminal state requires settled_credits + released_credits = reserved_credits"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "job.redacted",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "state": {
                    "const": "redacted",
                    "type": "string"
                  },
                  "asset_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "state",
                  "asset_ids",
                  "billing"
                ],
                "x-joip-cross-field-rules": [
                  "terminal state requires settled_credits + released_credits = reserved_credits"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "billing.reserved",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "billing"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "billing.settled",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "billing"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "billing.released",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "item_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billing": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "reserved_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "settled_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "released_credits": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "currency": {
                        "const": "credits",
                        "type": "string"
                      }
                    },
                    "required": [
                      "reserved_credits",
                      "settled_credits",
                      "released_credits",
                      "currency"
                    ],
                    "x-joip-cross-field-rules": [
                      "settled_credits + released_credits <= reserved_credits"
                    ]
                  }
                },
                "required": [
                  "job_id",
                  "item_id",
                  "billing"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^evt_[a-z0-9]{16,64}$"
              },
              "api_version": {
                "const": "v1",
                "type": "string"
              },
              "event_version": {
                "const": 1,
                "type": "number"
              },
              "type": {
                "const": "credits.low_balance",
                "type": "string"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "total_credits": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reserved_credits": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "available_credits": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "threshold_credits": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "total_credits",
                  "reserved_credits",
                  "available_credits",
                  "threshold_credits"
                ],
                "x-joip-cross-field-rules": [
                  "reserved_credits <= total_credits",
                  "available_credits = total_credits - reserved_credits",
                  "available_credits <= threshold_credits"
                ]
              }
            },
            "required": [
              "id",
              "api_version",
              "event_version",
              "type",
              "created_at",
              "data"
            ]
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      }
    }
  },
  "x-joip-api-key-scopes": [
    {
      "key": "account:read",
      "description": "Read the API account summary."
    },
    {
      "key": "credits:read",
      "description": "Read total, reserved, and available credits."
    },
    {
      "key": "pricing:read",
      "description": "Read current public feature prices."
    },
    {
      "key": "jobs:read",
      "description": "Read jobs, items, and billing receipts."
    },
    {
      "key": "jobs:redact",
      "description": "Redact terminal jobs."
    },
    {
      "key": "assets:read",
      "description": "Read and download API Library assets."
    },
    {
      "key": "assets:write",
      "description": "Upload, import, promote, and delete API Library assets."
    },
    {
      "key": "shares:write",
      "description": "Create and revoke asset share links."
    },
    {
      "key": "captions:write",
      "description": "Create caption generation and rewrite jobs."
    },
    {
      "key": "censor:read",
      "description": "Read censor configuration resources."
    },
    {
      "key": "censor:write",
      "description": "Create censor jobs and manage owned configuration."
    },
    {
      "key": "babecock:write",
      "description": "Create BabeCock generation and remix jobs."
    },
    {
      "key": "undress:write",
      "description": "Create Undress generation jobs."
    },
    {
      "key": "sessions:read",
      "description": "Read session metadata only."
    },
    {
      "key": "sessions:write",
      "description": "Create, update, and delete session metadata."
    },
    {
      "key": "sessions:share",
      "description": "Create and revoke session share links."
    },
    {
      "key": "webhooks:read",
      "description": "Read webhook endpoints and delivery metadata."
    },
    {
      "key": "webhooks:write",
      "description": "Manage webhook endpoints, secrets, tests, and replays."
    }
  ],
  "x-joip-idempotency-semantics": {
    "namespace": [
      "account_id",
      "method",
      "canonical_route",
      "client_key"
    ],
    "payload_fingerprint": "sha256_canonical_json",
    "payload_mismatch_status": 409,
    "retained_across_key_rotation": true,
    "replay": "original_status_and_resource",
    "retention": {
      "nonterminal": "until_terminal",
      "terminal_minimum_hours": 24
    }
  },
  "x-joip-held-job-states": [
    "needs_review"
  ],
  "x-joip-held-item-states": [
    "needs_review"
  ],
  "x-joip-terminal-job-states": [
    "completed",
    "partially_completed",
    "failed",
    "redacted"
  ],
  "x-joip-error-codes": [
    {
      "code": "method_not_allowed",
      "status": 405,
      "title": "Method not allowed",
      "retryable": false,
      "description": "The HTTP method is not allowed on this route. Metadata routes accept only GET and HEAD, and preflight requests are refused."
    },
    {
      "code": "browser_access_not_allowed",
      "status": 403,
      "title": "Browser access not allowed",
      "retryable": false,
      "description": "The request carried an Origin header. The API serves server-side clients only; call it from your backend."
    },
    {
      "code": "session_auth_not_allowed",
      "status": 401,
      "title": "Session authentication not allowed",
      "retryable": false,
      "description": "The request carried a Cookie header at the edge. Joip web sessions never authenticate API requests."
    },
    {
      "code": "cookie_not_allowed",
      "status": 401,
      "title": "Cookie authentication not allowed",
      "retryable": false,
      "description": "The request reached the API with Cookie credentials. Remove the Cookie header and authenticate with a Bearer API key."
    },
    {
      "code": "json_required",
      "status": 415,
      "title": "JSON body required",
      "retryable": false,
      "description": "Request bodies must be sent with Content-Type: application/json."
    },
    {
      "code": "invalid_json",
      "status": 400,
      "title": "Invalid JSON",
      "retryable": false,
      "description": "The request body is not valid JSON."
    },
    {
      "code": "invalid_content_length",
      "status": 400,
      "title": "Invalid Content-Length",
      "retryable": false,
      "description": "The Content-Length header must be a non-negative integer."
    },
    {
      "code": "request_too_large",
      "status": 413,
      "title": "Request too large",
      "retryable": false,
      "description": "JSON request bodies cannot exceed 1 MiB."
    },
    {
      "code": "not_found",
      "status": 404,
      "title": "Not found",
      "retryable": false,
      "description": "No API route exists at this path. Check the path against the OpenAPI document."
    },
    {
      "code": "route_not_available",
      "status": 404,
      "title": "Route not available",
      "retryable": false,
      "description": "This operation is not part of public API v1. Only the operations in the OpenAPI document are live."
    },
    {
      "code": "invalid_api_key",
      "status": 401,
      "title": "Invalid API key",
      "retryable": false,
      "description": "The Bearer credential is missing, malformed, unknown, expired, or revoked. Send Authorization: Bearer joip_live_..."
    },
    {
      "code": "insufficient_scope",
      "status": 403,
      "title": "Insufficient scope",
      "retryable": false,
      "description": "The API key does not grant the scope this operation requires. Issue a key with the scope listed on the operation."
    },
    {
      "code": "ip_not_allowed",
      "status": 403,
      "title": "IP address not allowed",
      "retryable": false,
      "description": "The API key has an IP allowlist and the calling address is not on it."
    },
    {
      "code": "invalid_allowed_ips",
      "status": 400,
      "title": "Invalid allowed IP configuration",
      "retryable": false,
      "description": "The API key's stored IP allowlist cannot be evaluated. Revoke the key and issue a new one."
    },
    {
      "code": "invalid_forwarded_address",
      "status": 400,
      "title": "Invalid forwarded address",
      "retryable": false,
      "description": "The client address forwarded by the Joip edge could not be verified. Send one request per connection without your own forwarding headers."
    },
    {
      "code": "api_account_suspended",
      "status": 403,
      "title": "API access suspended",
      "retryable": false,
      "description": "The Joip account that owns this key is inactive or unavailable."
    },
    {
      "code": "account_not_found",
      "status": 404,
      "title": "Account not found",
      "retryable": false,
      "description": "The Joip account for this key no longer exists."
    },
    {
      "code": "credits_not_found",
      "status": 404,
      "title": "Credit balance not found",
      "retryable": false,
      "description": "The account has no credit balance yet. Sign in to Joip once to create it."
    },
    {
      "code": "invalid_request",
      "status": 400,
      "title": "Invalid request",
      "retryable": false,
      "description": "The JSON body failed validation. `detail` names the failing field and `param` the top-level field."
    },
    {
      "code": "invalid_query",
      "status": 400,
      "title": "Invalid query parameter",
      "retryable": false,
      "description": "A query parameter is unknown or has an invalid value. `param` names the parameter."
    },
    {
      "code": "invalid_path",
      "status": 400,
      "title": "Invalid path parameter",
      "retryable": false,
      "description": "A path parameter is malformed, for example a job_id that is not a UUID."
    },
    {
      "code": "invalid_cursor",
      "status": 400,
      "title": "Invalid cursor",
      "retryable": false,
      "description": "The pagination cursor is malformed, tampered with, or belongs to another list. Pass next_cursor back unchanged."
    },
    {
      "code": "invalid_idempotency_key",
      "status": 400,
      "title": "Invalid idempotency key",
      "retryable": false,
      "description": "The Idempotency-Key header is missing or is not 8 to 255 characters long."
    },
    {
      "code": "media_unavailable",
      "status": 400,
      "title": "Media unavailable",
      "retryable": false,
      "description": "A media URL does not point to a publicly reachable HTTPS host. Private, internal, and unresolvable hosts are refused before any credits are reserved."
    },
    {
      "code": "job_not_found",
      "status": 404,
      "title": "Job not found",
      "retryable": false,
      "description": "No job with this id exists for the account that owns the key."
    },
    {
      "code": "idempotency_conflict",
      "status": 409,
      "title": "Idempotency key conflict",
      "retryable": false,
      "description": "This Idempotency-Key was already used with a different request body. Use a new key for a new request."
    },
    {
      "code": "idempotency_in_progress",
      "status": 409,
      "title": "Request still being accepted",
      "retryable": true,
      "description": "A request with this Idempotency-Key is still being accepted. Retry shortly with the same key to receive the original job."
    },
    {
      "code": "insufficient_credits",
      "status": 402,
      "title": "Insufficient credits",
      "retryable": false,
      "description": "The account does not have enough available credits for this request. Nothing was reserved."
    },
    {
      "code": "rate_limit_exceeded",
      "status": 429,
      "title": "Rate limit exceeded",
      "retryable": true,
      "description": "The key sent more than 120 requests this minute, or the address sent too many invalid keys. Wait for Retry-After seconds."
    },
    {
      "code": "admission_unavailable",
      "status": 429,
      "title": "Job admission limit reached",
      "retryable": true,
      "description": "The account reached its hourly job or media-item allowance. Nothing was reserved; retry after Retry-After seconds with the same Idempotency-Key."
    },
    {
      "code": "pricing_unavailable",
      "status": 503,
      "title": "Pricing unavailable",
      "retryable": true,
      "description": "Server-authoritative caption pricing could not be resolved. Nothing was reserved."
    },
    {
      "code": "queue_unavailable",
      "status": 503,
      "title": "Queue unavailable",
      "retryable": true,
      "description": "The job was recorded but could not be queued. Retry with the same Idempotency-Key to resume it."
    },
    {
      "code": "api_ingress_unavailable",
      "status": 503,
      "title": "API ingress unavailable",
      "retryable": true,
      "description": "The API service could not verify the request came through the Joip edge."
    },
    {
      "code": "api_not_configured",
      "status": 503,
      "title": "API not configured",
      "retryable": true,
      "description": "The API edge is not configured to reach the API service."
    },
    {
      "code": "invalid_acceptance_contract",
      "status": 502,
      "title": "Invalid acceptance response",
      "retryable": true,
      "description": "The API service returned an incomplete job acceptance. Retry with the same Idempotency-Key."
    },
    {
      "code": "invalid_upstream_response",
      "status": 502,
      "title": "Invalid upstream response",
      "retryable": true,
      "description": "The API service returned a response the edge could not pass on."
    },
    {
      "code": "internal_error",
      "status": 500,
      "title": "Internal error",
      "retryable": true,
      "description": "Joip could not complete the request. Retry with backoff, reusing the Idempotency-Key for job creation."
    }
  ]
}
