{
  "openapi": "3.1.0",
  "info": {
    "title": "KardMesh API",
    "version": "1.0.0",
    "description": "Convert 2D character images into rigged 3D hair card meshes (.OBJ, .GLB, and .VRM with spring bones) using HairDeck GPU inference.",
    "contact": {
      "name": "KardMesh Support",
      "email": "support@kardmesh.com",
      "url": "https://kardmesh.com"
    }
  },
  "servers": [
    {
      "url": "https://api.kardmesh.com"
    }
  ],
  "x-service-info": {
    "categories": [
      "ai",
      "3d-generation",
      "media",
      "developer-tools"
    ],
    "docs": {
      "homepage": "https://kardmesh.com",
      "llms": "https://kardmesh.com/llms.txt",
      "llmsFull": "https://kardmesh.com/llms-full.txt"
    }
  },
  "paths": {
    "/health": {
      "get": {
        "summary": "Health check",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1": {
      "get": {
        "summary": "x402 pay-per-variation capability and payment challenge",
        "operationId": "probeX402Payment",
        "x-payment-info": {
          "intent": "charge",
          "method": "tempo",
          "amount": "350000",
          "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "description": "Pay-per-variation 3D hair card generation (0.35 USDC on Base via x402)"
        },
        "responses": {
          "200": {
            "description": "Payment verified",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "endpoint": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 challenge)"
          }
        }
      }
    },
    "/x402/jobs": {
      "post": {
        "summary": "Submit a 2D-to-3D hair card generation job with x402 payment",
        "operationId": "createX402Job",
        "x-payment-info": {
          "offers": [
            {
              "intent": "charge",
              "method": "tempo",
              "amount": "350000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "Generate 3D hair cards (.OBJ, .GLB, .VRM) per variation via x402 USDC on Base"
            }
          ]
        },
        "responses": {
          "202": {
            "description": "Job accepted for GPU inference",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment Required (x402 PAYMENT-REQUIRED header)"
          }
        }
      }
    },
    "/jobs": {
      "post": {
        "summary": "Submit a 2D-to-3D hair card generation job using credits or guest trial",
        "operationId": "createJob",
        "x-payment-info": {
          "intent": "session",
          "method": "card",
          "amount": "800",
          "currency": "EUR",
          "description": "1 credit per variation (credit packs start at €8 for 25 credits via Paddle)"
        },
        "responses": {
          "202": {
            "description": "Job accepted for GPU inference",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits"
          }
        }
      }
    },
    "/jobs/{id}/status": {
      "get": {
        "summary": "Poll 3D hair generation job status",
        "operationId": "getJobStatus",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job status payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payments/checkout": {
      "post": {
        "summary": "Create a Paddle checkout session for credits or plans",
        "operationId": "createCheckout",
        "x-payment-info": {
          "intent": "charge",
          "method": "card",
          "amount": "800",
          "currency": "EUR",
          "description": "KardMesh credit pack or subscription checkout via Paddle Merchant of Record"
        },
        "responses": {
          "200": {
            "description": "Checkout URL and transaction ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "transactionId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    }
  }
}