{
  "components": {
    "securitySchemes": {
      "AiApiKey": {
        "description": "Globale integrator-sleutel (Custom GPT / server-side integratie).",
        "in": "header",
        "name": "X-Printics-AI-Key",
        "type": "apiKey"
      },
      "AssistToken": {
        "description": "Sessie-token van de gebruikers-hulplink. Alleen endpoints op eigen session_id. Upload via https://printics.nl/ai-hulp/<token>.",
        "in": "header",
        "name": "X-Printics-Assist-Token",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "Externe API voor AI-chatbots die 3D-printbestellingen voorbereiden. Gebruikers kunnen bestanden uploaden via de hulplink /ai-hulp/ (niet via de chat). Sessie-scoped auth: X-Printics-Assist-Token (van de hulppagina). Integrator-auth: X-Printics-AI-Key.",
    "title": "Printics AI-assistent API",
    "version": "1.7.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/catalog": {
      "get": {
        "operationId": "getCatalog",
        "responses": {
          "200": {
            "description": "Catalog"
          }
        },
        "summary": "Materialen en printinstellingen (sanitized)"
      }
    },
    "/sessions": {
      "post": {
        "operationId": "createSession",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "conversation_key": {
                    "type": "string"
                  },
                  "force_new": {
                    "type": "boolean"
                  },
                  "provider": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sessie aangemaakt of hervat"
          }
        },
        "security": [
          {
            "AiApiKey": []
          }
        ],
        "summary": "Start of hervat bot-sessie (alleen integrator-key)"
      }
    },
    "/sessions/{session_id}/cart": {
      "get": {
        "operationId": "getCart",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cart"
          }
        },
        "summary": "Live winkelwagen (staffel, productietijd)"
      }
    },
    "/sessions/{session_id}/cart-summary": {
      "get": {
        "operationId": "cartSummary",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Samenvatting"
          }
        },
        "summary": "Staging preview v\u00f3\u00f3r finalize"
      }
    },
    "/sessions/{session_id}/files": {
      "get": {
        "operationId": "listFiles",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bestandslijst"
          }
        },
        "summary": "Lijst ge\u00fcploade bestanden (metadata, geen STL-bytes)"
      },
      "post": {
        "operationId": "uploadFile",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bestand ge\u00fcpload"
          }
        },
        "summary": "Upload STL/OBJ (integrator; gebruikers uploaden via /ai-hulp/)"
      }
    },
    "/sessions/{session_id}/files/{file_id}/images": {
      "get": {
        "operationId": "listFileImages",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Afbeeldingslijst met URL's"
          }
        },
        "summary": "PNG-weergaven (perspectief, aanzichten, werktekening) voor AI-vision"
      }
    },
    "/sessions/{session_id}/files/{file_id}/images/{image_key}": {
      "get": {
        "operationId": "getFileImage",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "image_key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PNG image"
          }
        },
        "summary": "Serveer \u00e9\u00e9n PNG (assist_token ook als query param voor vision-tools)"
      }
    },
    "/sessions/{session_id}/files/{file_id}/slice": {
      "post": {
        "operationId": "startSlice",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Slice gestart"
          }
        },
        "summary": "Start slice-job"
      }
    },
    "/sessions/{session_id}/files/{file_id}/status": {
      "get": {
        "operationId": "sliceStatus",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "file_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status"
          }
        },
        "summary": "Slice-voortgang"
      }
    },
    "/sessions/{session_id}/finalize": {
      "post": {
        "operationId": "finalize",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Finalize"
          }
        },
        "summary": "Maak cart + deelbare link"
      }
    },
    "/sessions/{session_id}/items": {
      "post": {
        "operationId": "addItem",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Item toegevoegd"
          }
        },
        "summary": "Voeg printregel toe (qty=1)"
      }
    },
    "/sessions/{session_id}/price": {
      "post": {
        "operationId": "calculatePrice",
        "parameters": [
          {
            "in": "path",
            "name": "session_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Prijs"
          }
        },
        "summary": "Indicatieve prijs per stuk"
      }
    }
  },
  "security": [
    {
      "AiApiKey": []
    },
    {
      "AssistToken": []
    }
  ],
  "servers": [
    {
      "url": "https://printics.nl/api/external/ai"
    }
  ]
}
