{
  "openapi": "3.0.3",
  "info": {
    "title": "TrendSwap API",
    "description": "TrendSwap is a viral social AI video studio and motion transfer platform supporting 4 global languages (English, Spanish, Japanese, Chinese) that transforms authorized portraits into trending video clips with 100% identity preservation.\n\nThis API provides programmatic access to viral video templates, AI face swap and motion transfer video generation, portrait media management, credit balances, and the official Model Context Protocol (MCP) streamable endpoint for Zapier, Cursor, Claude Desktop, and autonomous agents.",
    "version": "1.0.0",
    "contact": {
      "name": "TrendSwap Developer Support",
      "email": "support@trendswap.app",
      "url": "https://trendswap.app"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://trendswap.app/terms-of-service"
    }
  },
  "servers": [
    {
      "url": "https://trendswap.app",
      "description": "Production Server"
    }
  ],
  "tags": [
    {
      "name": "Model Context Protocol (MCP)",
      "description": "Official Streamable HTTP MCP JSON-RPC 2.0 endpoints for Zapier and AI agents"
    },
    {
      "name": "Video Generation",
      "description": "Create, monitor, list, and manage AI template video and motion transfer tasks"
    },
    {
      "name": "Templates",
      "description": "Discover and query trending viral video choreography and meme templates"
    },
    {
      "name": "Media & Portraits",
      "description": "Upload and manage portrait reference photos and media assets"
    },
    {
      "name": "Account & Credits",
      "description": "Check user credit balances, transaction logs, and profile authorization"
    },
    {
      "name": "System",
      "description": "Operational health check and service telemetry"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "TrendSwap API Key in format: Bearer sk_... (obtain from https://trendswap.app/settings/apikeys)"
      },
      "XApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "TrendSwap API Key passed in the X-API-Key header"
      }
    },
    "schemas": {
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "burning-bridges"
          },
          "name": {
            "type": "string",
            "example": "Burning Bridges Banquet"
          },
          "title": {
            "type": "string",
            "example": "BURNING BRIDGES BANQUET"
          },
          "description": {
            "type": "string",
            "example": "One photo places you at the banquet table with viral motion choreography."
          },
          "duration": {
            "type": "integer",
            "example": 10,
            "description": "Duration in seconds"
          },
          "preview_url": {
            "type": "string",
            "format": "uri",
            "example": "https://trendswap.app/template/burning-bridges-horizontal.mp4"
          },
          "poster_url": {
            "type": "string",
            "format": "uri",
            "example": "https://trendswap.app/images/cream-knit.jpg"
          },
          "orientation": {
            "type": "string",
            "enum": [
              "vertical",
              "horizontal",
              "square",
              "both"
            ],
            "example": "vertical"
          },
          "photos_required": {
            "type": "integer",
            "example": 1
          },
          "supported_resolutions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "480p",
              "720p",
              "1080p"
            ]
          },
          "status": {
            "type": "string",
            "example": "LIVE"
          },
          "tag": {
            "type": "string",
            "example": "POPULAR"
          }
        }
      },
      "CreateJobRequest": {
        "type": "object",
        "required": [
          "template",
          "portrait_id",
          "idempotency_key"
        ],
        "properties": {
          "template": {
            "type": "string",
            "description": "Template ID (e.g. burning-bridges, bulin-47, topo-gigio, flying-tesla-roadster-ai, bby-wow-guy-ai)",
            "example": "burning-bridges"
          },
          "portrait_id": {
            "type": "string",
            "description": "ID of an uploaded portrait photo obtained from POST /api/portraits",
            "example": "port_8x92nd82la"
          },
          "secondary_portrait_id": {
            "type": "string",
            "description": "Optional second portrait ID for duo / couple templates",
            "example": "port_9y28ka91lo"
          },
          "resolution": {
            "type": "string",
            "enum": [
              "480p",
              "720p",
              "1080p"
            ],
            "default": "480p",
            "description": "Output video resolution (480p is fast & recommended for Zapier automations)"
          },
          "format": {
            "type": "string",
            "enum": [
              "vertical",
              "horizontal"
            ],
            "default": "vertical",
            "description": "Video aspect orientation (vertical 9:16 or horizontal 16:9)"
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "description": "Unique client-generated idempotency key to prevent duplicate charges",
            "example": "zap_req_89281928301"
          }
        }
      },
      "JobResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "job_01h92k8s92"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "example": 100
          },
          "video_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://cdn.trendswap.app/videos/job_01h92k8s92.mp4"
          },
          "resolution": {
            "type": "string",
            "example": "480p"
          },
          "format": {
            "type": "string",
            "example": "vertical"
          },
          "template": {
            "type": "string",
            "example": "burning-bridges"
          },
          "portrait_id": {
            "type": "string",
            "example": "port_8x92nd82la"
          },
          "error_message": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-25T12:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-25T12:01:15Z"
          }
        }
      },
      "PortraitResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 0
          },
          "data": {
            "type": "object",
            "properties": {
              "portrait_id": {
                "type": "string",
                "example": "port_8x92nd82la"
              },
              "preview_url": {
                "type": "string",
                "format": "uri",
                "example": "https://cdn.trendswap.app/portraits/port_8x92nd82la.webp"
              },
              "width": {
                "type": "integer",
                "example": 1024
              },
              "height": {
                "type": "integer",
                "example": 1024
              }
            }
          }
        }
      },
      "CreditsResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 0
          },
          "data": {
            "type": "object",
            "properties": {
              "balance": {
                "type": "integer",
                "example": 250,
                "description": "Current credits balance"
              },
              "userId": {
                "type": "string",
                "example": "usr_abc123"
              },
              "history": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "tx_123"
                    },
                    "amount": {
                      "type": "integer",
                      "example": -25
                    },
                    "reason": {
                      "type": "string",
                      "example": "Video generation job_01h92k8s92"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "UserInfoResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 0
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "usr_abc123"
              },
              "name": {
                "type": "string",
                "example": "David Lee"
              },
              "email": {
                "type": "string",
                "format": "email",
                "example": "support@trendswap.app"
              },
              "plan": {
                "type": "string",
                "enum": [
                  "none",
                  "trial",
                  "member"
                ],
                "example": "member"
              },
              "authorized": {
                "type": "boolean",
                "example": true
              },
              "trialEndsAt": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "example": "2026-11-25T00:00:00Z"
              }
            }
          }
        }
      },
      "HealthResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 0
          },
          "status": {
            "type": "string",
            "example": "ok"
          },
          "service": {
            "type": "string",
            "example": "trendswap"
          },
          "version": {
            "type": "string",
            "example": "v2.220"
          },
          "commit": {
            "type": "string",
            "example": "8b651e0"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-25T12:00:00.000Z"
          }
        }
      },
      "McpRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "example": "2.0"
          },
          "id": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "example": 1
          },
          "method": {
            "type": "string",
            "enum": [
              "tools/list",
              "tools/call",
              "initialize"
            ],
            "example": "tools/call"
          },
          "params": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "enum": [
                  "list_templates",
                  "get_credits_balance",
                  "create_generation_job",
                  "get_job_status"
                ],
                "example": "create_generation_job"
              },
              "arguments": {
                "type": "object",
                "properties": {
                  "template": {
                    "type": "string",
                    "example": "burning-bridges"
                  },
                  "image_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://images.unsplash.com/photo-1534528741775-53994a69daeb"
                  },
                  "portrait_id": {
                    "type": "string",
                    "example": "port_8x92nd82la"
                  },
                  "resolution": {
                    "type": "string",
                    "enum": [
                      "480p",
                      "720p",
                      "1080p"
                    ],
                    "default": "480p"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "vertical",
                      "horizontal"
                    ],
                    "default": "vertical"
                  },
                  "idempotency_key": {
                    "type": "string",
                    "example": "zapier_12345"
                  }
                }
              }
            }
          }
        }
      },
      "McpRpcResponse": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "type": "string",
            "example": "2.0"
          },
          "id": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "example": 1
          },
          "result": {
            "type": "object",
            "properties": {
              "content": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "example": "text"
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                }
              },
              "structuredContent": {
                "type": "object"
              },
              "isError": {
                "type": "boolean",
                "example": false
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 1
          },
          "message": {
            "type": "string",
            "example": "Invalid or expired API Key"
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "XApiKeyAuth": []
    }
  ],
  "paths": {
    "/api/mcp": {
      "post": {
        "tags": [
          "Model Context Protocol (MCP)"
        ],
        "summary": "Model Context Protocol (MCP) Streamable HTTP Endpoint",
        "description": "Official Streamable HTTP MCP JSON-RPC 2.0 endpoint for TrendSwap. Powers Zapier, Claude Desktop, Cursor, and AI agents. Exposes tools:\n- `list_templates`: List available viral video templates (no auth required)\n- `get_credits_balance`: Query remaining credits (requires Bearer sk_...)\n- `create_generation_job`: Submit face swap video render job (requires Bearer sk_...)\n- `get_job_status`: Poll video render status and output URL (requires Bearer sk_...)",
        "operationId": "callMcp",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpRpcRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful JSON-RPC Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpRpcResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/templates": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "List Viral Video Templates",
        "description": "Returns all currently active viral video choreography and motion transfer templates on TrendSwap, including durations, preview video URLs, and supported aspect ratios.",
        "operationId": "listTemplates",
        "security": [],
        "responses": {
          "200": {
            "description": "List of viral video templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "templates": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Template"
                          }
                        },
                        "total": {
                          "type": "integer",
                          "example": 25
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/generation/jobs": {
      "post": {
        "tags": [
          "Video Generation"
        ],
        "summary": "Create Video Generation Job",
        "description": "Initiates an asynchronous AI template video (motion transfer) job using a portrait photo and a viral template. Requires an active API Key with sufficient credits.",
        "operationId": "createGenerationJob",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "job": {
                          "$ref": "#/components/schemas/JobResponse"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (missing template, invalid portrait ID, or resolution)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid API Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "GPU cluster temporarily busy - retry with exponential backoff",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Video Generation"
        ],
        "summary": "List User Generation Jobs",
        "description": "Returns a paginated list of recent video generation jobs submitted by the authenticated account.",
        "operationId": "listGenerationJobs",
        "responses": {
          "200": {
            "description": "List of generation jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "jobs": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/JobResponse"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/generation/jobs/{id}": {
      "get": {
        "tags": [
          "Video Generation"
        ],
        "summary": "Get Job Status & Video Result",
        "description": "Retrieves the real-time execution status and progress of a video generation job. Once status is `completed`, `video_url` contains the downloadable 9:16 or 16:9 MP4 file.",
        "operationId": "getGenerationJob",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job ID returned by POST /api/generation/jobs (e.g. job_01h92k8s92)",
            "schema": {
              "type": "string",
              "example": "job_01h92k8s92"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job status details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "job": {
                          "$ref": "#/components/schemas/JobResponse"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Video job not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Video Generation"
        ],
        "summary": "Delete Generation Job",
        "description": "Deletes a video generation job record and associated temporary assets.",
        "operationId": "deleteGenerationJob",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job ID to delete",
            "schema": {
              "type": "string",
              "example": "job_01h92k8s92"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "example": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Job not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portraits": {
      "post": {
        "tags": [
          "Media & Portraits"
        ],
        "summary": "Upload Portrait Image",
        "description": "Uploads a front-facing portrait photo (JPEG, PNG, WebP; max 15MB) to secure cloud storage. Returns a `portrait_id` that can be passed to `POST /api/generation/jobs`.",
        "operationId": "uploadPortrait",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "files"
                ],
                "properties": {
                  "files": {
                    "type": "string",
                    "format": "binary",
                    "description": "Binary image file (JPEG, PNG, WebP)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Portrait uploaded successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortraitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid image format or dimensions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Image file exceeds 15MB limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portraits/{id}": {
      "get": {
        "tags": [
          "Media & Portraits"
        ],
        "summary": "Get Portrait Metadata",
        "description": "Retrieves metadata, preview URL, and dimensions of an uploaded portrait photo.",
        "operationId": "getPortrait",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Portrait ID (e.g. port_8x92nd82la)",
            "schema": {
              "type": "string",
              "example": "port_8x92nd82la"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Portrait metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortraitResponse"
                }
              }
            }
          },
          "404": {
            "description": "Portrait not found or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Media & Portraits"
        ],
        "summary": "Delete Portrait Photo",
        "description": "Deletes an uploaded portrait from storage. Fails with 409 if currently used by an active generation job.",
        "operationId": "deletePortrait",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Portrait ID to delete",
            "schema": {
              "type": "string",
              "example": "port_8x92nd82la"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Portrait deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "example": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Portrait is currently locked by an active generation job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/storage/upload-image": {
      "post": {
        "tags": [
          "Media & Portraits"
        ],
        "summary": "Upload General Image Asset",
        "description": "Direct multipart upload endpoint for image assets (JPEG, PNG, WebP, GIF, HEIC; max 10MB per file).",
        "operationId": "uploadImageAsset",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "files"
                ],
                "properties": {
                  "files": {
                    "type": "string",
                    "format": "binary",
                    "description": "Binary image file"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image uploaded successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 0
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "example": "https://cdn.trendswap.app/images/upload_abc.jpg"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid image format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/credits": {
      "get": {
        "tags": [
          "Account & Credits"
        ],
        "summary": "Get Credits Balance & History",
        "description": "Retrieves the current available credit balance and recent credit ledger transactions for the authenticated user or API Key.",
        "operationId": "getCredits",
        "responses": {
          "200": {
            "description": "Credits balance details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/user/info": {
      "get": {
        "tags": [
          "Account & Credits"
        ],
        "summary": "Get Current User Profile",
        "description": "Returns identity, email, tier membership plan, and authorization status of the authenticated account.",
        "operationId": "getUserInfo",
        "responses": {
          "200": {
            "description": "User profile information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInfoResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Health & Telemetry Check",
        "description": "Public health check endpoint returning service operational status, current production version, and deployment commit timestamp.",
        "operationId": "getHealth",
        "security": [],
        "responses": {
          "200": {
            "description": "Service is healthy and operational",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    }
  }
}
