{
  "openapi": "3.1.0",
  "info": {
    "title": "Abrasor API",
    "version": "1.0.0",
    "summary": "Grinding articles, currency rates, the grinding calculator catalogue and the grinding wheel marking decoder.",
    "description": "The Abrasor API is the JSON API behind the Abrasor grinding app (https://abrasor.com). This specification covers the operations that are useful outside the app.\n\n**Public operations** need no key: the grinding blog (articles and categories) and the currency rates used by the cost calculators.\n\n**Member operations** need an Abrasor account. Send `Authorization: Bearer <token>`, where the token comes from `signIn` (POST /auth/login). Only sign in with an account whose owner asked you to act for them.\n\n**Responses** are JSON in an envelope: `{\"ok\": true, \"data\": ...}` on success and `{\"ok\": false, \"error\": \"message\"}` on failure, with a matching HTTP status (400, 401, 403, 404, 429, 503).\n\n**Limits**: sign-in allows 10 attempts per 15 minutes per IP address. Decoding a marking that has not been decoded before is limited to 30 per hour per IP address and 20 per hour per member; markings already decoded are answered from a cache.\n\nFor what Abrasor is and when to use it, see https://abrasor.com/llms.txt. Every website page is also available as Markdown with `Accept: text/markdown`.",
    "termsOfService": "https://abrasor.com/terms",
    "contact": {
      "name": "Abrasor",
      "email": "info@abrasor.com",
      "url": "https://abrasor.com/developers"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://abrasor.com/terms"
    }
  },
  "externalDocs": {
    "description": "Abrasor API docs",
    "url": "https://abrasor.com/developers"
  },
  "servers": [
    {
      "url": "https://abrasor.com/api/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Blog",
      "description": "Grinding articles from the Abrasor blog. Public."
    },
    {
      "name": "Currency",
      "description": "Currency rates for the cost calculators. Public."
    },
    {
      "name": "Account",
      "description": "Sign in to get a bearer token for member operations."
    },
    {
      "name": "Calculators",
      "description": "The grinding calculator catalogue: inputs, units, limits and formulas. The free speed calculators are public; the rest need a Premium or Enterprise account."
    },
    {
      "name": "Wheel Decoder",
      "description": "Read a grinding wheel marking (ISO 525 and maker formats). Members only."
    }
  ],
  "paths": {
    "/blog/articles": {
      "get": {
        "operationId": "listBlogArticles",
        "summary": "List published blog articles",
        "description": "Published grinding articles, newest first, as summaries without the article body. Use getBlogArticleBySlug for one article, or read the full text without signing in at https://abrasor.com/blog/{slug} (HTML, or Markdown with Accept: text/markdown).",
        "tags": [
          "Blog"
        ],
        "security": [],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number, starting at 1.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Articles per page.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 12
            }
          },
          {
            "name": "category",
            "in": "query",
            "description": "Only articles in this category, by its slug (see listBlogCategories).",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$",
              "examples": [
                "surface-grinding"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of article summaries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "articles",
                        "total",
                        "page",
                        "pages"
                      ],
                      "properties": {
                        "articles": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/BlogArticleSummary"
                          }
                        },
                        "total": {
                          "type": "integer",
                          "description": "Published articles that match."
                        },
                        "page": {
                          "type": "integer",
                          "description": "This page number."
                        },
                        "pages": {
                          "type": "integer",
                          "description": "Number of pages at this limit."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/blog/articles/slug/{slug}": {
      "get": {
        "operationId": "getBlogArticleBySlug",
        "summary": "Get one blog article by its slug",
        "description": "One published article. Without a bearer token the body is left out (teaser_only is true); the full article is public at https://abrasor.com/blog/{slug}. Each call counts as a view of the article.",
        "tags": [
          "Blog"
        ],
        "security": [
          {},
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "description": "The article's slug, as in https://abrasor.com/blog/{slug}.",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9-]{1,200}$",
              "examples": [
                "the-depth-divide-creep-feed-vs-reciprocating-grinding-explained"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The article.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/BlogArticle"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/blog/categories": {
      "get": {
        "operationId": "listBlogCategories",
        "summary": "List blog categories",
        "description": "Categories that hold at least one published article, with how many each holds.",
        "tags": [
          "Blog"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The categories, in display order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlogCategory"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calculators/fx-rates": {
      "get": {
        "operationId": "getCurrencyRates",
        "summary": "Get currency rates per US dollar",
        "description": "Reference rates from the European Central Bank, refreshed nightly, as units of each currency per 1 US dollar. The Abrasor cost and ROI calculators use them to show costs in 17 currencies.",
        "tags": [
          "Currency"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The latest rates.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/CurrencyRates"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calculators/guest": {
      "get": {
        "operationId": "listGuestCalculators",
        "summary": "List the free grinding calculators",
        "description": "Every calculator category for visitors without an account. The free calculators (wheel surface speed, wheel RPM from surface speed, workpiece surface speed, workpiece RPM and the speed ratios) come with their inputs, units, limits and output formulas, ready to evaluate. Premium calculators are listed locked: name, description and icon only. A calculator can appear in more than one category. In the Abrasor app, visitors get 10 results a day from these calculators on their device.",
        "tags": [
          "Calculators"
        ],
        "security": [],
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "description": "Language for names, descriptions and labels. English is the default; translated items keep their English text in name_en and label_en.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "he",
                "de",
                "es",
                "fr"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The categories, in display order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalculatorCategory"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "operationId": "signIn",
        "summary": "Sign in and get a bearer token",
        "description": "Exchanges an Abrasor account's email and password for a bearer token used by member operations. Accounts are created in the app at https://abrasor.com/register. Allows 10 attempts per 15 minutes per IP address.",
        "tags": [
          "Account"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password"
                ],
                "additionalProperties": false,
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "The account's email address."
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "description": "The account's password."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "token",
                        "user"
                      ],
                      "properties": {
                        "token": {
                          "type": "string",
                          "description": "Bearer token. Send it as Authorization: Bearer <token>."
                        },
                        "user": {
                          "$ref": "#/components/schemas/User"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calculators/categories": {
      "get": {
        "operationId": "listCalculatorCategories",
        "summary": "List calculator categories with their calculators",
        "description": "Every active calculator category (surface grinding, OD grinding, ID grinding, dressing, coolant, cost and ROI…) with its calculators. Each calculator lists its inputs (units, limits, defaults) and its outputs (formula, decimal places and the ranges that grade a result). Premium and Enterprise accounts get every calculator; on the Free plan, Premium calculators come locked (locked: true, no inputs or outputs).",
        "tags": [
          "Calculators"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "description": "Language for names, descriptions and labels. English is the default; translated items keep their English text in name_en and label_en.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "he",
                "de",
                "es",
                "fr"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The categories, in display order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalculatorCategory"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calculators/{id}": {
      "get": {
        "operationId": "getCalculator",
        "summary": "Get one calculator",
        "description": "One active calculator with its inputs and outputs. Evaluate an output's formula with the input values (by variable name) to get the result in the output's unit. Premium calculators need a Premium or Enterprise account.",
        "tags": [
          "Calculators"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The calculator's id (from listCalculatorCategories).",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The calculator.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Calculator"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PremiumOnly"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/decoder": {
      "post": {
        "operationId": "decodeWheelMarking",
        "summary": "Decode a grinding wheel marking",
        "description": "Reads the specification printed on a grinding wheel, such as WA60K8V or D126 C75 B: abrasive, grit, grade, structure, bond, superabrasive concentration and size. The rule-based reading (core) is always returned; when a maker-specific format is recognised, the makers it could come from and comparable grains are listed. A plain-language explanation (ai) is added when available. Uses no AI credits. New markings are rate-limited (30 per hour per IP address, 20 per hour per member).",
        "tags": [
          "Wheel Decoder"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "marking"
                ],
                "additionalProperties": false,
                "properties": {
                  "marking": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 80,
                    "description": "The marking as printed on the wheel or its label.",
                    "examples": [
                      "WA60K8V",
                      "A46K5V",
                      "D126 C75 B"
                    ]
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "en",
                      "he",
                      "de",
                      "es",
                      "fr"
                    ],
                    "default": "en",
                    "description": "Language of the explanation."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The decoded marking.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/DecodeResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A token from signIn (POST /auth/login)."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request is missing a field or a value is not valid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "No valid bearer token, or wrong email or password.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The account is suspended.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "No such item.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate limit reached; try again later.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "Abrasor is briefly down for maintenance; try again later.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PremiumOnly": {
        "description": "The calculator is part of Premium, and this account is on the Free plan.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string",
            "description": "What went wrong, in plain words."
          }
        }
      },
      "BlogArticleSummary": {
        "type": "object",
        "required": [
          "id",
          "title",
          "slug"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The article is at https://abrasor.com/blog/{slug}."
          },
          "cover_image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover image path on abrasor.com, or a full URL."
          },
          "excerpt": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short summary of the article."
          },
          "status": {
            "type": "string",
            "enum": [
              "published"
            ]
          },
          "hidden": {
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          "reading_time_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "description": "Date and time, YYYY-MM-DD HH:MM:SS (Israel time)."
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Date and time, YYYY-MM-DD HH:MM:SS (Israel time)."
          },
          "category_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "category_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "author_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "author_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "comment_count": {
            "type": "integer"
          }
        }
      },
      "BlogArticle": {
        "type": "object",
        "required": [
          "id",
          "title",
          "slug",
          "teaser_only"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "excerpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": "string",
            "description": "The article as HTML. Only with a bearer token."
          },
          "cover_image": {
            "type": [
              "string",
              "null"
            ]
          },
          "reading_time_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "category_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "category_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "author_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "related_calculator_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "A calculator the article refers to."
          },
          "teaser_only": {
            "type": "boolean",
            "description": "True when the body was left out because no bearer token was sent."
          },
          "comment_count": {
            "type": "integer"
          }
        }
      },
      "BlogCategory": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "article_count"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "sort_order": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          },
          "article_count": {
            "type": "integer",
            "description": "Published articles in the category."
          }
        }
      },
      "CurrencyRates": {
        "type": "object",
        "required": [
          "base",
          "date",
          "source",
          "rates"
        ],
        "properties": {
          "base": {
            "type": "string",
            "const": "USD"
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of the rates."
          },
          "source": {
            "type": "string",
            "examples": [
              "European Central Bank"
            ]
          },
          "rates": {
            "type": "object",
            "description": "Units of each currency (ISO 4217 code) per 1 US dollar.",
            "additionalProperties": {
              "type": "number"
            },
            "examples": [
              {
                "USD": 1,
                "EUR": 0.8957,
                "ILS": 3.199
              }
            ]
          }
        }
      },
      "User": {
        "type": "object",
        "required": [
          "id",
          "email"
        ],
        "description": "The signed-in account. More fields may be present.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string"
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CalculatorRange": {
        "type": "object",
        "required": [
          "label",
          "min",
          "max"
        ],
        "description": "A band that grades a result, such as Roughing or Finishing.",
        "properties": {
          "label": {
            "type": "string"
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "color": {
            "type": "string"
          }
        }
      },
      "CalculatorField": {
        "type": "object",
        "required": [
          "id",
          "label",
          "variable",
          "unit"
        ],
        "description": "An input (type, min, max, step, default_value) or an output (formula, decimal_places, ranges).",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "label_en": {
            "type": "string",
            "description": "English label, when lang is not English."
          },
          "variable": {
            "type": "string",
            "description": "Name used for this value in formulas."
          },
          "unit": {
            "type": "string",
            "examples": [
              "RPM",
              "mm",
              "m/s"
            ]
          },
          "type": {
            "type": "string",
            "description": "Input type, such as number or select."
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "step": {
            "type": "number"
          },
          "default_value": {
            "type": [
              "number",
              "string"
            ]
          },
          "options": {
            "type": "array",
            "items": {},
            "description": "Choices for a select input."
          },
          "wheel_field": {
            "type": "string",
            "description": "Wheel property that can fill this input from the member's wheel library."
          },
          "formula": {
            "type": "string",
            "description": "Output formula over input variables.",
            "examples": [
              "(Ns * Ds) / (Nw * Dw)"
            ]
          },
          "display_type": {
            "type": "string"
          },
          "decimal_places": {
            "type": "integer"
          },
          "ranges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalculatorRange"
            }
          }
        }
      },
      "Calculator": {
        "type": "object",
        "required": [
          "id",
          "name",
          "inputs",
          "outputs"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "examples": [
              "Speed Ratio OD / ID"
            ]
          },
          "name_en": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "category_id": {
            "type": "integer"
          },
          "extra_category_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "inputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalculatorField"
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalculatorField"
            }
          },
          "sort_order": {
            "type": "integer"
          },
          "plan": {
            "type": "string",
            "enum": [
              "free",
              "premium"
            ],
            "description": "free: the Free plan and visitors without an account; premium: Premium and Enterprise accounts."
          },
          "locked": {
            "type": "boolean",
            "description": "True when this person may not use the calculator; inputs and outputs are then empty."
          }
        }
      },
      "CalculatorCategory": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "calculators"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "name_en": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "page_link": {
            "type": [
              "string",
              "null"
            ],
            "description": "App screen that replaces the calculator list, when set."
          },
          "sort_order": {
            "type": "integer"
          },
          "calculators": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Calculator"
            }
          }
        }
      },
      "WheelPart": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DecodeResult": {
        "type": "object",
        "required": [
          "core",
          "ai",
          "cached"
        ],
        "properties": {
          "core": {
            "type": "object",
            "required": [
              "marking"
            ],
            "description": "Rule-based reading of the marking. Parts that could not be read are null.",
            "properties": {
              "marking": {
                "type": "string",
                "description": "The marking, normalised."
              },
              "abrasive": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "use": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "standard": {
                    "type": "boolean"
                  }
                }
              },
              "grit": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "value": {
                    "type": "integer"
                  },
                  "class": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "superabrasive": {
                    "type": "boolean"
                  },
                  "micron": {
                    "type": "integer"
                  }
                }
              },
              "grade": {
                "$ref": "#/components/schemas/WheelPart"
              },
              "structure": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "bond": {
                "$ref": "#/components/schemas/WheelPart"
              },
              "concentration": {
                "type": "integer",
                "description": "Superabrasive concentration (C75 = 75)."
              },
              "dims": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "number"
                },
                "description": "Diameter × width × bore, when given."
              },
              "suffix": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "candidates": {
                "type": "array",
                "description": "Makers whose format matches, best match first.",
                "items": {
                  "type": "object",
                  "properties": {
                    "maker": {
                      "type": "string"
                    },
                    "abrasive": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bond": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "type": "string"
                    },
                    "score": {
                      "type": "integer"
                    }
                  }
                }
              },
              "xref": {
                "type": "object",
                "description": "Comparable grains and bonds at other makers."
              },
              "known": {
                "type": "object",
                "description": "The maker, when one is clearly identified."
              }
            }
          },
          "ai": {
            "type": [
              "object",
              "null"
            ],
            "description": "Plain-language explanation, when available.",
            "properties": {
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "meaning": {
                      "type": "string"
                    }
                  }
                }
              },
              "summary": {
                "type": "string"
              },
              "uses": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "generic_spec": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The closest plain ISO 525 marking."
              },
              "equivalents": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "confidence": {
                "type": "string",
                "enum": [
                  "high",
                  "medium",
                  "low"
                ]
              }
            }
          },
          "cached": {
            "type": "boolean",
            "description": "True when the explanation came from the cache."
          }
        }
      }
    }
  }
}
