{
  "openapi": "3.0.3",
  "info": {
    "title": "Strada Works API",
    "version": "1.0.0",
    "description": "Turn vehicle photos into studio-ready images. Guide: https://strada.works/developers"
  },
  "servers": [{ "url": "https://mqmdvxzunvnxhdcdobib.supabase.co/functions/v1/public-api/v1" }],
  "security": [{ "bearerAuth": [] }],
  "components": {
    "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "description": "strada_live_... key from My Account" } }
  },
  "paths": {
    "/me": {
      "get": { "summary": "Test connection / account info", "operationId": "getMe", "responses": { "200": { "description": "Account email and tokens remaining" } } }
    },
    "/presets": {
      "get": { "summary": "List style presets", "operationId": "listPresets", "responses": { "200": { "description": "List of presets" } } }
    },
    "/transform": {
      "post": {
        "summary": "Transform a car photo",
        "operationId": "transformPhoto",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["image_url", "preset"],
                "properties": {
                  "image_url": { "type": "string", "format": "uri" },
                  "preset": { "type": "string" },
                  "model": { "type": "string", "enum": ["HD", "UHD"] },
                  "logo_url": { "type": "string", "format": "uri" },
                  "logo_position": { "type": "string" },
                  "aspect_ratio": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Finished image (result_url), tokens_used, tokens_remaining" },
          "401": { "description": "Invalid API key" },
          "402": { "description": "Not enough tokens" },
          "429": { "description": "Rate limited" }
        }
      }
    }
  }
}
