{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/letsship-ai/json-schema/letsship-ai-first-site-words-schema.json",
  "title": "FirstSiteWords",
  "description": "The words and the photo SHIP writes for a first site after it publishes the pages made from the answers.",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/letsship-ai-openapi.json#/components/schemas/FirstSiteWords",
  "type": [
    "object",
    "null"
  ],
  "properties": {
    "state": {
      "$ref": "#/$defs/FirstSiteJobState"
    },
    "attempts": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "description": "The runs so far, the first one included."
    },
    "attemptsLeft": {
      "type": "integer",
      "minimum": 0,
      "description": "How many more runs a failed job may get."
    },
    "error": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "code": {
          "$ref": "#/$defs/FirstSiteErrorCode"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "words": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "model": {
          "type": "string"
        },
        "costUsd": {
          "type": [
            "number",
            "null"
          ],
          "description": "What the call cost SHIP, as the model provider reported it."
        },
        "ms": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "model",
        "costUsd",
        "ms"
      ]
    },
    "photo": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "model": {
          "type": "string"
        },
        "costUsd": {
          "type": [
            "number",
            "null"
          ],
          "description": "What the call cost SHIP, as the model provider reported it."
        },
        "ms": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "model",
        "costUsd",
        "ms"
      ]
    },
    "commit": {
      "type": [
        "string",
        "null"
      ],
      "description": "The commit that added the words and the photo."
    },
    "updatedAt": {
      "type": "integer",
      "description": "Epoch ms."
    }
  },
  "required": [
    "state",
    "attempts",
    "attemptsLeft",
    "error",
    "words",
    "photo",
    "commit",
    "updatedAt"
  ],
  "$defs": {
    "FirstSiteErrorCode": {
      "type": "string",
      "enum": [
        "first_site_words_failed",
        "first_site_photo_failed",
        "platform_model_key_missing",
        "starter_repo_changed",
        "starter_commit_failed"
      ]
    },
    "FirstSiteJobState": {
      "type": "string",
      "enum": [
        "pending",
        "applied",
        "failed",
        "superseded"
      ]
    }
  }
}