Mathpix · API Governance Rules

Mathpix API Rules

Spectral linting rules defining API design standards and conventions for Mathpix.

8 Rules error 3 warn 4 info 1
View Rules File View on GitHub

Rule Categories

mathpix

Rules

error
mathpix-versioned-base-path
All Mathpix endpoints must live under /v3 to match docs.mathpix.com routing.
$.paths
warn
mathpix-dual-apikey-security
Server-side operations must require both app_id and app_key headers (except /v3/app-tokens which only needs app_key).
$.components.securitySchemes
warn
mathpix-snake-case-parameters
All parameter names use snake_case to match Mathpix request/response field naming.
$.paths[*][*].parameters[*].name
warn
mathpix-operation-id-camel-case
operationId must be lowerCamelCase (e.g. processImage, downloadDocx).
$.paths[*][*].operationId
warn
mathpix-title-case-summaries
Operation summaries must use Title Case.
$.paths[*][*].summary
error
mathpix-tag-present
Every operation must declare at least one tag (Images, Documents, Conversions, Batches, Strokes, App Tokens, Usage).
$.paths[*][*]
info
mathpix-contact-email
info.contact must point to support@mathpix.com.
$.info.contact
error
mathpix-production-server
servers[] must declare https://api.mathpix.com.
$.servers[*].url

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
documentationUrl: https://docs.mathpix.com
description: >
  Spectral ruleset enforcing the conventions observed across the Mathpix OpenAPI specs:
  versioned /v3 base path, dual app_id + app_key API key security, snake_case operation parameters,
  Title Case operation summaries, and required tags scoped to the API's business surface.
functions: []
rules:
  mathpix-versioned-base-path:
    description: All Mathpix endpoints must live under /v3 to match docs.mathpix.com routing.
    severity: error
    given: $.paths
    then:
      function: pattern
      field: "@key"
      functionOptions:
        match: "^/v3(/|$)"

  mathpix-dual-apikey-security:
    description: Server-side operations must require both app_id and app_key headers (except /v3/app-tokens which only needs app_key).
    severity: warn
    given: $.components.securitySchemes
    then:
      function: truthy

  mathpix-snake-case-parameters:
    description: All parameter names use snake_case to match Mathpix request/response field naming.
    severity: warn
    given: $.paths[*][*].parameters[*].name
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-z0-9_]*$|^(Content-Type|app_id|app_key|app_token)$"

  mathpix-operation-id-camel-case:
    description: operationId must be lowerCamelCase (e.g. processImage, downloadDocx).
    severity: warn
    given: $.paths[*][*].operationId
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  mathpix-title-case-summaries:
    description: Operation summaries must use Title Case.
    severity: warn
    given: $.paths[*][*].summary
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-zA-Z0-9]*)(\\s[A-Z][a-zA-Z0-9]*)*$"

  mathpix-tag-present:
    description: Every operation must declare at least one tag (Images, Documents, Conversions, Batches, Strokes, App Tokens, Usage).
    severity: error
    given: $.paths[*][*]
    then:
      field: tags
      function: truthy

  mathpix-contact-email:
    description: info.contact must point to support@mathpix.com.
    severity: info
    given: $.info.contact
    then:
      field: email
      function: pattern
      functionOptions:
        match: "^support@mathpix\\.com$"

  mathpix-production-server:
    description: servers[] must declare https://api.mathpix.com.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: "^https://api\\.mathpix\\.com$"

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/mathpix-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.