{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openmayhem-ai/json-schema/openmayhem-ai-chat-completion-schema.json",
  "title": "ChatCompletion",
  "description": "OpenAI chat completion plus OpenMayhem billing fields.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openmayhem-ai-openapi.json#/components/schemas/ChatCompletion",
  "type": "object",
  "properties": {
    "choices": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "prompt_tokens": {
          "type": "integer"
        },
        "completion_tokens": {
          "type": "integer"
        },
        "total_tokens": {
          "type": "integer"
        },
        "cost": {
          "type": "string",
          "description": "Exact settled cost in USD."
        }
      }
    },
    "openmayhem": {
      "type": "object",
      "properties": {
        "request_id": {
          "type": "string"
        },
        "receipt": {
          "type": "object",
          "properties": {
            "session_id": {
              "type": "string"
            },
            "sequence": {
              "type": "integer"
            },
            "final": {
              "type": "boolean"
            },
            "verified": {
              "type": "boolean"
            }
          }
        }
      }
    }
  }
}