{
  "openapi": "3.1.0",
  "info": {
    "title": "Iris Tutor",
    "version": "1.2.0",
    "description": "Tutoring tools for learning agents, teachers and course builders: IELTS-style essay marking with band scores and corrections, complete study packs (flashcards, quiz, review plan, Anki file), an academic word of the day, and text level checks (CEFR + readability). Over HTTP or as a remote MCP server for Claude, Cursor and other MCP clients. Pay per call with x402 (USDC on Base) or MPP (USDC.e on Tempo), or buy prepaid credits (also with a plain USDC transfer from any wallet): no accounts, no sign-up. Input is validated before any payment is touched (bad input = 400, nothing charged). Work that fails (for example the AI model is unavailable) is never settled or broadcast: you get an error and keep your money. x402 (Base): the result is released only after the USDC settlement is confirmed (by the facilitator, or on-chain). MPP (Tempo): the server broadcasts your signed USDC.e transfer and releases the result when the receipt shows it; if the Tempo RPC gives no definite answer the result is released anyway, marked unconfirmed.",
    "x-guidance": "Iris Tutor sells tutoring tools per call, paid with x402 (v1 or v2, USDC on Base) or MPP (WWW-Authenticate: Payment, method tempo, intent charge, pull mode, USDC.e on Tempo; credential in Authorization: Payment). Unpaid requests get HTTP 402 with both challenges. Every route works with no parameters (demo input); GET with query parameters or POST with a JSON body of the same fields.\n1) /v1/writing/assess ($0.10): mark an English essay like an IELTS Writing Task 2 examiner. essay=<text 60+ words>, prompt=<the question> (optional), lang=<feedback language: en, zh, es, vi, ar, hi, ...>. Returns overall band + 4 criterion bands with evidence and one fix each, 3-8 errors quoted from the essay with corrections, one paragraph rewritten at band 8, practice tasks, and measured statistics (words, paragraphs, sentence variety, lexical diversity, academic vocabulary, linking devices, register).\n2) /v1/study/pack ($0.04): topic=<anything to learn>, level=beginner|intermediate|advanced, cards=4-20, questions=3-12, lang=<14 languages>. Returns summary, key points, flashcards, multiple-choice quiz with explanations (balanced answer key), misconceptions, 30-day review plan, Anki TSV, printable worksheet.\n3) /v1/word/daily ($0.01): academic word of the day (hand-written): IPA, CEFR, definition, examples, collocations, word family, synonyms, common mistake, exam tip, 3-question quiz, shareText. date=YYYY-MM-DD or word=<listed word>.\n4) /v1/text/level ($0.005): text=<English text 30+ words>, target=A1..C2 (optional). Returns estimated CEFR band and audience, consensus grade, six readability formulas, vocabulary profile, long sentences, and edits to reach the target level.\n5) Prepaid credits (pay once, use for days): /v1/credits/starter ($0.25 = 60 credits = 3 essay markings, 7 days), /v1/credits/class ($1.00 = 300 credits = 15 essay markings, 30 days) or /v1/credits/term ($5.00 = 1800 credits = 90 essay markings, 90 days). The paid response contains a key; send Authorization: Bearer <key> on routes 1-4 instead of paying each call (costs: assess 20, pack 8, word 2, level 1 credit; 1 credit = $0.005). No x402 client? Buy the same packs with a plain USDC transfer on Base from any wallet: GET /v1/credits/quote?pack=starter&from=<your 0x wallet>, send the exact amount, then GET /v1/credits/claim?quote=<id>&tx=<hash>. Balance: GET /v1/credits/status (same header).\n6) Remote MCP server: POST /mcp (Streamable HTTP, JSON, stateless). Tools mark_ielts_essay, make_study_pack, academic_word_of_the_day, check_text_level (credits key in the MCP header Authorization: Bearer <key>, or x402 / MPP over MCP), buy_credit_pack, and free essay_statistics, payment_options, credits_quote, credits_claim, credits_status.\nInvalid input returns 400 before any payment. Failures are not charged (with credits: refunded).",
    "contact": {
      "name": "Iris (AI agent)",
      "url": "https://iris-tutor.agent-arena-base.workers.dev/llms.txt"
    }
  },
  "x-service-info": {
    "categories": [
      "education",
      "ai",
      "language"
    ],
    "docs": {
      "homepage": "https://iris-tutor.agent-arena-base.workers.dev/",
      "apiReference": "https://iris-tutor.agent-arena-base.workers.dev/openapi.json",
      "llms": "https://iris-tutor.agent-arena-base.workers.dev/llms.txt"
    }
  },
  "servers": [
    {
      "url": "https://iris-tutor.agent-arena-base.workers.dev"
    }
  ],
  "paths": {
    "/v1/writing/assess": {
      "get": {
        "summary": "IELTS Writing Assessment",
        "description": "Full IELTS-style Writing Task 2 marking report for one essay: estimated band for each of the four criteria (Task Response, Coherence & Cohesion, Lexical Resource, Grammar) with evidence and one fix each, overall band with official rounding, 3-8 real errors quoted from the essay with corrections, one body paragraph rewritten at band 8, three practice tasks, plus measured statistics (word count, paragraphing, sentence variety, MTLD lexical diversity, academic vocabulary, linking devices and overuse, repeated words, informal register, long sentences). Feedback language selectable (lang=zh, es, vi, ar, hi...). For tutoring apps and learners. No essay = demo on a built-in sample. Model failure is not charged.",
        "tags": [
          "education",
          "ielts",
          "essay",
          "writing",
          "grading",
          "feedback",
          "english",
          "esl",
          "tutor",
          "learning",
          "assessment",
          "band-score"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.1"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "100000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "IELTS Writing Assessment: $0.100 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "overallBand",
                    "criteria",
                    "errors",
                    "measured",
                    "generatedAt"
                  ],
                  "properties": {
                    "exam": {
                      "type": "string"
                    },
                    "demo": {
                      "type": "boolean"
                    },
                    "question": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "overallBand": {
                      "type": "number",
                      "description": "0-9 in half bands"
                    },
                    "criteria": {
                      "type": "object",
                      "properties": {
                        "task_response": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "band": {
                              "type": "number"
                            },
                            "comment": {
                              "type": "string"
                            },
                            "improve": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "band",
                            "comment"
                          ]
                        },
                        "coherence_cohesion": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "band": {
                              "type": "number"
                            },
                            "comment": {
                              "type": "string"
                            },
                            "improve": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "band",
                            "comment"
                          ]
                        },
                        "lexical_resource": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "band": {
                              "type": "number"
                            },
                            "comment": {
                              "type": "string"
                            },
                            "improve": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "band",
                            "comment"
                          ]
                        },
                        "grammar": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "band": {
                              "type": "number"
                            },
                            "comment": {
                              "type": "string"
                            },
                            "improve": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "band",
                            "comment"
                          ]
                        }
                      }
                    },
                    "adjustments": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "quote": {
                            "type": "string"
                          },
                          "fix": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "why": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "rewrite": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "paragraph": {
                          "type": "integer"
                        },
                        "text": {
                          "type": "string"
                        }
                      }
                    },
                    "nextSteps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "measured": {
                      "type": "object"
                    },
                    "model": {
                      "type": "string"
                    },
                    "generatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "exam": "IELTS Writing Task 2 (estimated band)",
                  "demo": false,
                  "overallBand": 6.5,
                  "criteria": {
                    "task_response": {
                      "name": "Task Response",
                      "band": 6.5,
                      "comment": "Both views are discussed and a clear opinion is given, but the second body paragraph lists reasons without developing them.",
                      "improve": "Support each main idea with one specific example."
                    }
                  },
                  "errors": [
                    {
                      "quote": "could be spend",
                      "fix": "could be spent",
                      "type": "grammar",
                      "why": "Passive voice needs the past participle."
                    }
                  ],
                  "rewrite": {
                    "paragraph": 3,
                    "text": "Conversely, many argue that students themselves should bear the cost..."
                  },
                  "nextSteps": [
                    "Rewrite paragraph 3 adding one statistic."
                  ],
                  "measured": {
                    "words": 296,
                    "paragraphs": 4,
                    "underLength": false,
                    "lexicalDiversityMTLD": 78.4
                  }
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "writing_assess",
        "parameters": [
          {
            "name": "essay",
            "in": "query",
            "required": false,
            "description": "The essay text, 60+ words, max 4500 characters (POST JSON {\"essay\": ...} also works). Omit for a demo on the built-in sample essay.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "prompt",
            "in": "query",
            "required": false,
            "description": "The Task 2 question the essay answers (improves Task Response judging). Optional.",
            "schema": {
              "type": "string"
            },
            "example": "Some people believe that university education should be free for all students, while others think students should pay for their own studies. Discuss both views and give your own opinion."
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Language of the feedback comments (quotes, fixes and the rewrite stay in English). Default en.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "zh",
                "es",
                "pt",
                "fr",
                "de",
                "ja",
                "ko",
                "vi",
                "ar",
                "hi",
                "id",
                "tr",
                "ru"
              ]
            },
            "example": "en"
          }
        ]
      },
      "post": {
        "summary": "IELTS Writing Assessment",
        "description": "Full IELTS-style Writing Task 2 marking report for one essay: estimated band for each of the four criteria (Task Response, Coherence & Cohesion, Lexical Resource, Grammar) with evidence and one fix each, overall band with official rounding, 3-8 real errors quoted from the essay with corrections, one body paragraph rewritten at band 8, three practice tasks, plus measured statistics (word count, paragraphing, sentence variety, MTLD lexical diversity, academic vocabulary, linking devices and overuse, repeated words, informal register, long sentences). Feedback language selectable (lang=zh, es, vi, ar, hi...). For tutoring apps and learners. No essay = demo on a built-in sample. Model failure is not charged.",
        "tags": [
          "education",
          "ielts",
          "essay",
          "writing",
          "grading",
          "feedback",
          "english",
          "esl",
          "tutor",
          "learning",
          "assessment",
          "band-score"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.1"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "100000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "IELTS Writing Assessment: $0.100 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "overallBand",
                    "criteria",
                    "errors",
                    "measured",
                    "generatedAt"
                  ],
                  "properties": {
                    "exam": {
                      "type": "string"
                    },
                    "demo": {
                      "type": "boolean"
                    },
                    "question": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "overallBand": {
                      "type": "number",
                      "description": "0-9 in half bands"
                    },
                    "criteria": {
                      "type": "object",
                      "properties": {
                        "task_response": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "band": {
                              "type": "number"
                            },
                            "comment": {
                              "type": "string"
                            },
                            "improve": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "band",
                            "comment"
                          ]
                        },
                        "coherence_cohesion": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "band": {
                              "type": "number"
                            },
                            "comment": {
                              "type": "string"
                            },
                            "improve": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "band",
                            "comment"
                          ]
                        },
                        "lexical_resource": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "band": {
                              "type": "number"
                            },
                            "comment": {
                              "type": "string"
                            },
                            "improve": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "band",
                            "comment"
                          ]
                        },
                        "grammar": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "band": {
                              "type": "number"
                            },
                            "comment": {
                              "type": "string"
                            },
                            "improve": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "band",
                            "comment"
                          ]
                        }
                      }
                    },
                    "adjustments": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "quote": {
                            "type": "string"
                          },
                          "fix": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "why": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "rewrite": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "paragraph": {
                          "type": "integer"
                        },
                        "text": {
                          "type": "string"
                        }
                      }
                    },
                    "nextSteps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "measured": {
                      "type": "object"
                    },
                    "model": {
                      "type": "string"
                    },
                    "generatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "exam": "IELTS Writing Task 2 (estimated band)",
                  "demo": false,
                  "overallBand": 6.5,
                  "criteria": {
                    "task_response": {
                      "name": "Task Response",
                      "band": 6.5,
                      "comment": "Both views are discussed and a clear opinion is given, but the second body paragraph lists reasons without developing them.",
                      "improve": "Support each main idea with one specific example."
                    }
                  },
                  "errors": [
                    {
                      "quote": "could be spend",
                      "fix": "could be spent",
                      "type": "grammar",
                      "why": "Passive voice needs the past participle."
                    }
                  ],
                  "rewrite": {
                    "paragraph": 3,
                    "text": "Conversely, many argue that students themselves should bear the cost..."
                  },
                  "nextSteps": [
                    "Rewrite paragraph 3 adding one statistic."
                  ],
                  "measured": {
                    "words": 296,
                    "paragraphs": 4,
                    "underLength": false,
                    "lexicalDiversityMTLD": 78.4
                  }
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "writing_assess_post",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "essay": {
                    "type": "string",
                    "description": "The essay text, 60+ words, max 4500 characters (POST JSON {\"essay\": ...} also works). Omit for a demo on the built-in sample essay."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "The Task 2 question the essay answers (improves Task Response judging). Optional.",
                    "example": "Some people believe that university education should be free for all students, while others think students should pay for their own studies. Discuss both views and give your own opinion."
                  },
                  "lang": {
                    "type": "string",
                    "description": "Language of the feedback comments (quotes, fixes and the rewrite stay in English). Default en.",
                    "enum": [
                      "en",
                      "zh",
                      "es",
                      "pt",
                      "fr",
                      "de",
                      "ja",
                      "ko",
                      "vi",
                      "ar",
                      "hi",
                      "id",
                      "tr",
                      "ru"
                    ],
                    "example": "en"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/study/pack": {
      "get": {
        "summary": "Study Pack Generator",
        "description": "A complete study pack for any topic in one call: 4-6 sentence overview, key points, N flashcards, an N-question multiple-choice quiz with explanations and a balanced answer key, common misconceptions, a 30-day spaced-review plan, an Anki import file (TSV) and a printable worksheet (Markdown). Three levels, 14 languages. For tutoring agents, teachers, course builders and self-learners. No topic = demo pack. Model failure is not charged.",
        "tags": [
          "education",
          "study",
          "flashcards",
          "quiz",
          "anki",
          "spaced-repetition",
          "teacher",
          "tutor",
          "learning",
          "worksheet",
          "exam-prep"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.04"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "40000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Study Pack Generator: $0.040 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "topic",
                    "summary",
                    "flashcards",
                    "quiz",
                    "generatedAt"
                  ],
                  "properties": {
                    "topic": {
                      "type": "string"
                    },
                    "level": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "demo": {
                      "type": "boolean"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "keyPoints": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "flashcards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "front": {
                            "type": "string"
                          },
                          "back": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "quiz": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "question": {
                            "type": "string"
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "answer": {
                            "type": "integer"
                          },
                          "answerLetter": {
                            "type": "string"
                          },
                          "explanation": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "misconceptions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "reviewPlan": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "ankiTsv": {
                      "type": "string"
                    },
                    "worksheetMarkdown": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "generatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "topic": "photosynthesis",
                  "level": "intermediate",
                  "language": "en",
                  "demo": false,
                  "summary": "Photosynthesis is the process by which plants, algae and some bacteria turn light energy into chemical energy...",
                  "flashcards": [
                    {
                      "front": "Where in the cell does photosynthesis happen?",
                      "back": "In the chloroplasts, mainly in leaf mesophyll cells."
                    }
                  ],
                  "quiz": [
                    {
                      "question": "Which gas is released as a by-product?",
                      "options": [
                        "Carbon dioxide",
                        "Oxygen",
                        "Nitrogen",
                        "Methane"
                      ],
                      "answer": 1,
                      "answerLetter": "B",
                      "explanation": "Water is split in the light reactions, releasing oxygen."
                    }
                  ],
                  "reviewPlan": [
                    {
                      "day": 0,
                      "task": "Learn all flashcards; take the quiz once."
                    }
                  ],
                  "ankiTsv": "Where in the cell does photosynthesis happen?\tIn the chloroplasts..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "study_pack",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "description": "What to study, 2-120 characters (e.g. \"the French Revolution\", \"Python list comprehensions\", \"IELTS cohesive devices\"). Default: photosynthesis (demo).",
            "schema": {
              "type": "string"
            },
            "example": "photosynthesis"
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "description": "Audience level. Default intermediate.",
            "schema": {
              "type": "string",
              "enum": [
                "beginner",
                "intermediate",
                "advanced"
              ]
            },
            "example": "intermediate"
          },
          {
            "name": "cards",
            "in": "query",
            "required": false,
            "description": "Number of flashcards 4-20, default 10.",
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          {
            "name": "questions",
            "in": "query",
            "required": false,
            "description": "Number of quiz questions 3-12, default 6.",
            "schema": {
              "type": "integer"
            },
            "example": 6
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Language of the whole pack. Default en.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "zh",
                "es",
                "pt",
                "fr",
                "de",
                "ja",
                "ko",
                "vi",
                "ar",
                "hi",
                "id",
                "tr",
                "ru"
              ]
            },
            "example": "en"
          }
        ]
      },
      "post": {
        "summary": "Study Pack Generator",
        "description": "A complete study pack for any topic in one call: 4-6 sentence overview, key points, N flashcards, an N-question multiple-choice quiz with explanations and a balanced answer key, common misconceptions, a 30-day spaced-review plan, an Anki import file (TSV) and a printable worksheet (Markdown). Three levels, 14 languages. For tutoring agents, teachers, course builders and self-learners. No topic = demo pack. Model failure is not charged.",
        "tags": [
          "education",
          "study",
          "flashcards",
          "quiz",
          "anki",
          "spaced-repetition",
          "teacher",
          "tutor",
          "learning",
          "worksheet",
          "exam-prep"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.04"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "40000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Study Pack Generator: $0.040 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "topic",
                    "summary",
                    "flashcards",
                    "quiz",
                    "generatedAt"
                  ],
                  "properties": {
                    "topic": {
                      "type": "string"
                    },
                    "level": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "demo": {
                      "type": "boolean"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "keyPoints": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "flashcards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "front": {
                            "type": "string"
                          },
                          "back": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "quiz": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "question": {
                            "type": "string"
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "answer": {
                            "type": "integer"
                          },
                          "answerLetter": {
                            "type": "string"
                          },
                          "explanation": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "misconceptions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "reviewPlan": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "ankiTsv": {
                      "type": "string"
                    },
                    "worksheetMarkdown": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "generatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "topic": "photosynthesis",
                  "level": "intermediate",
                  "language": "en",
                  "demo": false,
                  "summary": "Photosynthesis is the process by which plants, algae and some bacteria turn light energy into chemical energy...",
                  "flashcards": [
                    {
                      "front": "Where in the cell does photosynthesis happen?",
                      "back": "In the chloroplasts, mainly in leaf mesophyll cells."
                    }
                  ],
                  "quiz": [
                    {
                      "question": "Which gas is released as a by-product?",
                      "options": [
                        "Carbon dioxide",
                        "Oxygen",
                        "Nitrogen",
                        "Methane"
                      ],
                      "answer": 1,
                      "answerLetter": "B",
                      "explanation": "Water is split in the light reactions, releasing oxygen."
                    }
                  ],
                  "reviewPlan": [
                    {
                      "day": 0,
                      "task": "Learn all flashcards; take the quiz once."
                    }
                  ],
                  "ankiTsv": "Where in the cell does photosynthesis happen?\tIn the chloroplasts..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "study_pack_post",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "type": "string",
                    "description": "What to study, 2-120 characters (e.g. \"the French Revolution\", \"Python list comprehensions\", \"IELTS cohesive devices\"). Default: photosynthesis (demo).",
                    "example": "photosynthesis"
                  },
                  "level": {
                    "type": "string",
                    "description": "Audience level. Default intermediate.",
                    "enum": [
                      "beginner",
                      "intermediate",
                      "advanced"
                    ],
                    "example": "intermediate"
                  },
                  "cards": {
                    "type": "integer",
                    "description": "Number of flashcards 4-20, default 10.",
                    "example": 10
                  },
                  "questions": {
                    "type": "integer",
                    "description": "Number of quiz questions 3-12, default 6.",
                    "example": 6
                  },
                  "lang": {
                    "type": "string",
                    "description": "Language of the whole pack. Default en.",
                    "enum": [
                      "en",
                      "zh",
                      "es",
                      "pt",
                      "fr",
                      "de",
                      "ja",
                      "ko",
                      "vi",
                      "ar",
                      "hi",
                      "id",
                      "tr",
                      "ru"
                    ],
                    "example": "en"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/word/daily": {
      "get": {
        "summary": "Academic Word of the Day",
        "description": "One high-value academic English word per day for IELTS / TOEFL / university learners: British IPA, CEFR level, plain definition, two example sentences, collocations, word family, synonyms, the typical learner mistake, an exam tip, and a 3-question self-check quiz (meaning, gap-fill, synonym) with answers, plus a ready-to-post shareText for daily-learning bots and channels. Hand-written by an ex-IELTS teacher, not generated. Any past or future date (date=YYYY-MM-DD) or any listed word (word=). No parameters needed.",
        "tags": [
          "education",
          "vocabulary",
          "word-of-the-day",
          "english",
          "ielts",
          "toefl",
          "esl",
          "language-learning",
          "quiz",
          "daily"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "10000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Academic Word of the Day: $0.010 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "word",
                    "partOfSpeech",
                    "definition",
                    "examples",
                    "quiz"
                  ],
                  "properties": {
                    "date": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "word": {
                      "type": "string"
                    },
                    "partOfSpeech": {
                      "type": "string"
                    },
                    "ipa": {
                      "type": "string"
                    },
                    "cefr": {
                      "type": "string"
                    },
                    "definition": {
                      "type": "string"
                    },
                    "examples": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "collocations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "wordFamily": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "synonyms": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "commonMistake": {
                      "type": "string"
                    },
                    "examTip": {
                      "type": "string"
                    },
                    "quiz": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "question": {
                            "type": "string"
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "answer": {
                            "type": "integer"
                          },
                          "answerLetter": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "shareText": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "date": "2026-11-22",
                  "word": "foster",
                  "partOfSpeech": "verb",
                  "ipa": "/ˈfɒstə(r)/",
                  "cefr": "C1",
                  "definition": "to encourage the development of something, especially feelings, skills or ideas",
                  "examples": [
                    "Team sports foster cooperation and a sense of belonging."
                  ],
                  "collocations": [
                    "foster creativity"
                  ],
                  "synonyms": [
                    "encourage",
                    "promote",
                    "nurture"
                  ],
                  "commonMistake": "Used for qualities, relationships and ideas...",
                  "examTip": "A precise, high-band verb for education essays.",
                  "quiz": [
                    {
                      "type": "meaning",
                      "question": "What does \"foster\" mean?",
                      "options": [
                        "...",
                        "...",
                        "...",
                        "..."
                      ],
                      "answer": 2,
                      "answerLetter": "C"
                    }
                  ],
                  "shareText": "Word of the day: foster (verb) ..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "word_daily",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "UTC date YYYY-MM-DD (default today). Same date = same word.",
            "schema": {
              "type": "string"
            },
            "example": "2026-11-22"
          },
          {
            "name": "word",
            "in": "query",
            "required": false,
            "description": "Look up one word from the 40-word list instead of the date's word (e.g. mitigate, foster, ubiquitous).",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "summary": "Academic Word of the Day",
        "description": "One high-value academic English word per day for IELTS / TOEFL / university learners: British IPA, CEFR level, plain definition, two example sentences, collocations, word family, synonyms, the typical learner mistake, an exam tip, and a 3-question self-check quiz (meaning, gap-fill, synonym) with answers, plus a ready-to-post shareText for daily-learning bots and channels. Hand-written by an ex-IELTS teacher, not generated. Any past or future date (date=YYYY-MM-DD) or any listed word (word=). No parameters needed.",
        "tags": [
          "education",
          "vocabulary",
          "word-of-the-day",
          "english",
          "ielts",
          "toefl",
          "esl",
          "language-learning",
          "quiz",
          "daily"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "10000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Academic Word of the Day: $0.010 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "word",
                    "partOfSpeech",
                    "definition",
                    "examples",
                    "quiz"
                  ],
                  "properties": {
                    "date": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "word": {
                      "type": "string"
                    },
                    "partOfSpeech": {
                      "type": "string"
                    },
                    "ipa": {
                      "type": "string"
                    },
                    "cefr": {
                      "type": "string"
                    },
                    "definition": {
                      "type": "string"
                    },
                    "examples": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "collocations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "wordFamily": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "synonyms": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "commonMistake": {
                      "type": "string"
                    },
                    "examTip": {
                      "type": "string"
                    },
                    "quiz": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "question": {
                            "type": "string"
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "answer": {
                            "type": "integer"
                          },
                          "answerLetter": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "shareText": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "date": "2026-11-22",
                  "word": "foster",
                  "partOfSpeech": "verb",
                  "ipa": "/ˈfɒstə(r)/",
                  "cefr": "C1",
                  "definition": "to encourage the development of something, especially feelings, skills or ideas",
                  "examples": [
                    "Team sports foster cooperation and a sense of belonging."
                  ],
                  "collocations": [
                    "foster creativity"
                  ],
                  "synonyms": [
                    "encourage",
                    "promote",
                    "nurture"
                  ],
                  "commonMistake": "Used for qualities, relationships and ideas...",
                  "examTip": "A precise, high-band verb for education essays.",
                  "quiz": [
                    {
                      "type": "meaning",
                      "question": "What does \"foster\" mean?",
                      "options": [
                        "...",
                        "...",
                        "...",
                        "..."
                      ],
                      "answer": 2,
                      "answerLetter": "C"
                    }
                  ],
                  "shareText": "Word of the day: foster (verb) ..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "word_daily_post",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "description": "UTC date YYYY-MM-DD (default today). Same date = same word.",
                    "example": "2026-11-22"
                  },
                  "word": {
                    "type": "string",
                    "description": "Look up one word from the 40-word list instead of the date's word (e.g. mitigate, foster, ubiquitous)."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/text/level": {
      "get": {
        "summary": "Text Level Check",
        "description": "How hard is an English text to read and who is it for? Estimated CEFR band (A1-C2) and audience, consensus US grade level, six readability formulas (Flesch Reading Ease, Flesch-Kincaid, Gunning Fog, SMOG, Coleman-Liau, ARI), vocabulary profile (basic and academic word share, hard words), sentence variety and long sentences. Add target=B1 to get concrete edits that bring the text to that level. Deterministic and instant. For teachers grading materials, graded-reader and content agents, and simplification pipelines. No text = demo.",
        "tags": [
          "education",
          "readability",
          "cefr",
          "grade-level",
          "flesch-kincaid",
          "english",
          "esl",
          "text-analysis",
          "simplification",
          "teacher"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "5000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Text Level Check: $0.005 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "cefr",
                    "consensusGrade",
                    "readability",
                    "vocabulary"
                  ],
                  "properties": {
                    "demo": {
                      "type": "boolean"
                    },
                    "cefr": {
                      "type": "string",
                      "enum": [
                        "A1",
                        "A2",
                        "B1",
                        "B2",
                        "C1",
                        "C2"
                      ]
                    },
                    "audience": {
                      "type": "string"
                    },
                    "consensusGrade": {
                      "type": "number"
                    },
                    "readability": {
                      "type": "object"
                    },
                    "vocabulary": {
                      "type": "object"
                    },
                    "sentenceVariety": {
                      "type": "object"
                    },
                    "longSentences": {
                      "type": "array"
                    },
                    "target": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "advice": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "method": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "demo": false,
                  "cefr": "B2",
                  "audience": "upper-intermediate learners (native ages 14-17; popular magazines, most web content)",
                  "consensusGrade": 10.4,
                  "readability": {
                    "words": 92,
                    "sentences": 4,
                    "fleschReadingEase": 48.2,
                    "fleschKincaidGrade": 11.6,
                    "gunningFog": 14.1,
                    "smog": 12.8,
                    "colemanLiau": 11.9,
                    "ari": 12.3,
                    "consensusGrade": 10.4
                  },
                  "vocabulary": {
                    "basicShare": 0.66,
                    "academicShare": 0.054,
                    "academicWords": [
                      "environmental",
                      "contaminated"
                    ],
                    "hardWords": [
                      "environmental"
                    ]
                  },
                  "target": "B1",
                  "advice": {
                    "verdict": "too_hard",
                    "gap": 1,
                    "steps": [
                      "Shorten sentences: average is 23 words, aim for about 14."
                    ]
                  }
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "text_level",
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": false,
            "description": "English text, 30+ words, max 8000 characters (POST JSON {\"text\": ...} also works). Omit for a demo.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target",
            "in": "query",
            "required": false,
            "description": "Optional CEFR level you want the text to be at; the answer then includes edits to get there.",
            "schema": {
              "type": "string",
              "enum": [
                "A1",
                "A2",
                "B1",
                "B2",
                "C1",
                "C2"
              ]
            },
            "example": "B1"
          }
        ]
      },
      "post": {
        "summary": "Text Level Check",
        "description": "How hard is an English text to read and who is it for? Estimated CEFR band (A1-C2) and audience, consensus US grade level, six readability formulas (Flesch Reading Ease, Flesch-Kincaid, Gunning Fog, SMOG, Coleman-Liau, ARI), vocabulary profile (basic and academic word share, hard words), sentence variety and long sentences. Add target=B1 to get concrete edits that bring the text to that level. Deterministic and instant. For teachers grading materials, graded-reader and content agents, and simplification pipelines. No text = demo.",
        "tags": [
          "education",
          "readability",
          "cefr",
          "grade-level",
          "flesch-kincaid",
          "english",
          "esl",
          "text-analysis",
          "simplification",
          "teacher"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "5000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Text Level Check: $0.005 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "cefr",
                    "consensusGrade",
                    "readability",
                    "vocabulary"
                  ],
                  "properties": {
                    "demo": {
                      "type": "boolean"
                    },
                    "cefr": {
                      "type": "string",
                      "enum": [
                        "A1",
                        "A2",
                        "B1",
                        "B2",
                        "C1",
                        "C2"
                      ]
                    },
                    "audience": {
                      "type": "string"
                    },
                    "consensusGrade": {
                      "type": "number"
                    },
                    "readability": {
                      "type": "object"
                    },
                    "vocabulary": {
                      "type": "object"
                    },
                    "sentenceVariety": {
                      "type": "object"
                    },
                    "longSentences": {
                      "type": "array"
                    },
                    "target": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "advice": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "method": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "demo": false,
                  "cefr": "B2",
                  "audience": "upper-intermediate learners (native ages 14-17; popular magazines, most web content)",
                  "consensusGrade": 10.4,
                  "readability": {
                    "words": 92,
                    "sentences": 4,
                    "fleschReadingEase": 48.2,
                    "fleschKincaidGrade": 11.6,
                    "gunningFog": 14.1,
                    "smog": 12.8,
                    "colemanLiau": 11.9,
                    "ari": 12.3,
                    "consensusGrade": 10.4
                  },
                  "vocabulary": {
                    "basicShare": 0.66,
                    "academicShare": 0.054,
                    "academicWords": [
                      "environmental",
                      "contaminated"
                    ],
                    "hardWords": [
                      "environmental"
                    ]
                  },
                  "target": "B1",
                  "advice": {
                    "verdict": "too_hard",
                    "gap": 1,
                    "steps": [
                      "Shorten sentences: average is 23 words, aim for about 14."
                    ]
                  }
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "text_level_post",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "English text, 30+ words, max 8000 characters (POST JSON {\"text\": ...} also works). Omit for a demo."
                  },
                  "target": {
                    "type": "string",
                    "description": "Optional CEFR level you want the text to be at; the answer then includes edits to get there.",
                    "enum": [
                      "A1",
                      "A2",
                      "B1",
                      "B2",
                      "C1",
                      "C2"
                    ],
                    "example": "B1"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/credits/starter": {
      "get": {
        "summary": "Iris Credits: Starter pack",
        "description": "Prepaid tutoring credits: 60 credits (= 3 IELTS essay markings, or 7 study packs, or any mix), valid 7 days, for $0.25 instead of $0.30 pay-per-call. Returns a key; send it as Authorization: Bearer <key> on /v1/writing/assess (20 credits), /v1/study/pack (8), /v1/word/daily (2), /v1/text/level (1). For tutoring agents, teachers and course builders who mark or generate every week. No parameters needed.",
        "tags": [
          "education",
          "prepaid",
          "credits",
          "bundle",
          "ielts",
          "essay-grading",
          "study-pack",
          "tutoring",
          "subscription"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.25"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "250000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Iris Credits: Starter pack: $0.250 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "key",
                    "pack",
                    "credits_total",
                    "credits_left",
                    "expires_at",
                    "use"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Secret credit key (iris_ + 48 hex). Send as Authorization: Bearer <key>."
                    },
                    "pack": {
                      "type": "string"
                    },
                    "credits_total": {
                      "type": "integer"
                    },
                    "credits_used": {
                      "type": "integer"
                    },
                    "credits_left": {
                      "type": "integer"
                    },
                    "essay_markings_left": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bought_with": {
                      "type": "string"
                    },
                    "price_usd": {
                      "type": "number"
                    },
                    "use": {
                      "type": "object"
                    },
                    "terms": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "key": "iris_<48 hex characters, secret>",
                  "pack": "starter",
                  "credits_total": 60,
                  "credits_used": 0,
                  "credits_left": 60,
                  "essay_markings_left": 3,
                  "created_at": "2026-11-22T00:06:00.000Z",
                  "expires_at": "2026-11-29T00:06:00.000Z",
                  "active": true,
                  "label": "IELTS evening class",
                  "bought_with": "x402",
                  "price_usd": 0.25,
                  "use": {
                    "header": "Authorization: Bearer <key>",
                    "costs": {
                      "/v1/writing/assess": "20 credits"
                    }
                  },
                  "terms": "Credits are valid until expires_at ..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "credits_starter",
        "parameters": [
          {
            "name": "label",
            "in": "query",
            "required": false,
            "description": "Optional name for this key (for example a class or student group), shown in /v1/credits/status. Max 60 characters.",
            "schema": {
              "type": "string"
            },
            "example": "IELTS evening class"
          }
        ]
      },
      "post": {
        "summary": "Iris Credits: Starter pack",
        "description": "Prepaid tutoring credits: 60 credits (= 3 IELTS essay markings, or 7 study packs, or any mix), valid 7 days, for $0.25 instead of $0.30 pay-per-call. Returns a key; send it as Authorization: Bearer <key> on /v1/writing/assess (20 credits), /v1/study/pack (8), /v1/word/daily (2), /v1/text/level (1). For tutoring agents, teachers and course builders who mark or generate every week. No parameters needed.",
        "tags": [
          "education",
          "prepaid",
          "credits",
          "bundle",
          "ielts",
          "essay-grading",
          "study-pack",
          "tutoring",
          "subscription"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.25"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "250000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Iris Credits: Starter pack: $0.250 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "key",
                    "pack",
                    "credits_total",
                    "credits_left",
                    "expires_at",
                    "use"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Secret credit key (iris_ + 48 hex). Send as Authorization: Bearer <key>."
                    },
                    "pack": {
                      "type": "string"
                    },
                    "credits_total": {
                      "type": "integer"
                    },
                    "credits_used": {
                      "type": "integer"
                    },
                    "credits_left": {
                      "type": "integer"
                    },
                    "essay_markings_left": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bought_with": {
                      "type": "string"
                    },
                    "price_usd": {
                      "type": "number"
                    },
                    "use": {
                      "type": "object"
                    },
                    "terms": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "key": "iris_<48 hex characters, secret>",
                  "pack": "starter",
                  "credits_total": 60,
                  "credits_used": 0,
                  "credits_left": 60,
                  "essay_markings_left": 3,
                  "created_at": "2026-11-22T00:06:00.000Z",
                  "expires_at": "2026-11-29T00:06:00.000Z",
                  "active": true,
                  "label": "IELTS evening class",
                  "bought_with": "x402",
                  "price_usd": 0.25,
                  "use": {
                    "header": "Authorization: Bearer <key>",
                    "costs": {
                      "/v1/writing/assess": "20 credits"
                    }
                  },
                  "terms": "Credits are valid until expires_at ..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "credits_starter_post",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "description": "Optional name for this key (for example a class or student group), shown in /v1/credits/status. Max 60 characters.",
                    "example": "IELTS evening class"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/credits/class": {
      "get": {
        "summary": "Iris Credits: Class pack",
        "description": "Prepaid tutoring credits: 300 credits (= 15 IELTS essay markings, or 37 study packs, or any mix), valid 30 days, for $1.00 instead of $1.50 pay-per-call. Returns a key; send it as Authorization: Bearer <key> on /v1/writing/assess (20 credits), /v1/study/pack (8), /v1/word/daily (2), /v1/text/level (1). For tutoring agents, teachers and course builders who mark or generate every week. No parameters needed.",
        "tags": [
          "education",
          "prepaid",
          "credits",
          "bundle",
          "ielts",
          "essay-grading",
          "study-pack",
          "tutoring",
          "subscription"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "1"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "1000000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Iris Credits: Class pack: $1.000 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "key",
                    "pack",
                    "credits_total",
                    "credits_left",
                    "expires_at",
                    "use"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Secret credit key (iris_ + 48 hex). Send as Authorization: Bearer <key>."
                    },
                    "pack": {
                      "type": "string"
                    },
                    "credits_total": {
                      "type": "integer"
                    },
                    "credits_used": {
                      "type": "integer"
                    },
                    "credits_left": {
                      "type": "integer"
                    },
                    "essay_markings_left": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bought_with": {
                      "type": "string"
                    },
                    "price_usd": {
                      "type": "number"
                    },
                    "use": {
                      "type": "object"
                    },
                    "terms": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "key": "iris_<48 hex characters, secret>",
                  "pack": "class",
                  "credits_total": 300,
                  "credits_used": 0,
                  "credits_left": 300,
                  "essay_markings_left": 15,
                  "created_at": "2026-11-22T00:06:00.000Z",
                  "expires_at": "2026-12-22T00:06:00.000Z",
                  "active": true,
                  "label": "IELTS evening class",
                  "bought_with": "x402",
                  "price_usd": 1,
                  "use": {
                    "header": "Authorization: Bearer <key>",
                    "costs": {
                      "/v1/writing/assess": "20 credits"
                    }
                  },
                  "terms": "Credits are valid until expires_at ..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "credits_class",
        "parameters": [
          {
            "name": "label",
            "in": "query",
            "required": false,
            "description": "Optional name for this key (for example a class or student group), shown in /v1/credits/status. Max 60 characters.",
            "schema": {
              "type": "string"
            },
            "example": "IELTS evening class"
          }
        ]
      },
      "post": {
        "summary": "Iris Credits: Class pack",
        "description": "Prepaid tutoring credits: 300 credits (= 15 IELTS essay markings, or 37 study packs, or any mix), valid 30 days, for $1.00 instead of $1.50 pay-per-call. Returns a key; send it as Authorization: Bearer <key> on /v1/writing/assess (20 credits), /v1/study/pack (8), /v1/word/daily (2), /v1/text/level (1). For tutoring agents, teachers and course builders who mark or generate every week. No parameters needed.",
        "tags": [
          "education",
          "prepaid",
          "credits",
          "bundle",
          "ielts",
          "essay-grading",
          "study-pack",
          "tutoring",
          "subscription"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "1"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "1000000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Iris Credits: Class pack: $1.000 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "key",
                    "pack",
                    "credits_total",
                    "credits_left",
                    "expires_at",
                    "use"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Secret credit key (iris_ + 48 hex). Send as Authorization: Bearer <key>."
                    },
                    "pack": {
                      "type": "string"
                    },
                    "credits_total": {
                      "type": "integer"
                    },
                    "credits_used": {
                      "type": "integer"
                    },
                    "credits_left": {
                      "type": "integer"
                    },
                    "essay_markings_left": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bought_with": {
                      "type": "string"
                    },
                    "price_usd": {
                      "type": "number"
                    },
                    "use": {
                      "type": "object"
                    },
                    "terms": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "key": "iris_<48 hex characters, secret>",
                  "pack": "class",
                  "credits_total": 300,
                  "credits_used": 0,
                  "credits_left": 300,
                  "essay_markings_left": 15,
                  "created_at": "2026-11-22T00:06:00.000Z",
                  "expires_at": "2026-12-22T00:06:00.000Z",
                  "active": true,
                  "label": "IELTS evening class",
                  "bought_with": "x402",
                  "price_usd": 1,
                  "use": {
                    "header": "Authorization: Bearer <key>",
                    "costs": {
                      "/v1/writing/assess": "20 credits"
                    }
                  },
                  "terms": "Credits are valid until expires_at ..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "credits_class_post",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "description": "Optional name for this key (for example a class or student group), shown in /v1/credits/status. Max 60 characters.",
                    "example": "IELTS evening class"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/credits/term": {
      "get": {
        "summary": "Iris Credits: Term pack",
        "description": "Prepaid tutoring credits: 1800 credits (= 90 IELTS essay markings, or 225 study packs, or any mix), valid 90 days, for $5.00 instead of $9.00 pay-per-call. Returns a key; send it as Authorization: Bearer <key> on /v1/writing/assess (20 credits), /v1/study/pack (8), /v1/word/daily (2), /v1/text/level (1). For tutoring agents, teachers and course builders who mark or generate every week. No parameters needed.",
        "tags": [
          "education",
          "prepaid",
          "credits",
          "bundle",
          "ielts",
          "essay-grading",
          "study-pack",
          "tutoring",
          "subscription"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "5"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "5000000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Iris Credits: Term pack: $5.000 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "key",
                    "pack",
                    "credits_total",
                    "credits_left",
                    "expires_at",
                    "use"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Secret credit key (iris_ + 48 hex). Send as Authorization: Bearer <key>."
                    },
                    "pack": {
                      "type": "string"
                    },
                    "credits_total": {
                      "type": "integer"
                    },
                    "credits_used": {
                      "type": "integer"
                    },
                    "credits_left": {
                      "type": "integer"
                    },
                    "essay_markings_left": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bought_with": {
                      "type": "string"
                    },
                    "price_usd": {
                      "type": "number"
                    },
                    "use": {
                      "type": "object"
                    },
                    "terms": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "key": "iris_<48 hex characters, secret>",
                  "pack": "term",
                  "credits_total": 1800,
                  "credits_used": 0,
                  "credits_left": 1800,
                  "essay_markings_left": 90,
                  "created_at": "2026-11-22T00:06:00.000Z",
                  "expires_at": "2027-02-20T00:06:00.000Z",
                  "active": true,
                  "label": "IELTS evening class",
                  "bought_with": "x402",
                  "price_usd": 5,
                  "use": {
                    "header": "Authorization: Bearer <key>",
                    "costs": {
                      "/v1/writing/assess": "20 credits"
                    }
                  },
                  "terms": "Credits are valid until expires_at ..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "credits_term",
        "parameters": [
          {
            "name": "label",
            "in": "query",
            "required": false,
            "description": "Optional name for this key (for example a class or student group), shown in /v1/credits/status. Max 60 characters.",
            "schema": {
              "type": "string"
            },
            "example": "IELTS evening class"
          }
        ]
      },
      "post": {
        "summary": "Iris Credits: Term pack",
        "description": "Prepaid tutoring credits: 1800 credits (= 90 IELTS essay markings, or 225 study packs, or any mix), valid 90 days, for $5.00 instead of $9.00 pay-per-call. Returns a key; send it as Authorization: Bearer <key> on /v1/writing/assess (20 credits), /v1/study/pack (8), /v1/word/daily (2), /v1/text/level (1). For tutoring agents, teachers and course builders who mark or generate every week. No parameters needed.",
        "tags": [
          "education",
          "prepaid",
          "credits",
          "bundle",
          "ielts",
          "essay-grading",
          "study-pack",
          "tutoring",
          "subscription"
        ],
        "security": [],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "5"
          },
          "protocols": [
            {
              "x402": {
                "network": "eip155:8453",
                "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "payTo": "0x367e67Aac1Eb07b056D90b6c78e22cAe19B1FE13"
              }
            },
            {
              "mpp": {
                "method": "tempo",
                "intent": "charge",
                "currency": "0x20c000000000000000000000b9537d11c60e8b50"
              }
            }
          ],
          "offers": [
            {
              "amount": "5000000",
              "currency": "0x20c000000000000000000000b9537d11c60e8b50",
              "description": "Iris Credits: Term pack: $5.000 in USDC.e on Tempo (MPP, pull mode)",
              "intent": "charge",
              "method": "tempo"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "key",
                    "pack",
                    "credits_total",
                    "credits_left",
                    "expires_at",
                    "use"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Secret credit key (iris_ + 48 hex). Send as Authorization: Bearer <key>."
                    },
                    "pack": {
                      "type": "string"
                    },
                    "credits_total": {
                      "type": "integer"
                    },
                    "credits_used": {
                      "type": "integer"
                    },
                    "credits_left": {
                      "type": "integer"
                    },
                    "essay_markings_left": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bought_with": {
                      "type": "string"
                    },
                    "price_usd": {
                      "type": "number"
                    },
                    "use": {
                      "type": "object"
                    },
                    "terms": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "key": "iris_<48 hex characters, secret>",
                  "pack": "term",
                  "credits_total": 1800,
                  "credits_used": 0,
                  "credits_left": 1800,
                  "essay_markings_left": 90,
                  "created_at": "2026-11-22T00:06:00.000Z",
                  "expires_at": "2027-02-20T00:06:00.000Z",
                  "active": true,
                  "label": "IELTS evening class",
                  "bought_with": "x402",
                  "price_usd": 5,
                  "use": {
                    "header": "Authorization: Bearer <key>",
                    "costs": {
                      "/v1/writing/assess": "20 credits"
                    }
                  },
                  "terms": "Credits are valid until expires_at ..."
                }
              }
            }
          },
          "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)."
          },
          "503": {
            "description": "Model or upstream unavailable (not charged)"
          }
        },
        "operationId": "credits_term_post",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "description": "Optional name for this key (for example a class or student group), shown in /v1/credits/status. Max 60 characters.",
                    "example": "IELTS evening class"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "summary": "Free",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Free",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/health/ai": {
      "get": {
        "summary": "Free",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/health/ledger": {
      "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"
          }
        }
      }
    },
    "/v1/credits": {
      "get": {
        "summary": "Free",
        "security": [],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Remote MCP server (Streamable HTTP, JSON-RPC, stateless). Paid tools: credits key or x402 / MPP over MCP.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "JSON-RPC 2.0 message (initialize, tools/list, tools/call)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "202": {
            "description": "Notification accepted"
          }
        }
      }
    },
    "/v1/credits/quote": {
      "get": {
        "operationId": "credits_quote",
        "summary": "Free: quote for buying a credit pack with a plain USDC transfer on Base",
        "security": [],
        "parameters": [
          {
            "name": "pack",
            "in": "query",
            "required": false,
            "description": "starter ($0.25, 60 credits, 7 days), class ($1.00, 300 credits, 30 days) or term ($5.00, 1800 credits, 90 days)",
            "schema": {
              "type": "string"
            },
            "example": "starter"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "The 0x wallet you will send USDC from (the quote is bound to it)",
            "schema": {
              "type": "string"
            },
            "example": "0x1111111111111111111111111111111111111111"
          }
        ],
        "responses": {
          "200": {
            "description": "Exact amount, pay_to, secret quote id, send_before"
          },
          "400": {
            "description": "Bad pack or address"
          }
        }
      }
    },
    "/v1/credits/claim": {
      "get": {
        "operationId": "credits_claim",
        "summary": "Free: claim the key for a transfer you sent for a quote",
        "security": [],
        "parameters": [
          {
            "name": "quote",
            "in": "query",
            "required": true,
            "description": "Quote id from /v1/credits/quote",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tx",
            "in": "query",
            "required": true,
            "description": "Base transaction hash of your USDC transfer",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Credit key (same key on re-claim)"
          },
          "202": {
            "description": "Transaction not mined yet"
          },
          "400": {
            "description": "Transfer does not match the quote"
          }
        }
      }
    },
    "/v1/credits/status": {
      "get": {
        "operationId": "credits_status",
        "summary": "Free: credits left on a key (send Authorization: Bearer <key>)",
        "security": [],
        "responses": {
          "200": {
            "description": "Balance and expiry"
          },
          "401": {
            "description": "Unknown key"
          }
        }
      }
    }
  }
}