{"openapi":"3.1.0","info":{"title":"EZO HAZEL PLANTNER API for AI agents","version":"v1","summary":"Hazelnut pollination checks and planting plans, one paid call each.","description":"Pay-per-call calculations for hazelnut orchard planning. Each call is paid in USDC on Base with x402 v2. No account or API key. Results are planning guidance only: pollination, yield, and suitability are not guaranteed. Terms, refunds and receipts: GET /v1 (\"terms\").","termsOfService":"https://plantner.ezohazel.com/en/commercial-transactions/","contact":{"name":"Ezo Hazel Orchard","email":"contact@ezohazel.com"}},"servers":[{"url":"https://api.ezohazel.com"}],"x-payment":{"protocol":"x402 v2","scheme":"exact","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","assetSymbol":"USDC","decimals":6,"eip712Domain":{"name":"USD Coin","version":"2"},"flow":["POST the JSON body without a payment header. A valid request returns 402 with the price and the payment requirement (body and PAYMENT-REQUIRED header, base64 JSON). Invalid input returns 400 before any payment.","Sign the requirement (EIP-3009 transferWithAuthorization for the exact amount, to payTo) and resend the same body with the PAYMENT-SIGNATURE header (base64 JSON, x402 v2 payment payload with \"accepted\" copied from the requirement).","On success the response is 200 with the result, a receipt, and the PAYMENT-RESPONSE header (base64 JSON settlement)."],"retry":"Same address, same product, same input within 24 hours: no new charge. The original result and receipt are returned (identical repeat requests are not billed again). A 409 or 429 response means you were not charged for that call: wait for the Retry-After interval, then send the same request again."},"paths":{"/v1":{"get":{"summary":"Service information: mode, terms, products and price tiers","operationId":"info","responses":{"200":{"description":"Service information","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/pollination-check":{"post":{"summary":"Pollination compatibility check","description":"For a set of cultivars, returns the compatibility of every female/pollen pair (recommended, compatible, incompatible, unknown) with a score, flowering timing where published, and recommended pollinizers. Unknown ids are listed under \"unknown\" and not charged for. Price is set by the number of known cultivars.","operationId":"PollinationCheckRequest","parameters":[{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"schema":{"type":"string"},"description":"base64 JSON x402 v2 payment payload. Omit on the first call to receive the 402 requirement."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollinationCheckRequest"}}}},"responses":{"200":{"description":"Paid result with receipt. A repeat of the same request from the same address within 24 hours returns the original result and receipt with \"replay.charged\": false.","headers":{"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"base64 JSON settlement (absent on an uncharged replay)"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollinationCheckResponse"}}}},"400":{"description":"Invalid input. Not charged. Returned before any payment is requested (for the planting plan, \"no_plan\" can also be returned after verification and before settlement; still not charged).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required, or the payment was rejected. Not charged. The body and the PAYMENT-REQUIRED header carry the x402 v2 requirement, the price tier and the terms.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"base64 JSON, same content as the body"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"409":{"description":"The same request is already being processed, or an earlier payment for it is still being confirmed. Not charged for this call. Wait for Retry-After, then send the same request again; do not pay again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body larger than 16 KB. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited (60 requests per minute per client address and per payer address). Not charged. Wait for Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Not configured, or the payment facilitator or storage is unavailable. If the code is \"settlement_unconfirmed\", do not pay again: retry the same request in about a minute and you will not be charged twice.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-price":{"basis":"number of known cultivars in the result","asset":"USDC","decimals":6,"tiers":[{"knownCultivars":"2-4","amountAtomic":"10000","usdc":"0.01"},{"knownCultivars":"5-8","amountAtomic":"20000","usdc":"0.02"},{"knownCultivars":"9-20","amountAtomic":"30000","usdc":"0.03"},{"knownCultivars":"21-40","amountAtomic":"50000","usdc":"0.05"}]}}},"/v1/planting-plan":{"post":{"summary":"Planting plan","description":"From cultivars and spacing, returns producers, pollinizers, the repeating planting unit, pollinizer share and trees per hectare (year 1 and after thinning at year 10), total trees for the area, and a link that opens the same layout in the web tool. Price is set by the area.","operationId":"PlantingPlanRequest","parameters":[{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"schema":{"type":"string"},"description":"base64 JSON x402 v2 payment payload. Omit on the first call to receive the 402 requirement."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlantingPlanRequest"}}}},"responses":{"200":{"description":"Paid result with receipt. A repeat of the same request from the same address within 24 hours returns the original result and receipt with \"replay.charged\": false.","headers":{"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"base64 JSON settlement (absent on an uncharged replay)"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlantingPlanResponse"}}}},"400":{"description":"Invalid input. Not charged. Returned before any payment is requested (for the planting plan, \"no_plan\" can also be returned after verification and before settlement; still not charged).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment required, or the payment was rejected. Not charged. The body and the PAYMENT-REQUIRED header carry the x402 v2 requirement, the price tier and the terms.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"base64 JSON, same content as the body"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"409":{"description":"The same request is already being processed, or an earlier payment for it is still being confirmed. Not charged for this call. Wait for Retry-After, then send the same request again; do not pay again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body larger than 16 KB. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited (60 requests per minute per client address and per payer address). Not charged. Wait for Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Not configured, or the payment facilitator or storage is unavailable. If the code is \"settlement_unconfirmed\", do not pay again: retry the same request in about a minute and you will not be charged twice.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-price":{"basis":"areaHa","asset":"USDC","decimals":6,"tiers":[{"areaHa":"up to 0.5","amountAtomic":"30000","usdc":"0.03"},{"areaHa":"over 0.5 to 2","amountAtomic":"50000","usdc":"0.05"},{"areaHa":"over 2 to 10","amountAtomic":"100000","usdc":"0.10"},{"areaHa":"over 10 to 50","amountAtomic":"200000","usdc":"0.20"},{"areaHa":"over 50 to 1000","amountAtomic":"400000","usdc":"0.40"}]}}}},"components":{"schemas":{"Error":{"type":"object","required":["schema","error"],"properties":{"schema":{"const":"ezohazel-ai/v1"},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"PollinationCheckRequest":{"type":"object","required":["cultivars"],"properties":{"cultivars":{"type":"array","items":{"type":"string"},"description":"Cultivar ids (for example \"jefferson\", \"eta\"). The list of ids is at https://plantner.ezohazel.com/ai/cultivars.json","minItems":2,"maxItems":40},"fieldCountry":{"type":"string","pattern":"^[A-Za-z]{2}$","description":"Optional. Country of the orchard site (ISO 3166-1 alpha-2). Used only to decide Japanese consumption tax on the receipt (JP: 10% included; other: outside the scope). Not used in the calculation. If omitted, treated as JP."}}},"PlantingPlanRequest":{"type":"object","required":["cultivars","rowSpacingM","treeSpacingM","areaHa"],"properties":{"cultivars":{"type":"array","items":{"type":"string"},"description":"Cultivar ids (for example \"jefferson\", \"eta\"). The list of ids is at https://plantner.ezohazel.com/ai/cultivars.json. All ids must be known, and at least one must be usable as a producer.","minItems":2,"maxItems":12},"rowSpacingM":{"type":"number","minimum":2,"maximum":12,"description":"Distance between rows, metres"},"treeSpacingM":{"type":"number","minimum":1,"maximum":8,"description":"Distance between trees in a row, metres"},"areaHa":{"type":"number","exclusiveMinimum":0,"maximum":1000,"description":"Planted area in hectares. Required; sets the price tier."},"thinning":{"enum":["staggered","square"],"default":"staggered","description":"Thinning pattern at year 10"},"pollenRadiusM":{"type":"number","minimum":5,"maximum":40,"default":18,"description":"Distance pollen is assumed to reach, metres"},"zone":{"type":"string","description":"Optional USDA hardiness zone of the site (for example \"6b\")"},"fieldCountry":{"type":"string","pattern":"^[A-Za-z]{2}$","description":"Optional. Country of the orchard site (ISO 3166-1 alpha-2). Used only to decide Japanese consumption tax on the receipt (JP: 10% included; other: outside the scope). Not used in the calculation. If omitted, treated as JP."}}},"PollinationCheckResponse":{"type":"object","required":["schema","product","result","attribution","notes","mode"],"properties":{"schema":{"const":"ezohazel-ai/v1"},"product":{"const":"pollination-check"},"result":{"type":"object","properties":{"cultivars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"en":{"type":"string"},"ja":{"type":"string"},"s":{"type":"array","items":{"type":"integer"}},"pollenTypes":{"type":"array","items":{"type":"integer"}},"pollinizerOnly":{"type":"boolean"}}}},"unknown":{"type":"array","items":{"type":"string"}},"pairs":{"type":"array","items":{"type":"object","properties":{"female":{"type":"string"},"pollen":{"type":"string"},"kind":{"enum":["recommended","compatible","incompatible","unknown"]},"score":{"type":"number"},"timing":{"type":"string"}}}},"recommendedFor":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"timing":{"type":"string"}}}}}}},"attribution":{"type":"object","description":"Sources and the statement that the data were processed by EZO HAZEL PLANTNER."},"notes":{"type":"array","items":{"type":"string"},"description":"Planning guidance only; no guarantee of pollination, yield, or suitability."},"links":{"type":"object","description":"Links for the person you act for. pollination-check: \"openResult\" opens a result page (compatibility table, summary, suggested pollinizers) on PC or phone; \"varieties\" opens the variety pages. planting-plan: \"openInTool\" opens the plan in the web tool (PC) or a simple preview (phone). After payment the link also carries the receipt number and date. Pass the link to the person."},"mode":{"type":"string"},"receipt":{"type":["object","null"],"description":"Receipt (receipt number, date, product, amount, chain, transaction hash, tax class). null with receiptStatus \"pending\" if recording was delayed; see terms.receipt."},"receiptStatus":{"type":"string"},"replay":{"type":"object","properties":{"charged":{"const":false},"note":{"type":"string"}}}}},"PlantingPlanResponse":{"type":"object","required":["schema","product","result","attribution","notes","mode"],"properties":{"schema":{"const":"ezohazel-ai/v1"},"product":{"const":"planting-plan"},"result":{"type":"object","properties":{"producers":{"type":"array","items":{"type":"string"}},"pollinizers":{"type":"array","items":{"type":"string"}},"skippedPollinizers":{"type":"array","items":{"type":"string"}},"ok":{"type":"boolean","description":"true when every producer in the infinitely repeated unit receives enough compatible pollen. Field edges are not modelled."},"weakProducers":{"type":"integer"},"tile":{"type":"object","properties":{"rows":{"type":"integer"},"along":{"type":"integer"},"cells":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"pollinizerShare":{"type":"object","properties":{"year1":{"type":"number"},"year10":{"type":"number"}}},"treesPerHa":{"type":"object","properties":{"year1":{"type":"number"},"year10":{"type":"number"}}},"totalTrees":{"type":"object","properties":{"year1":{"type":"integer"},"year10":{"type":"integer"}}},"spacingM":{"type":"object","properties":{"row":{"type":"number"},"tree":{"type":"number"},"pollenRadius":{"type":"number"}}}}},"attribution":{"type":"object","description":"Sources and the statement that the data were processed by EZO HAZEL PLANTNER."},"notes":{"type":"array","items":{"type":"string"},"description":"Planning guidance only; no guarantee of pollination, yield, or suitability."},"links":{"type":"object","description":"Links for the person you act for. pollination-check: \"openResult\" opens a result page (compatibility table, summary, suggested pollinizers) on PC or phone; \"varieties\" opens the variety pages. planting-plan: \"openInTool\" opens the plan in the web tool (PC) or a simple preview (phone). After payment the link also carries the receipt number and date. Pass the link to the person."},"mode":{"type":"string"},"receipt":{"type":["object","null"],"description":"Receipt (receipt number, date, product, amount, chain, transaction hash, tax class). null with receiptStatus \"pending\" if recording was delayed; see terms.receipt."},"receiptStatus":{"type":"string"},"replay":{"type":"object","properties":{"charged":{"const":false},"note":{"type":"string"}}}}},"PaymentRequired":{"type":"object","required":["x402Version","accepts"],"properties":{"x402Version":{"const":2},"error":{"type":"string"},"resource":{"type":"object"},"pricing":{"type":"object","properties":{"product":{"type":"string"},"tier":{"type":"string"},"amount":{"type":"string","description":"atomic units (6 decimals)"},"asset":{"const":"USDC"},"decimals":{"const":6}}},"terms":{"type":"object","description":"Quantity, price, payment, delivery, refunds, retry, receipt, request templates, seller."},"accepts":{"type":"array","items":{"type":"object","required":["scheme","network","amount","asset","payTo","maxTimeoutSeconds","extra"],"properties":{"scheme":{"const":"exact"},"network":{"const":"eip155:8453"},"amount":{"type":"string"},"asset":{"const":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"payTo":{"type":"string"},"maxTimeoutSeconds":{"type":"integer"},"extra":{"type":"object","properties":{"name":{"const":"USD Coin"},"version":{"const":"2"}}}}}}}}}}}