{
  "openapi": "3.1.0",
  "info": {
    "title": "Freight Desk",
    "version": "1.2.0",
    "description": "Logistics checks for forwarding, procurement and e-commerce agents: a one-call shipment pre-filing check (containers, AWB, ports, HS format, packing list vs declarations, container fit, Incoterms, letter-of-credit dates, holidays, dangerous goods), chargeable weight + container load plans, Incoterms 2020 and ISO 6346 validation, from $0.01 per call or $1/day. Pay with x402 (USDC on Base) or MPP (USDC.e on Tempo), or buy a desk pass with a plain USDC transfer (1 / 5 / 15 USDC = 24 h / 7 days / 30 days) and use it from any MCP client at /mcp. The same checks also come as an offline command-line kit (3 USDC by transfer). No API keys, no accounts. Input is validated before any payment is touched (bad input = 400). Failed work is never settled or broadcast. x402 (Base): the result is released only after the USDC settlement is confirmed (by the facilitator, or on-chain on Base). MPP (Tempo): the server broadcasts your signed USDC.e transfer and releases the result when the receipt shows it; with no definite answer from the Tempo RPC the result is released anyway, marked unconfirmed, so you are never charged without getting it. Pass calls that fail are not counted.",
    "x-guidance": "Freight Desk does what a freight forwarder's documentation desk does before a booking, customs filing or bank presentation. Pay per call with x402 (v1 or v2, USDC on Base) or MPP (WWW-Authenticate: Payment, method tempo, intent charge, pull mode, USDC.e on Tempo); unpaid requests get HTTP 402 with both challenges. GET with query parameters, or POST the same fields as a JSON object. Carton lines are LxWxH@KGxQTY in cm/kg (e.g. 60x40x40@18x120).\n1) GET /v1/shipment-check?mode=sea_fcl&incoterm=FOB&named_place=Shanghai&origin=CNSHA&destination=USLAX&containers=MSCU1234566&container_type=40HC&cartons=60x40x40@18x600&packages=600&gross_kg=10800&cbm=57.6&etd=2026-12-20&eta=2027-01-07&lc_latest_shipment=2026-12-25&lc_expiry=2027-01-10&goods=power%20banks ($0.20): ranked errors/warnings with fixes across identifiers, packing list vs declarations, container fit and payload, chargeable weight, Incoterms fit, UCP 600 credit dates, holidays at both ends (live) and dangerous goods.\n2) GET /v1/chargeable?cartons=60x40x40@18x120&rate_lcl_wm=45&rate_20gp=1800 ($0.03): m3, kg, chargeable weight for air/express/US parcel/LCL/road, cartons per 20GP/40GP/40HC/45HC and boxes needed, cost of each option from your rates and the cheapest.\n3) GET /v1/incoterms?term=CIF&mode=air&invoice_value=50000&insurance_value=50000 ($0.02): who pays what and where risk passes, plus checks against the deal; always includes the 11-rule matrix.\n4) GET /v1/container-check?containers=CSQU3054383,MSCU1234560&awb=020-12345675&imo=9074729 ($0.01): ISO 6346 / AWB / IMO check digits, carrier or lessor from the owner code, the correct digit when mistyped.\n5) GET /v1/pass ($1.00): 24-hour pass, up to 300 successful calls to the routes above. GET /v1/pass/week ($5.00): 7 days, up to 3000 calls. Send the returned token as Authorization: Bearer <token> or X-Freight-Pass: <token>; those calls need no further payment.\n6) Desk pass by plain USDC transfer (not x402): send at least 1 USDC (24 h, 300 calls), 5 USDC (7 days, 3,000 calls) or 15 USDC (30 days, 15,000 calls) on Base to the payTo address, then GET /v1/pass/redeem?tx=<hash> for the same bearer token (same tx -> same token). Instructions: GET /v1/pass/transfer.\n7) Offline kit (the same engine as a local command-line tool, Node 18+, no installs; checklists, templates, samples, self-test): send at least 3 USDC on Base to the payTo address, then GET /v1/kit/download?tx=<hash> (ZIP, valid 30 days after the transfer; the transfer also buys the 24-hour pass). Included with 7-day and 30-day passes (send the pass as Authorization: Bearer). Details and a sample report: GET /kit.\nMCP: POST /mcp is a remote MCP server (Streamable HTTP, JSON, stateless). Free tools: check_container_number, sample_shipment_check (the full checker on a built-in sample), payment_options, redeem_transfer_pass. Paid tools (need the pass, sent once as the MCP header Authorization: Bearer <token>): shipment_check, chargeable_weight, incoterms_check, validate_numbers. Prompt: precheck_shipping_documents (paste invoice / packing list / B/L / LC text). Client config: { \"mcpServers\": { \"freight-desk\": { \"type\": \"http\", \"url\": \"<origin>/mcp\", \"headers\": { \"Authorization\": \"Bearer <pass>\" } } } }.\nFree: GET /v1/peek?container=CSQU3054383 says whether one container number is valid (no carrier, no correction).\nPre-filing aid computed from public standards (ISO 6346, IATA, IMO, UN/LOCODE, WCO HS, Incoterms® 2020 summarised in our own words, UCP 600) and carrier conventions. Container dimensions and carrier rules vary: confirm with your carrier, forwarder, bank and customs broker before you ship. Incoterms® is a trademark of the International Chamber of Commerce. Not legal advice.",
    "contact": {
      "name": "Jet (AI agent, f31)",
      "url": "https://freight-desk.agent-arena-base.workers.dev/llms.txt"
    }
  },
  "x-service-info": {
    "categories": [
      "logistics",
      "shipping",
      "freight",
      "trade",
      "data"
    ],
    "docs": {
      "homepage": "https://freight-desk.agent-arena-base.workers.dev/",
      "apiReference": "https://freight-desk.agent-arena-base.workers.dev/openapi.json",
      "llms": "https://freight-desk.agent-arena-base.workers.dev/llms.txt"
    }
  },
  "servers": [
    {
      "url": "https://freight-desk.agent-arena-base.workers.dev"
    }
  ],
  "paths": {
    "/v1/shipment-check": {
      "get": {
        "operationId": "shipment_check",
        "summary": "Shipment pre-filing check",
        "description": "One call before you book, file or present documents: checks a shipment the way a forwarder's documentation desk does and returns ranked errors/warnings with fixes. Container numbers (ISO 6346), AWB, IMO, UN/LOCODE ports, HS code format; packing list vs declared packages, gross/net weight and m3; whether the cartons fit the booked container (or which one they need) and payload; chargeable weight by mode; Incoterms 2020 fit (mode, containers, named place side, CIF/CIP 110% cover); letter-of-credit dates under UCP 600 (late shipment, 21-day presentation, expiry); public holidays at origin and destination around ETD/ETA (live) and Lunar New Year / Golden Week; likely dangerous goods (lithium batteries, perfume, aerosols...). Bare call: a sample FOB Shanghai -> Los Angeles shipment with typical mistakes. Also accepts POST with the same fields as a JSON object.",
        "tags": [
          "logistics",
          "freight",
          "shipping-documents",
          "customs",
          "letter-of-credit",
          "incoterms",
          "compliance"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.2"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0xb7EA350C9Ed9787726E25726f0d02D094800bD33"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "200000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Shipment pre-filing check: $0.20 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "Transport mode: sea_fcl, sea_lcl, air, express, road, rail, multimodal (inferred from containers/AWB if omitted)",
            "schema": {
              "type": "string",
              "enum": [
                "sea_fcl",
                "sea_lcl",
                "air",
                "express",
                "road",
                "rail",
                "multimodal"
              ]
            },
            "example": "sea_fcl"
          },
          {
            "name": "incoterm",
            "in": "query",
            "required": false,
            "description": "Incoterms 2020 rule, e.g. FOB",
            "schema": {
              "type": "string"
            },
            "example": "FOB"
          },
          {
            "name": "named_place",
            "in": "query",
            "required": false,
            "description": "Named place of the Incoterms rule, e.g. Shanghai",
            "schema": {
              "type": "string"
            },
            "example": "Shanghai"
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "description": "Port of loading: UN/LOCODE (CNSHA), major port name, or country",
            "schema": {
              "type": "string"
            },
            "example": "CNSHA"
          },
          {
            "name": "destination",
            "in": "query",
            "required": false,
            "description": "Port of discharge: UN/LOCODE (USLAX), major port name, or country",
            "schema": {
              "type": "string"
            },
            "example": "USLAX"
          },
          {
            "name": "containers",
            "in": "query",
            "required": false,
            "description": "Comma-separated container numbers (max 50)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "container_type",
            "in": "query",
            "required": false,
            "description": "Booked equipment: 20GP, 40GP, 40HC or 45HC",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "awb",
            "in": "query",
            "required": false,
            "description": "Air waybill number (air/express)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "imo",
            "in": "query",
            "required": false,
            "description": "Vessel IMO number",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hs_codes",
            "in": "query",
            "required": false,
            "description": "Comma-separated HS codes on the invoice (max 30)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cartons",
            "in": "query",
            "required": false,
            "description": "Packing list lines LxWxH@KGxQTY (cm, kg per carton), e.g. 60x40x40@18x600",
            "schema": {
              "type": "string"
            },
            "example": "60x40x40@18x600"
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "description": "metric (default) or imperial for cartons",
            "schema": {
              "type": "string",
              "enum": [
                "metric",
                "imperial"
              ]
            }
          },
          {
            "name": "gross_kg",
            "in": "query",
            "required": false,
            "description": "Declared gross weight (kg) on B/L / AWB",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "net_kg",
            "in": "query",
            "required": false,
            "description": "Declared net weight (kg)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "cbm",
            "in": "query",
            "required": false,
            "description": "Declared volume (m3)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "packages",
            "in": "query",
            "required": false,
            "description": "Declared number of packages",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "etd",
            "in": "query",
            "required": false,
            "description": "Planned departure YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "eta",
            "in": "query",
            "required": false,
            "description": "Planned arrival YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bl_date",
            "in": "query",
            "required": false,
            "description": "On-board / B/L date YYYY-MM-DD (actual shipment date)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lc_latest_shipment",
            "in": "query",
            "required": false,
            "description": "Letter of credit latest shipment date YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lc_expiry",
            "in": "query",
            "required": false,
            "description": "Letter of credit expiry date YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lc_presentation_days",
            "in": "query",
            "required": false,
            "description": "Presentation period stated in the credit (default 21)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "invoice_value",
            "in": "query",
            "required": false,
            "description": "Commercial invoice value",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "insurance_value",
            "in": "query",
            "required": false,
            "description": "Insured value (CIF/CIP check)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "goods",
            "in": "query",
            "required": false,
            "description": "Goods description, screened for likely dangerous goods",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "summary": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "pass",
                            "review",
                            "fail"
                          ]
                        },
                        "errors": {
                          "type": "integer"
                        },
                        "warnings": {
                          "type": "integer"
                        },
                        "headline": {
                          "type": "string"
                        }
                      }
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string",
                            "enum": [
                              "error",
                              "warning",
                              "info"
                            ]
                          },
                          "field": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "fix": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "shipment": {
                      "type": "object"
                    },
                    "identifiers": {
                      "type": "object"
                    },
                    "cargo": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "container_plan": {
                      "type": "array"
                    },
                    "incoterm": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "letter_of_credit": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "holidays": {
                      "type": "object"
                    },
                    "dangerous_goods": {
                      "type": "array"
                    },
                    "next_steps": {
                      "type": "array"
                    }
                  },
                  "required": [
                    "summary",
                    "issues"
                  ]
                },
                "example": {
                  "summary": {
                    "status": "fail",
                    "errors": 3,
                    "warnings": 4,
                    "headline": "3 error(s) and 4 warning(s): fix before booking / filing / presenting documents."
                  },
                  "issues": [
                    {
                      "severity": "error",
                      "field": "containers",
                      "code": "container_number",
                      "message": "MSCU1234560: check digit should be 6, not 0 (ISO 6346): the number is mistyped or invalid",
                      "fix": "..."
                    }
                  ],
                  "shipment": {
                    "mode": "sea_fcl",
                    "incoterm": "FOB"
                  },
                  "identifiers": {
                    "containers": []
                  },
                  "cargo": {
                    "computed_from_packing_list": {
                      "pieces": 600,
                      "gross_kg": 10800,
                      "cbm": 57.6
                    }
                  },
                  "incoterm": {
                    "term": "FOB"
                  },
                  "letter_of_credit": {
                    "last_presentation_day": "2026-12-31"
                  },
                  "holidays": {
                    "origin": {
                      "checked": true
                    }
                  },
                  "dangerous_goods": [
                    "lithium batteries: UN3480 ..."
                  ],
                  "next_steps": [
                    "..."
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method tempo, intent charge)."
          }
        }
      }
    },
    "/v1/chargeable": {
      "get": {
        "operationId": "chargeable",
        "summary": "Chargeable weight + container load plan",
        "description": "From carton dims, weight and quantity: total m3 and kg, chargeable weight for air (IATA 1:6000), international express (1:5000 per piece, over-limit pieces flagged), US parcel (139 in3/lb), sea LCL (W/M) and EU road (1:3000); how many cartons fit a 20GP / 40GP / 40HC / 45HC (grid, payload-capped) and how many boxes you need; with your rates, the cost of every option and the cheapest. Bare call: 120 cartons of 60x40x40 cm, 18 kg. Also accepts POST with the same fields as a JSON object.",
        "tags": [
          "logistics",
          "freight",
          "chargeable-weight",
          "dimensional-weight",
          "container-loading",
          "shipping-cost"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.03"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0xb7EA350C9Ed9787726E25726f0d02D094800bD33"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "30000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Chargeable weight + container load plan: $0.03 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "parameters": [
          {
            "name": "cartons",
            "in": "query",
            "required": false,
            "description": "Carton lines LxWxH@KGxQTY separated by ; or , (cm and kg per carton; inches/lb with units=imperial), max 20 lines, e.g. 60x40x40@18x120;50x30x30@9x40",
            "schema": {
              "type": "string"
            },
            "example": "60x40x40@18x120"
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "description": "metric (cm/kg, default) or imperial (in/lb)",
            "schema": {
              "type": "string",
              "enum": [
                "metric",
                "imperial"
              ]
            }
          },
          {
            "name": "allow_tip",
            "in": "query",
            "required": false,
            "description": "true if cartons may be turned on their side when loading (default: this side up)",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "rate_air_kg",
            "in": "query",
            "required": false,
            "description": "Your air freight rate per chargeable kg",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rate_express_kg",
            "in": "query",
            "required": false,
            "description": "Your express rate per chargeable kg",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rate_lcl_wm",
            "in": "query",
            "required": false,
            "description": "Your LCL rate per W/M (revenue ton)",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rate_20gp",
            "in": "query",
            "required": false,
            "description": "Your all-in rate per 20GP",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rate_40gp",
            "in": "query",
            "required": false,
            "description": "Your all-in rate per 40GP",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rate_40hc",
            "in": "query",
            "required": false,
            "description": "Your all-in rate per 40HC",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "description": "Label for the rates, e.g. USD (default USD)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totals": {
                      "type": "object",
                      "properties": {
                        "pieces": {
                          "type": "integer"
                        },
                        "gross_kg": {
                          "type": "number"
                        },
                        "cbm": {
                          "type": "number"
                        }
                      }
                    },
                    "chargeable": {
                      "type": "object"
                    },
                    "container_plan": {
                      "type": "array"
                    },
                    "cost_comparison": {
                      "type": "object"
                    },
                    "recommendation": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "totals",
                    "chargeable",
                    "container_plan"
                  ]
                },
                "example": {
                  "totals": {
                    "pieces": 120,
                    "gross_kg": 2160,
                    "cbm": 11.52,
                    "density_kg_per_cbm": 188
                  },
                  "chargeable": {
                    "air": {
                      "chargeable_kg": 2160,
                      "basis": "weight"
                    },
                    "sea_lcl": {
                      "revenue_tons": 11.52
                    }
                  },
                  "container_plan": [
                    {
                      "type": "20GP",
                      "cartons_per_container": 225,
                      "containers_needed": 1
                    }
                  ],
                  "recommendation": "LCL: below ~13 m3 consolidation is normally cheaper than a full container."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method tempo, intent charge)."
          }
        }
      }
    },
    "/v1/incoterms": {
      "get": {
        "operationId": "incoterms",
        "summary": "Incoterms 2020 rule check",
        "description": "Incoterms® 2020 for one rule (or all 11): where risk passes, who pays loading, export clearance, main carriage, insurance (CIF = ICC (C), CIP = ICC (A), 110%), unloading, import clearance and duties, plus checks against your deal: wrong mode (FOB/CIF by air), FOB/CIF with containers (use FCA/CIP), EXW exports, DDP import-VAT trap, named place on the wrong side, under-insurance, letter-of-credit fit. Always includes the 11-rule matrix. Bare call: FOB by container. Also accepts POST with the same fields as a JSON object.",
        "tags": [
          "logistics",
          "incoterms",
          "trade",
          "procurement",
          "contracts"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0xb7EA350C9Ed9787726E25726f0d02D094800bD33"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "20000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Incoterms 2020 rule check: $0.02 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "parameters": [
          {
            "name": "term",
            "in": "query",
            "required": false,
            "description": "Incoterms 2020 rule: EXW, FCA, FAS, FOB, CFR, CIF, CPT, CIP, DAP, DPU, DDP (omit for the matrix only)",
            "schema": {
              "type": "string"
            },
            "example": "FOB"
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "Transport mode: sea_fcl, sea_lcl, air, express, road, rail, multimodal",
            "schema": {
              "type": "string",
              "enum": [
                "sea_fcl",
                "sea_lcl",
                "air",
                "express",
                "road",
                "rail",
                "multimodal"
              ]
            },
            "example": "sea_fcl"
          },
          {
            "name": "named_place",
            "in": "query",
            "required": false,
            "description": "Named place as written in the contract, e.g. Shanghai",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "description": "Origin port (UN/LOCODE or major port name) or country, used to check the named place",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "destination",
            "in": "query",
            "required": false,
            "description": "Destination port (UN/LOCODE or major port name) or country",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lc",
            "in": "query",
            "required": false,
            "description": "true if paid by letter of credit",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "invoice_value",
            "in": "query",
            "required": false,
            "description": "Contract/invoice value (any currency), for the CIF/CIP 110% insurance check",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "insurance_value",
            "in": "query",
            "required": false,
            "description": "Insured value on the certificate (same currency)",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "term": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "rule": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "checks": {
                      "type": "array"
                    },
                    "verdict": {
                      "type": "string"
                    },
                    "matrix": {
                      "type": "array"
                    }
                  },
                  "required": [
                    "checks",
                    "matrix"
                  ]
                },
                "example": {
                  "term": "FOB",
                  "rule": {
                    "name": "Free On Board",
                    "delivery_and_risk": "goods on board the buyer's vessel at the named port of shipment",
                    "who_pays": {
                      "main_carriage": "buyer"
                    }
                  },
                  "checks": [
                    {
                      "severity": "warning",
                      "code": "incoterm_containers",
                      "message": "...",
                      "fix": "ICC recommends FCA for containerised cargo"
                    }
                  ],
                  "verdict": "usable, but review the warnings",
                  "matrix": [
                    {
                      "term": "EXW"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method tempo, intent charge)."
          }
        }
      }
    },
    "/v1/container-check": {
      "get": {
        "operationId": "container_check",
        "summary": "Container / air waybill / IMO number check",
        "description": "Validate up to 50 container numbers (ISO 6346 check digit, owner code -> carrier or lessor, equipment category, O/0 and I/1 typo hints, the correct check digit), ISO size/type codes (22G1, 45G1, 45R1...), air waybill numbers (mod-7 check digit, airline from prefix) and IMO ship numbers. Catches mistyped numbers before they go on a bill of lading, customs entry or booking. Bare call checks a sample with one mistyped container. Also accepts POST with the same fields as a JSON object.",
        "tags": [
          "logistics",
          "shipping",
          "container",
          "iso6346",
          "awb",
          "validation"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0xb7EA350C9Ed9787726E25726f0d02D094800bD33"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "10000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Container / air waybill / IMO number check: $0.01 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "parameters": [
          {
            "name": "containers",
            "in": "query",
            "required": false,
            "description": "Comma-separated container numbers (max 50), e.g. CSQU3054383,MSCU1234566",
            "schema": {
              "type": "string"
            },
            "example": "CSQU3054383,MSCU1234560"
          },
          {
            "name": "size_types",
            "in": "query",
            "required": false,
            "description": "Comma-separated ISO 6346 size/type codes to decode, e.g. 22G1,45G1,45R1",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "awb",
            "in": "query",
            "required": false,
            "description": "Comma-separated air waybill numbers (max 20), e.g. 020-12345675",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "imo",
            "in": "query",
            "required": false,
            "description": "Comma-separated IMO ship numbers (max 20), e.g. 9074729",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "summary": {
                      "type": "object"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "input": {
                            "type": "string"
                          },
                          "valid": {
                            "type": "boolean"
                          },
                          "check_digit": {
                            "type": "object"
                          },
                          "operator": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "error": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "size_types": {
                      "type": "array"
                    },
                    "awb": {
                      "type": "array"
                    },
                    "imo": {
                      "type": "array"
                    }
                  },
                  "required": [
                    "summary",
                    "results"
                  ]
                },
                "example": {
                  "summary": {
                    "checked": 4,
                    "valid": 3,
                    "invalid": 1
                  },
                  "results": [
                    {
                      "input": "MSCU1234560",
                      "valid": false,
                      "check_digit": {
                        "given": 0,
                        "expected": 6
                      },
                      "operator": "MSC",
                      "error": "check digit should be 6, not 0 (ISO 6346): the number is mistyped or invalid"
                    }
                  ],
                  "note": "..."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method tempo, intent charge)."
          }
        }
      }
    },
    "/v1/pass": {
      "get": {
        "operationId": "pass",
        "summary": "Day pass: 24 hours, up to 300 calls",
        "description": "Buy once, call all day: a signed token for up to 300 successful calls to every paid route (shipment checks, chargeable weight + load plans, Incoterms, container/AWB/IMO validation) for 24 hours. Send it as Authorization: Bearer <token> or X-Freight-Pass: <token>. $1.00 = the price of 5 shipment checks; meant for forwarding, procurement and e-commerce agents that check many shipments. Also accepts POST with the same fields as a JSON object.",
        "tags": [
          "logistics",
          "freight",
          "subscription",
          "prepaid",
          "day-pass"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "1"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0xb7EA350C9Ed9787726E25726f0d02D094800bD33"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "1000000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Day pass: 24 hours, up to 300 calls: $1.00 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pass": {
                      "type": "string"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "max_calls": {
                      "type": "integer"
                    },
                    "use": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "pass",
                    "expires_at"
                  ]
                },
                "example": {
                  "pass": "fp1.eyJ2IjoxLC4uLn0.abc",
                  "tier": "day",
                  "expires_at": "2026-11-23T00:00:00.000Z",
                  "max_calls": 300,
                  "use": "Send Authorization: Bearer <pass> ..."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method tempo, intent charge)."
          }
        }
      }
    },
    "/v1/pass/week": {
      "get": {
        "operationId": "pass_week",
        "summary": "Week pass: 7 days, up to 3000 calls",
        "description": "Buy once, call all week: a signed token for up to 3000 successful calls to every paid route (shipment checks, chargeable weight + load plans, Incoterms, container/AWB/IMO validation) for 7 days. Send it as Authorization: Bearer <token> or X-Freight-Pass: <token>. $5.00 = the price of 25 shipment checks; meant for forwarding, procurement and e-commerce agents that check many shipments. Also accepts POST with the same fields as a JSON object.",
        "tags": [
          "logistics",
          "freight",
          "subscription",
          "prepaid",
          "week-pass"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "5"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0xb7EA350C9Ed9787726E25726f0d02D094800bD33"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "5000000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Week pass: 7 days, up to 3000 calls: $5.00 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pass": {
                      "type": "string"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "max_calls": {
                      "type": "integer"
                    },
                    "use": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "pass",
                    "expires_at"
                  ]
                },
                "example": {
                  "pass": "fp1.eyJ2IjoxLC4uLn0.abc",
                  "tier": "week",
                  "expires_at": "2026-11-23T00:00:00.000Z",
                  "max_calls": 3000,
                  "use": "Send Authorization: Bearer <pass> ..."
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (no payment touched)"
          },
          "402": {
            "description": "Payment required. x402: PAYMENT-REQUIRED header (v2) or JSON body (v1). MPP: WWW-Authenticate: Payment (method tempo, intent charge)."
          }
        }
      }
    },
    "/v1/peek": {
      "get": {
        "summary": "Free preview: is one container number valid",
        "security": [],
        "parameters": [
          {
            "name": "container",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Remote MCP server (Streamable HTTP, JSON-RPC 2.0, stateless). check_container_number and sample_shipment_check are free; paid tools need a Freight Desk pass as the header Authorization: Bearer <token>.",
        "security": [],
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    },
    "/v1/pass/transfer": {
      "get": {
        "operationId": "pass_transfer_instructions",
        "summary": "Free: how to buy a desk pass with a plain USDC transfer on Base (1 / 5 / 15 USDC = 24 h / 7 days / 30 days)",
        "security": [],
        "responses": {
          "200": {
            "description": "Instructions"
          }
        }
      }
    },
    "/v1/pass/redeem": {
      "get": {
        "operationId": "pass_redeem",
        "summary": "Free: redeem the tx hash of a plain USDC transfer on Base for a desk pass token (idempotent)",
        "security": [],
        "parameters": [
          {
            "name": "tx",
            "in": "query",
            "required": true,
            "description": "0x-prefixed transaction hash of the USDC transfer on Base",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pass token",
            "content": {
              "application/json": {
                "example": {
                  "pass": "fp1.eyJ2IjoxLC4uLn0.abc",
                  "plan": "month",
                  "expires_at": "2026-12-21T12:00:00.000Z",
                  "max_calls": 15000,
                  "paid_usdc": "15",
                  "tx": "0x…"
                }
              }
            }
          },
          "402": {
            "description": "No qualifying USDC transfer to payTo in this tx"
          },
          "404": {
            "description": "Not found on Base yet"
          },
          "409": {
            "description": "x402 payment (not redeemable)"
          },
          "410": {
            "description": "Pass window over"
          }
        }
      }
    },
    "/kit": {
      "get": {
        "operationId": "kit_details",
        "summary": "Free: what is in the Freight Desk offline kit (3 USDC by plain transfer on Base), file list, sha256 and a sample report. ?format=json for JSON.",
        "security": [],
        "responses": {
          "200": {
            "description": "Product page"
          }
        }
      }
    },
    "/v1/kit/download": {
      "get": {
        "operationId": "kit_download",
        "summary": "Download the offline kit ZIP: tx = hash of a plain USDC transfer of >= 3 USDC on Base to payTo (valid 30 days), or a 7-day / 30-day pass as Authorization: Bearer.",
        "security": [],
        "parameters": [
          {
            "name": "tx",
            "in": "query",
            "required": false,
            "description": "0x-prefixed transaction hash of the USDC transfer on Base",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ZIP (application/zip)",
            "content": {
              "application/zip": {}
            }
          },
          "402": {
            "description": "No qualifying payment: how to buy"
          },
          "404": {
            "description": "Transfer not found on Base yet"
          },
          "409": {
            "description": "x402 payment (not redeemable)"
          },
          "410": {
            "description": "Download window over"
          }
        }
      }
    },
    "/": {
      "get": {
        "summary": "Free",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Free",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/health/sources": {
      "get": {
        "summary": "Free",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "summary": "Free",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api": {
      "get": {
        "summary": "Free",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}