{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/spicyapi/json-schema/spicyapi-public-catalog-envelope-schema.json",
  "title": "PublicCatalogEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/spicyapi-models-api-openapi.yml#/components/schemas/PublicCatalogEnvelope",
  "allOf": [
    {
      "$ref": "#/$defs/EnvelopeBase"
    },
    {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "code": {
          "type": "integer",
          "const": 200
        },
        "msg": {
          "type": "string",
          "const": "success"
        },
        "data": {
          "$ref": "#/$defs/PublicCatalogList"
        }
      }
    }
  ],
  "$defs": {
    "EnvelopeBase": {
      "type": "object",
      "required": [
        "code",
        "msg",
        "request_id"
      ],
      "properties": {
        "code": {
          "type": "integer"
        },
        "msg": {
          "type": "string"
        },
        "request_id": {
          "type": "string",
          "description": "Correlation identifier. Include it in support requests."
        }
      }
    },
    "PublicCatalogItem": {
      "type": "object",
      "description": "Evaluation view of one endpoint. Additional presentation fields are returned and documented in console-openapi.yaml.",
      "required": [
        "model",
        "slug",
        "family",
        "displayName",
        "provider",
        "modality",
        "tasks",
        "status",
        "callable"
      ],
      "properties": {
        "model": {
          "type": "string",
          "description": "Same value as `slug`, under the field name `/api/v1/models` uses. This is the value `createTask.model` takes."
        },
        "slug": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Previously published identifiers that still resolve to this endpoint."
        },
        "family": {
          "type": "string"
        },
        "familyPageSlug": {
          "type": "string"
        },
        "familyDisplayName": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "provider": {
          "type": "string",
          "description": "The model's creator, for example `ByteDance`. Never an execution channel."
        },
        "modality": {
          "type": "string",
          "enum": [
            "image",
            "video",
            "audio",
            "text"
          ]
        },
        "tasks": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Same values and meaning as APIModel.tasks, including the `edit` / `image-to-image` split."
        },
        "mature": {
          "type": "boolean"
        },
        "policyTier": {
          "type": "string",
          "enum": [
            "unrestricted",
            "borderline",
            "softened",
            "filtered",
            "unspecified"
          ],
          "description": "Same values and meaning as APIModel.policyTier. Treat the set as open."
        },
        "toolkit": {
          "type": "string",
          "enum": [
            "subject-swap",
            "studio-tools"
          ],
          "description": "Which toolkit family this model belongs to (subject-swap for identity swaps; studio-tools for single-purpose image and video tools such as background removal or upscaling). Informational classification for catalogue grouping only; it does not participate in routing",
          "pricing or authorization. Absent when the model is not part of a toolkit.": null
        },
        "async": {
          "type": "boolean"
        },
        "status": {
          "type": "string",
          "enum": [
            "published",
            "live",
            "paused"
          ],
          "description": "Operator intent. `live` is the only status that can be callable."
        },
        "callable": {
          "type": "boolean",
          "description": "Whether a fully priced, routable execution path exists right now. A callable endpoint always has a price; an endpoint without a price is never callable."
        },
        "price": {
          "oneOf": [
            {
              "$ref": "#/$defs/PublicCatalogPrice"
            },
            {
              "type": "null"
            }
          ],
          "description": "Standard-rate starting price, or absent when the endpoint is not currently sellable. It is never reported as `0`."
        }
      }
    },
    "PublicCatalogList": {
      "type": "object",
      "required": [
        "locale",
        "items",
        "total"
      ],
      "properties": {
        "locale": {
          "type": "string",
          "description": "The locale the copy was resolved to."
        },
        "total": {
          "type": "integer"
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PublicCatalogItem"
          }
        }
      }
    },
    "PublicCatalogPrice": {
      "type": "object",
      "required": [
        "amount",
        "unit",
        "tiers"
      ],
      "properties": {
        "amount": {
          "type": "string",
          "description": "Lowest tier's unit price as a decimal string. Decimal strings, not numbers, because these values are displayed and binary floats cannot represent them exactly."
        },
        "unit": {
          "type": "string",
          "description": "Billing unit identifier, for example per_image or per_second."
        },
        "variant": {
          "type": "string",
          "description": "The tier this price belongs to; absent when the model has one tier."
        },
        "tiers": {
          "type": "integer",
          "description": "Number of currently effective tiers. Greater than one means this is a starting price."
        },
        "regularAmount": {
          "type": "string",
          "description": "Pre-discount price",
          "present only when a customer offer applies.": null
        },
        "offerLabel": {
          "type": "string"
        },
        "offerPercent": {
          "type": "string"
        },
        "offerEndsAt": {
          "type": "string",
          "format": "date-time"
        },
        "perMillionTokens": {
          "type": "object",
          "description": "Standard per-million-token prices for text models.",
          "required": [
            "input",
            "output"
          ],
          "properties": {
            "input": {
              "type": "string"
            },
            "cachedInput": {
              "type": "string"
            },
            "output": {
              "type": "string"
            },
            "cacheWrite": {
              "type": "string"
            }
          }
        },
        "listPrice": {
          "type": "object",
          "description": "The model creator's own published price, present only when ours is at least 1% lower. It is not our pre-discount price."
        },
        "variants": {
          "type": "array",
          "description": "Every priced tier of a per-second, per-image or per-request model, cheapest first (the first entry is the starting price). Absent for per-token models. `variant` is the raw tier key: a single value such as `720p`, or a compound key such as `generate_audio=false;resolution=1080p`.",
          "items": {
            "type": "object",
            "required": [
              "variant",
              "amount",
              "unit"
            ],
            "properties": {
              "variant": {
                "type": "string"
              },
              "amount": {
                "type": "string"
              },
              "regularAmount": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "listPrice": {
                "type": "object",
                "description": "This tier's own reference price, under the same rules as listPrice above."
              }
            }
          }
        }
      }
    }
  }
}