{"openapi":"3.1.0","info":{"title":"The Cable Code decoder API","version":"1.0.0","summary":"Decode cable type designations into their layers, deterministically.","description":"Reads a cable type designation (NYY-J 3x1,5, N2XSEYRY, H07RN-F 3G2,5, 12/2 NM-B, Cat6A S/FTP...) in 36 coding systems: 25 national and international letter-code systems and 11 type-name tables (North American (NEC / UL, CSA), Mexican (NOM), Mercosur (IRAM), Brazilian (NBR), Peruvian (NTP), Colombian (NTC), Chilean (NCh), Polish (PN), Czech and Slovak (CSN) and Russian (GOST)), plus LAN and fibre-optic designations.\n\nThe decoder is deterministic: the same input always gives the same answer, and no language model is involved at any point.\n\nPricing: 25 free decodes per caller per UTC day, then $0.01 in USDC per decode, paid with x402 (network eip155:8453).\n\nA designation can parse in more than one system. Read status and each match's basis: grammar-only matches deserve care, since random letter strings parse in some system about one time in five.","contact":{"url":"https://thecablecode.com/developers"}},"servers":[{"url":"https://thecablecode.com"}],"externalDocs":{"description":"Agent guide","url":"https://thecablecode.com/llms.txt"},"paths":{"/api/v1/decode":{"get":{"operationId":"decodeCableCode","summary":"Decode one cable designation","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","maxLength":120},"example":"N2XSEYRY","description":"The designation as printed or listed; sizes (\"3x1,5\"), voltages and standard names are read separately."},{"name":"lang","in":"query","required":false,"schema":{"type":"string","enum":["en","tr"],"default":"en"}}],"responses":{"200":{"description":"The reading.","headers":{"X-Free-Remaining":{"schema":{"type":"integer"},"description":"Free decodes left today for this caller."},"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"x402 settlement receipt (base64 JSON), on paid calls."}},"content":{"application/json":{"schema":{"$ref":"https://thecablecode.com/api/v1/schema/decode-v1.json"}}}},"400":{"description":"Missing or too long code, or an unknown lang."},"402":{"description":"Free allowance used up. Pay $0.01 with x402: retry with a PAYMENT-SIGNATURE header built from the PAYMENT-REQUIRED header.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"x402 v2 payment requirements (base64 JSON)."}}},"429":{"description":"Too many requests per second from one address."}},"x-payment-info":{"protocol":"x402","version":2,"scheme":"exact","network":"eip155:8453","price":"$0.01","asset":"USDC","free_per_day":25}}},"/api/v1/decode/batch":{"post":{"operationId":"decodeCableCodesBatch","summary":"Decode up to 500 designations in one call (a bill of materials), one x402 payment","description":"Validated first, at no cost. Then one x402 payment of $0.01 per code; the free allowance does not apply to batches. The answer keeps the order of the input.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["codes"],"properties":{"codes":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","minLength":1,"maxLength":120},"example":["NYY-J 3x1,5","N2XSEYRY","H07RN-F 3G2,5"]},"lang":{"type":"string","enum":["en","tr"],"default":"en"}}}}}},"responses":{"200":{"description":"One thecablecode.decode/v1 answer per code, in input order.","content":{"application/json":{"schema":{"type":"object","required":["schema","count","matched","results"],"properties":{"schema":{"const":"thecablecode.decode-batch/v1"},"count":{"type":"integer"},"matched":{"type":"integer","description":"How many codes matched at least one coding system."},"results":{"type":"array","items":{"$ref":"https://thecablecode.com/api/v1/schema/decode-v1.json"}}}}}}},"400":{"description":"Not a JSON object with 1 to 500 codes of 1 to 120 characters, or an unknown lang. Nothing is charged."},"402":{"description":"Valid batch: pay $0.01 x the number of codes (PAYMENT-REQUIRED header) with x402 and send the same request again."}},"x-payment-info":{"protocol":"x402","version":2,"scheme":"exact","network":"eip155:8453","price_per_code":"$0.01","asset":"USDC","max_codes":500}}},"/api/v1/ads/slots":{"get":{"operationId":"listSponsorSlots","summary":"Sponsorship slots, targets, regions, monthly prices (EUR) and the terms to accept","responses":{"200":{"description":"The catalogue."},"503":{"description":"Agent sponsorships not open yet."}}}},"/api/v1/ads/quote":{"get":{"operationId":"quoteSponsorship","summary":"Price of one sponsorship in EUR and USDC","parameters":[{"name":"slot","in":"query","required":true,"schema":{"type":"string"}},{"name":"target","in":"query","required":false,"schema":{"type":"string"}},{"name":"region","in":"query","required":true,"schema":{"type":"string"}},{"name":"billing","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The price."},"400":{"description":"Unknown slot, target or region."},"409":{"description":"The spot is taken."}}}},"/api/v1/ads/status":{"get":{"operationId":"sponsorshipStatus","summary":"Where an agent sponsorship stands: live or ended, until when, and what renewing costs (free).","parameters":[{"name":"ref","in":"query","required":true,"schema":{"type":"string"}},{"name":"billing","in":"query","required":false,"schema":{"type":"string","enum":["month","year"]}}],"responses":{"200":{"description":"The order, its end date and the renew url."},"404":{"description":"Unknown ref."}}}},"/api/v1/ads/renew":{"post":{"operationId":"renewSponsorship","summary":"Extend the same ad by a month or a year from its end date, paid with x402.","parameters":[{"name":"ref","in":"query","required":true,"schema":{"type":"string"}},{"name":"billing","in":"query","required":false,"schema":{"type":"string","enum":["month","year"]}}],"responses":{"200":{"description":"Paid and extended: {ok, ref, status: \"live\", ends}."},"402":{"description":"Pay the PAYMENT-REQUIRED amount with x402 and send the same request again."},"404":{"description":"Unknown ref."},"409":{"description":"Not renewable: stopped by the owner, or the spot went to someone else after the ad lapsed."}}}},"/api/v1/ads":{"post":{"operationId":"orderSponsorship","summary":"Order a sponsorship, paid with x402. Validated before any payment; live as soon as the payment settles.","parameters":[{"name":"slot","in":"query","required":true,"schema":{"type":"string"}},{"name":"target","in":"query","required":false,"schema":{"type":"string"}},{"name":"region","in":"query","required":true,"schema":{"type":"string"}},{"name":"billing","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["company","email","url","terms"],"properties":{"company":{"type":"string","maxLength":120,"description":"The business the sponsorship is for."},"email":{"type":"string","format":"email"},"url":{"type":"string","format":"uri","description":"Where the sponsorship links to."},"headline":{"type":"string"},"line":{"type":"string"},"image_base64":{"type":"string","description":"PNG, JPEG or WebP at the slot size (see /api/v1/ads/slots)."},"terms":{"type":"string","description":"The terms version accepted on behalf of the business, from /api/v1/ads/slots."},"order":{"type":"string","description":"Your purchase order reference, optional."},"market":{"type":"string","enum":["EN","TR"]}}}}}},"responses":{"201":{"description":"Paid and live: {ok, ref, status: \"live\", ad, ends}."},"202":{"description":"Paid but not live (the spot was taken while the payment settled): {ok: false, status: \"paid_not_live\"}; the owner refunds it."},"400":{"description":"A field failed validation (error names it); nothing was charged."},"402":{"description":"Valid order: pay the PAYMENT-REQUIRED amount with x402 and send the same request again."},"409":{"description":"The spot is taken."}}}},"/mcp":{"post":{"operationId":"mcp","summary":"Remote MCP server (streamable HTTP, stateless). Tool: decode_cable_code(code, lang). Same free allowance; beyond it the tool takes x402 payment in _meta[\"x402/payment\"].","responses":{"200":{"description":"JSON-RPC response."}}}}}}