{
  "components": {
    "schemas": {
      "AdminCompaniesResponse": {
        "description": "Response body of GET /v1/admins/{name}/companies (documentation schema; the handler builds the same JSON).",
        "properties": {
          "query": {
            "description": "Normalized name that was matched (uppercase, no diacritics)",
            "type": "string"
          },
          "results": {
            "description": "Companies (max 200); `status_label` holds the person's role",
            "items": {
              "$ref": "#/components/schemas/AdminFirmHit"
            },
            "type": "array"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "query",
          "results",
          "total"
        ],
        "type": "object"
      },
      "AdminFirmHit": {
        "properties": {
          "county": {
            "type": [
              "string",
              "null"
            ]
          },
          "cui": {
            "format": "int64",
            "type": "integer"
          },
          "denumire": {
            "type": "string"
          },
          "status_label": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "cui",
          "denumire"
        ],
        "type": "object"
      },
      "AltmanResponse": {
        "example": {
          "altman_z": {
            "risc": "Scăzut",
            "score": 4.06,
            "zona": "Sigură"
          },
          "an": 2025,
          "cui": 50723780,
          "ratios": {
            "grad_indatorare": 1094.39,
            "lichiditate": 1.09,
            "marja_neta": 3.58,
            "productivitate_angajat": 82489.0,
            "roa": 5.58,
            "rotatie_creante": 5.83
          }
        },
        "properties": {
          "altman_z": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AltmanZ"
              }
            ]
          },
          "an": {
            "format": "int32",
            "type": "integer"
          },
          "cui": {
            "format": "int64",
            "type": "integer"
          },
          "ratios": {
            "$ref": "#/components/schemas/FinancialRatios"
          }
        },
        "required": [
          "cui",
          "an",
          "ratios"
        ],
        "type": "object"
      },
      "AltmanZ": {
        "properties": {
          "risc": {
            "type": "string"
          },
          "score": {
            "format": "double",
            "type": "number"
          },
          "zona": {
            "type": "string"
          }
        },
        "required": [
          "score",
          "zona",
          "risc"
        ],
        "type": "object"
      },
      "BalanceIndicator": {
        "properties": {
          "denumire": {
            "type": "string"
          },
          "indicator": {
            "type": "string"
          },
          "valoare": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "indicator",
          "denumire"
        ],
        "type": "object"
      },
      "BalanceSheet": {
        "properties": {
          "an": {
            "format": "int32",
            "type": "integer"
          },
          "caen": {
            "type": [
              "string",
              "null"
            ]
          },
          "cui": {
            "format": "int64",
            "type": "integer"
          },
          "den_caen": {
            "type": [
              "string",
              "null"
            ]
          },
          "denumire": {
            "type": [
              "string",
              "null"
            ]
          },
          "indicatori": {
            "items": {
              "$ref": "#/components/schemas/BalanceIndicator"
            },
            "type": "array"
          },
          "sursa": {
            "type": "string"
          }
        },
        "required": [
          "an",
          "cui",
          "sursa",
          "indicatori"
        ],
        "type": "object"
      },
      "CaenComparatie": {
        "properties": {
          "caen": {
            "type": "string"
          },
          "firme": {
            "items": {
              "$ref": "#/components/schemas/CaenComparatieFirm"
            },
            "type": "array"
          },
          "rang_ref": {
            "format": "int32",
            "type": [
              "integer",
              "null"
            ]
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "firme",
          "total",
          "caen"
        ],
        "type": "object"
      },
      "CaenComparatieFirm": {
        "properties": {
          "activa": {
            "type": "boolean"
          },
          "an": {
            "format": "int32",
            "type": [
              "integer",
              "null"
            ]
          },
          "angajati": {
            "format": "int32",
            "type": [
              "integer",
              "null"
            ]
          },
          "ca": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "cui": {
            "format": "int64",
            "type": "integer"
          },
          "denumire": {
            "type": "string"
          },
          "is_ref": {
            "type": "boolean"
          },
          "judet": {
            "type": [
              "string",
              "null"
            ]
          },
          "localitate": {
            "type": [
              "string",
              "null"
            ]
          },
          "profit": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "rank": {
            "format": "int32",
            "type": "integer"
          },
          "stare": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "cui",
          "denumire",
          "activa",
          "is_ref",
          "rank"
        ],
        "type": "object"
      },
      "CompanyDto": {
        "properties": {
          "administratori": {
            "items": {
              "$ref": "#/components/schemas/RepresentativeDto"
            },
            "type": "array"
          },
          "adresa": {
            "type": [
              "string",
              "null"
            ]
          },
          "altman_z": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AltmanZ"
              }
            ]
          },
          "cod_caen": {
            "type": [
              "string",
              "null"
            ]
          },
          "cod_postal": {
            "type": [
              "string",
              "null"
            ]
          },
          "cui": {
            "format": "int64",
            "type": "integer"
          },
          "data_inregistrare": {
            "type": [
              "string",
              "null"
            ]
          },
          "denumire": {
            "type": "string"
          },
          "denumire_caen": {
            "type": [
              "string",
              "null"
            ]
          },
          "forma_juridica": {
            "type": [
              "string",
              "null"
            ]
          },
          "judet": {
            "type": [
              "string",
              "null"
            ]
          },
          "localitate": {
            "type": [
              "string",
              "null"
            ]
          },
          "nr_reg_com": {
            "type": [
              "string",
              "null"
            ]
          },
          "platitor_tva": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "stare": {
            "type": [
              "string",
              "null"
            ]
          },
          "tva_la_incasare": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "cui",
          "denumire",
          "administratori"
        ],
        "type": "object"
      },
      "FinancialRatios": {
        "description": "Derived ratios from a financial year (same formulas as admin UI).",
        "example": {
          "grad_indatorare": 1094.39,
          "lichiditate": 1.09,
          "marja_neta": 3.58,
          "productivitate_angajat": 82489.0,
          "roa": 5.58,
          "rotatie_creante": 5.83
        },
        "properties": {
          "grad_indatorare": {
            "description": "Datorii / Capitaluri (%). Bun: < 70",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          },
          "lichiditate": {
            "description": "Active circulante / Datorii (x). Bun: ≥ 1.5",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          },
          "marja_neta": {
            "description": "Profit net / Cifră afaceri (%). Bun: > 0",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          },
          "productivitate_angajat": {
            "description": "Cifră afaceri / Nr. angajați (RON)",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          },
          "roa": {
            "description": "Profit net / Total active (%)",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          },
          "rotatie_creante": {
            "description": "Cifră afaceri / Creanțe (x)",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "FinancialYear": {
        "properties": {
          "active_circulante": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "active_imobilizate": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "an": {
            "format": "int32",
            "type": "integer"
          },
          "capital_subscris": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "capitaluri": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "casa_conturi": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "cheltuieli_totale": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "cifra_afaceri": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "creante": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "datorii": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "nr_angajati": {
            "format": "int32",
            "type": [
              "integer",
              "null"
            ]
          },
          "pierdere_neta": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "profit_brut": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "profit_net": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "stocuri": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "venituri_totale": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "an"
        ],
        "type": "object"
      },
      "FinancialYearDto": {
        "description": "Financial year + computed Altman Z' + ratios (API response).",
        "properties": {
          "active_circulante": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "active_imobilizate": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "altman_z": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AltmanZ"
              }
            ]
          },
          "an": {
            "format": "int32",
            "type": "integer"
          },
          "capital_subscris": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "capitaluri": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "casa_conturi": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "cheltuieli_totale": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "cifra_afaceri": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "creante": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "datorii": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "nr_angajati": {
            "format": "int32",
            "type": [
              "integer",
              "null"
            ]
          },
          "pierdere_neta": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "profit_brut": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "profit_net": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "ratios": {
            "$ref": "#/components/schemas/FinancialRatios"
          },
          "stocuri": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "venituri_totale": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "an",
          "ratios"
        ],
        "type": "object"
      },
      "RepresentativeDto": {
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "RiskFlag": {
        "properties": {
          "code": {
            "description": "insolventa | sechestru | urmarire_penala | status_critic | firma_noua | fara_bilant | altman_pericol | altman_gri | capitaluri_negative | pierdere | scadere_cifra_afaceri",
            "type": "string"
          },
          "detail": {
            "description": "human-readable reason (Romanian)",
            "type": "string"
          },
          "points": {
            "description": "points added to the score",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "code",
          "points",
          "detail"
        ],
        "type": "object"
      },
      "RiskReport": {
        "properties": {
          "an_bilant": {
            "description": "year of the latest balance sheet used",
            "format": "int32",
            "type": [
              "integer",
              "null"
            ]
          },
          "checked": {
            "description": "What was and wasn't checked — absence of a flag only means \"no evidence\" for checked sources.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cui": {
            "format": "int64",
            "type": "integer"
          },
          "denumire": {
            "type": "string"
          },
          "flags": {
            "items": {
              "$ref": "#/components/schemas/RiskFlag"
            },
            "type": "array"
          },
          "level": {
            "description": "low (<25) | medium (25-54) | high (>=55)",
            "type": "string"
          },
          "not_checked": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "score": {
            "description": "0 (safe) .. 100 (critical)",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "cui",
          "denumire",
          "score",
          "level",
          "flags",
          "checked",
          "not_checked"
        ],
        "type": "object"
      },
      "SearchHit": {
        "properties": {
          "activa": {
            "type": "boolean"
          },
          "county": {
            "type": [
              "string",
              "null"
            ]
          },
          "cui": {
            "format": "int64",
            "type": "integer"
          },
          "locality": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "stare": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "cui",
          "name",
          "activa"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "api_key": {
        "description": "Operator-issued API key: `Authorization: Bearer <key>`. Required on routes not sold via x402; on paid routes it replaces the x402 payment.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "externalDocs": {
    "description": "LLM-oriented guide with prices and examples",
    "url": "https://date-firme.dev-box.ro/llms-full.txt"
  },
  "info": {
    "description": "Romanian company data from public registries for AI agents: ONRC (trade register: companies, status, CAEN, administrators) and ANAF (VAT status, yearly balance sheets). Paid routes are pay-per-call with x402 v2: no account and no API key needed. Call the route; an unpaid request returns HTTP 402 with a PAYMENT-REQUIRED header (the same PaymentRequired JSON is in the body) listing the price in USDC on Base; sign an `exact` payment and repeat the request with a PAYMENT-SIGNATURE header. The PAYMENT-RESPONSE header of the 2xx answer carries the settlement. You are charged only for 2xx responses. Prices per operation are in `x-payment-info`. The same operations are MCP tools at https://date-firme.dev-box.ro/mcp. Free: /health, /openapi.json, /llms.txt, /llms-full.txt, /robots.txt, /.well-known/x402, /.well-known/mcp.json, /.well-known/mcp/server-card.json. Routes marked API key only are not sold via x402.",
    "license": {
      "name": "Proprietary"
    },
    "title": "date-firme API: Romanian company data (ONRC/ANAF)",
    "version": "0.2.0",
    "x-guidance": "To check a Romanian company: 1) GET /v1/search?q=<name> to get its CUI (skip if you already have the CUI/CIF; RO prefix optional). 2) GET /v1/risk/{cui} for a KYB risk score, /v1/companies/{cui} for the profile, /v1/companies/{cui}/financials for yearly balance sheets (bilant); /v1/caen/{code}/comparatie for industry peers, /v1/admins/{name}/companies for a person's companies. Unpaid requests get HTTP 402 with a PAYMENT-REQUIRED header (x402 v2, scheme exact, USDC on Base); sign the payment and retry the same request with a PAYMENT-SIGNATURE header. Payment is settled only when the response is 2xx. The same operations are MCP tools at /mcp (tool name = operationId)."
  },
  "openapi": "3.1.0",
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "responses": {
          "200": {
            "description": "Service is up: {\"status\":\"ok\"}"
          }
        },
        "security": [],
        "summary": "Liveness check (free)",
        "tags": [
          "meta"
        ]
      }
    },
    "/v1/admins/{name}/companies": {
      "get": {
        "description": "Lists Romanian companies (up to 200) where a person is currently registered as administrator or representative in ONRC public data. Exact match on the full name, case- and diacritics-insensitive. Returns cui, company name (denumire), county and role (status_label). Use when you need a person's other business affiliations: related parties, conflicts of interest or due diligence on a director.",
        "operationId": "admin_companies",
        "parameters": [
          {
            "description": "Full name as registered in ONRC (min 3 chars, case/diacritics-insensitive), e.g. POPESCU ION",
            "example": "POPESCU ION",
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exclude this CUI from the list",
            "in": "query",
            "name": "exclude_cui",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminCompaniesResponse"
                }
              }
            },
            "description": "",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "base64 settlement JSON (present when paid via x402)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Name shorter than 3 characters"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "accepts": {
                      "items": {
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "error": {
                      "type": "string"
                    },
                    "extensions": {
                      "type": "object"
                    },
                    "resource": {
                      "type": "object"
                    },
                    "x402Version": {
                      "const": 2,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "x402Version",
                    "accepts"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Payment required (x402 v2). Body = PaymentRequired JSON (also base64-encoded in the PAYMENT-REQUIRED header): x402Version, error, resource {url, description, mimeType}, accepts[] {scheme: exact, network, amount (USDC atomic units, 6 decimals), asset, payTo, maxTimeoutSeconds, extra}, extensions.bazaar. Pay and retry the same request with the PAYMENT-SIGNATURE header.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "base64 of the PaymentRequired JSON",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {},
          {
            "api_key": []
          }
        ],
        "summary": "Companies where a person is a current administrator/representative (ONRC) ($0.01 per call)",
        "tags": [
          "v1"
        ],
        "x-mcp-tool": "admin_companies",
        "x-payment-info": {
          "price": {
            "amount": "0.010000",
            "currency": "USD",
            "mode": "fixed"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/v1/caen/{code}/comparatie": {
      "get": {
        "description": "Ranks active Romanian companies with a given main CAEN code by turnover (cifra de afaceri) from their latest balance sheet, with employees, net profit and year. Returns top N (5-20, default 15), the total with data and, if cui is in the top N, its rank (rang_ref). Use when you need market leaders or competitors in an industry, or want to place a company against its peers.",
        "operationId": "caen_comparison",
        "parameters": [
          {
            "description": "CAEN activity code (4 digits), e.g. 4752",
            "example": "4752",
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional CUI to highlight and rank (RO prefix optional)",
            "in": "query",
            "name": "cui",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Number of companies, 5-20 (default 15)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaenComparatie"
                }
              }
            },
            "description": "",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "base64 settlement JSON (present when paid via x402)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "accepts": {
                      "items": {
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "error": {
                      "type": "string"
                    },
                    "extensions": {
                      "type": "object"
                    },
                    "resource": {
                      "type": "object"
                    },
                    "x402Version": {
                      "const": 2,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "x402Version",
                    "accepts"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Payment required (x402 v2). Body = PaymentRequired JSON (also base64-encoded in the PAYMENT-REQUIRED header): x402Version, error, resource {url, description, mimeType}, accepts[] {scheme: exact, network, amount (USDC atomic units, 6 decimals), asset, payTo, maxTimeoutSeconds, extra}, extensions.bazaar. Pay and retry the same request with the PAYMENT-SIGNATURE header.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "base64 of the PaymentRequired JSON",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {},
          {
            "api_key": []
          }
        ],
        "summary": "Top active companies in a CAEN activity code by turnover ($0.02 per call)",
        "tags": [
          "v1"
        ],
        "x-mcp-tool": "caen_comparison",
        "x-payment-info": {
          "price": {
            "amount": "0.020000",
            "currency": "USD",
            "mode": "fixed"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/v1/companies/{cui}": {
      "get": {
        "description": "Romanian company (firmă) profile by CUI/CIF: legal name, address, county, status, registration date and number, legal form (SRL, SA...), main CAEN code, ANAF VAT payer (plătitor TVA) and VAT-on-cash flags, current administrators (ONRC) and Altman Z'. Use when you need identity and registration details of a known company: invoicing data, VAT status, legal form or who runs it.",
        "operationId": "company_profile",
        "parameters": [
          {
            "description": "CUI / CIF (Romanian company tax ID): digits with optional RO prefix, e.g. 2816464 or RO2816464",
            "example": "2816464",
            "in": "path",
            "name": "cui",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyDto"
                }
              }
            },
            "description": "",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "base64 settlement JSON (present when paid via x402)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "accepts": {
                      "items": {
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "error": {
                      "type": "string"
                    },
                    "extensions": {
                      "type": "object"
                    },
                    "resource": {
                      "type": "object"
                    },
                    "x402Version": {
                      "const": 2,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "x402Version",
                    "accepts"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Payment required (x402 v2). Body = PaymentRequired JSON (also base64-encoded in the PAYMENT-REQUIRED header): x402Version, error, resource {url, description, mimeType}, accepts[] {scheme: exact, network, amount (USDC atomic units, 6 decimals), asset, payTo, maxTimeoutSeconds, extra}, extensions.bazaar. Pay and retry the same request with the PAYMENT-SIGNATURE header.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "base64 of the PaymentRequired JSON",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Unknown CUI"
          }
        },
        "security": [
          {},
          {
            "api_key": []
          }
        ],
        "summary": "Company profile by CUI: identity, status, VAT, CAEN, administrators ($0.005 per call)",
        "tags": [
          "v1"
        ],
        "x-mcp-tool": "company_profile",
        "x-payment-info": {
          "price": {
            "amount": "0.005000",
            "currency": "USD",
            "mode": "fixed"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/v1/companies/{cui}/altman": {
      "get": {
        "description": "Altman Z' (private-company model) plus the same `ratios` as /financials. Without `an`, the latest balance sheet is used.",
        "operationId": "company_altman",
        "parameters": [
          {
            "description": "CUI / CIF (Romanian company tax ID): digits with optional RO prefix, e.g. 2816464 or RO2816464",
            "example": "2816464",
            "in": "path",
            "name": "cui",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Balance-sheet year (default: latest)",
            "in": "query",
            "name": "an",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AltmanResponse"
                }
              }
            },
            "description": ""
          },
          "401": {
            "description": "Missing or invalid API key (this route is not sold via x402)"
          },
          "404": {
            "description": "No balance sheet for that year"
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Altman Z' score and ratios for one balance-sheet year (API key only)",
        "tags": [
          "v1"
        ]
      }
    },
    "/v1/companies/{cui}/balance": {
      "get": {
        "description": "All indicators of the ANAF balance sheet (bilant) for the given year; fetched from ANAF and cached when not already stored.",
        "operationId": "company_balance_sheet",
        "parameters": [
          {
            "description": "CUI / CIF (Romanian company tax ID): digits with optional RO prefix, e.g. 2816464 or RO2816464",
            "example": "2816464",
            "in": "path",
            "name": "cui",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Balance-sheet year (default: the configured BILANT_YEAR)",
            "in": "query",
            "name": "an",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceSheet"
                }
              }
            },
            "description": ""
          },
          "401": {
            "description": "Missing or invalid API key (this route is not sold via x402)"
          },
          "404": {
            "description": "No balance sheet for that year"
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Raw ANAF balance-sheet indicators for one year (API key only)",
        "tags": [
          "v1"
        ]
      }
    },
    "/v1/companies/{cui}/dosare": {
      "get": {
        "description": "ECRIS integration is pending: currently always returns {total:0, dosare:[], sursa:ECRIS, note}.",
        "operationId": "company_court_cases",
        "parameters": [
          {
            "description": "CUI / CIF (Romanian company tax ID): digits with optional RO prefix, e.g. 2816464 or RO2816464",
            "example": "2816464",
            "in": "path",
            "name": "cui",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Placeholder payload"
          },
          "401": {
            "description": "Missing or invalid API key (this route is not sold via x402)"
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "Court cases (ECRIS) - placeholder, not implemented yet (API key only)",
        "tags": [
          "v1"
        ]
      }
    },
    "/v1/companies/{cui}/financials": {
      "get": {
        "description": "Yearly financial statements (bilanț ANAF) of a Romanian company by CUI, newest first, in RON: assets, stocks, receivables, cash, debts, equity, capital, turnover (cifra de afaceri), revenue, expenses, gross/net profit, loss, employees, plus Altman Z' and ratios (liquidity, debt/equity, net margin, ROA, turnover per employee). Empty list if no filings. Use when you need revenue, profit, debt or headcount trends, or a solvency view of a company over several years.",
        "operationId": "company_financials",
        "parameters": [
          {
            "description": "CUI / CIF (Romanian company tax ID): digits with optional RO prefix, e.g. 2816464 or RO2816464",
            "example": "2816464",
            "in": "path",
            "name": "cui",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FinancialYearDto"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Array of FinancialYearDto, newest first",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "base64 settlement JSON (present when paid via x402)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "accepts": {
                      "items": {
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "error": {
                      "type": "string"
                    },
                    "extensions": {
                      "type": "object"
                    },
                    "resource": {
                      "type": "object"
                    },
                    "x402Version": {
                      "const": 2,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "x402Version",
                    "accepts"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Payment required (x402 v2). Body = PaymentRequired JSON (also base64-encoded in the PAYMENT-REQUIRED header): x402Version, error, resource {url, description, mimeType}, accepts[] {scheme: exact, network, amount (USDC atomic units, 6 decimals), asset, payTo, maxTimeoutSeconds, extra}, extensions.bazaar. Pay and retry the same request with the PAYMENT-SIGNATURE header.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "base64 of the PaymentRequired JSON",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {},
          {
            "api_key": []
          }
        ],
        "summary": "Yearly balance sheet + P&L (bilant ANAF) with Altman Z' and ratios ($0.01 per call)",
        "tags": [
          "v1"
        ],
        "x-mcp-tool": "company_financials",
        "x-payment-info": {
          "price": {
            "amount": "0.010000",
            "currency": "USD",
            "mode": "fixed"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/v1/companies/{cui}/insolventa": {
      "get": {
        "description": "BPI integration is pending: currently always returns {inInsolventa:false, proceduri:[], sursa:BPI, note}. For insolvency signals use /v1/risk/{cui}, which reads ONRC status codes.",
        "operationId": "company_insolvency",
        "parameters": [
          {
            "description": "CUI / CIF (Romanian company tax ID): digits with optional RO prefix, e.g. 2816464 or RO2816464",
            "example": "2816464",
            "in": "path",
            "name": "cui",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Placeholder payload"
          },
          "401": {
            "description": "Missing or invalid API key (this route is not sold via x402)"
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "BPI insolvency lookup - placeholder, not implemented yet (API key only)",
        "tags": [
          "v1"
        ]
      }
    },
    "/v1/companies/{cui}/recom": {
      "get": {
        "description": "JSON object: cui, denumire, nrRegCom, euid, formaJuridica, stare, adresa, judet, localitate, caen[] (cod, denumire, principal), administratori, sursa=ONRC.",
        "operationId": "company_trade_register",
        "parameters": [
          {
            "description": "CUI / CIF (Romanian company tax ID): digits with optional RO prefix, e.g. 2816464 or RO2816464",
            "example": "2816464",
            "in": "path",
            "name": "cui",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trade-register record (ONRC)"
          },
          "401": {
            "description": "Missing or invalid API key (this route is not sold via x402)"
          },
          "404": {
            "description": "Unknown CUI"
          }
        },
        "security": [
          {
            "api_key": []
          }
        ],
        "summary": "ONRC trade-register record: all CAEN codes, administrators (API key only)",
        "tags": [
          "v1"
        ]
      }
    },
    "/v1/risk/{cui}": {
      "get": {
        "description": "KYB risk check for a Romanian company by CUI (tax ID). Returns score 0-100, level low/medium/high and reasons: ONRC insolvency (insolvență), bankruptcy, dissolution, sequestration, criminal case; ANAF/ONRC inactive or deregistered status; latest balance sheet (bilanț: missing, losses, negative equity, falling turnover) and Altman Z'. Use when onboarding a supplier or customer, extending credit, or before paying an invoice. Get the CUI first with search_companies.",
        "operationId": "company_risk",
        "parameters": [
          {
            "description": "CUI / CIF (Romanian company tax ID): digits with optional RO prefix, e.g. 2816464 or RO2816464",
            "example": "2816464",
            "in": "path",
            "name": "cui",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RiskReport"
                }
              }
            },
            "description": "",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "base64 settlement JSON (present when paid via x402)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "accepts": {
                      "items": {
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "error": {
                      "type": "string"
                    },
                    "extensions": {
                      "type": "object"
                    },
                    "resource": {
                      "type": "object"
                    },
                    "x402Version": {
                      "const": 2,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "x402Version",
                    "accepts"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Payment required (x402 v2). Body = PaymentRequired JSON (also base64-encoded in the PAYMENT-REQUIRED header): x402Version, error, resource {url, description, mimeType}, accepts[] {scheme: exact, network, amount (USDC atomic units, 6 decimals), asset, payTo, maxTimeoutSeconds, extra}, extensions.bazaar. Pay and retry the same request with the PAYMENT-SIGNATURE header.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "base64 of the PaymentRequired JSON",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Unknown CUI"
          }
        },
        "security": [
          {},
          {
            "api_key": []
          }
        ],
        "summary": "KYB risk score for a Romanian company (0-100, low/medium/high + reasons) ($0.02 per call)",
        "tags": [
          "v1"
        ],
        "x-mcp-tool": "company_risk",
        "x-payment-info": {
          "price": {
            "amount": "0.020000",
            "currency": "USD",
            "mode": "fixed"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    },
    "/v1/search": {
      "get": {
        "description": "Search the Romanian trade register (ONRC) by company name (denumire firmă), CUI/CIF (RO prefix optional) or registration number (e.g. J40/123/2020). Returns up to 30 matches (cui, name, county, locality, ONRC status, activa), active companies first. Use when you only have a company name and need its CUI (cod fiscal) for the other endpoints, or to check that a CUI exists.",
        "operationId": "search_companies",
        "parameters": [
          {
            "description": "Company name (min 2 chars), CUI/CIF (RO prefix optional) or trade-register number (e.g. J40/123/2020)",
            "example": "dedeman",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SearchHit"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Up to 30 matches (JSON array), active companies first",
            "headers": {
              "PAYMENT-RESPONSE": {
                "description": "base64 settlement JSON (present when paid via x402)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "q shorter than 2 characters"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "accepts": {
                      "items": {
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "error": {
                      "type": "string"
                    },
                    "extensions": {
                      "type": "object"
                    },
                    "resource": {
                      "type": "object"
                    },
                    "x402Version": {
                      "const": 2,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "x402Version",
                    "accepts"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Payment required (x402 v2). Body = PaymentRequired JSON (also base64-encoded in the PAYMENT-REQUIRED header): x402Version, error, resource {url, description, mimeType}, accepts[] {scheme: exact, network, amount (USDC atomic units, 6 decimals), asset, payTo, maxTimeoutSeconds, extra}, extensions.bazaar. Pay and retry the same request with the PAYMENT-SIGNATURE header.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "base64 of the PaymentRequired JSON",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {},
          {
            "api_key": []
          }
        ],
        "summary": "Search Romanian companies by name, CUI/CIF or trade-register number ($0.002 per call)",
        "tags": [
          "v1"
        ],
        "x-mcp-tool": "search_companies",
        "x-payment-info": {
          "price": {
            "amount": "0.002000",
            "currency": "USD",
            "mode": "fixed"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://date-firme.dev-box.ro"
    }
  ],
  "tags": [
    {
      "description": "Romanian company data. Paid via x402 (see x-payment-info) or API key.",
      "name": "v1"
    },
    {
      "description": "Free service endpoints",
      "name": "meta"
    }
  ]
}