# Quantabble API

> Curriculum-tied misconception diagnosis for AI tutors in AP Chemistry and AP Physics 1.
> Send a student's reasoning; get back what they misunderstand, where it sits in the AP course,
> why it would lose credit, and how to teach it next.

Built by an experienced AP Chemistry and Physics teacher. Grounded in a curated library of common
student misconceptions organized by the AP course and informed by published College Board Chief
Reader Reports. AP is a trademark registered by the College Board, which is not affiliated with,
and does not endorse, this product.

## Coverage

- **AP_CHEMISTRY:** 91 topic schemas
- **AP_PHYSICS_1:** 39 topic schemas

**Total:** 130 schemas. AP Chemistry units 1-9; AP Physics 1 units 1-7.

## Request

```
POST https://quantabble-api.chemandphysicsmastery.workers.dev/
Content-Type: application/json

{ "student_response": "Methanol boils at a higher temperature because its covalent bonds are stronger and take more energy to break." }
```

Optional: `schema_id` (skip topic routing) and `subject` ("chemistry" or "physics").
Also available as an MCP tool: `diagnose_response` (JSON-RPC 2.0 POST to the same URL).

## Response (payload_version 2)

```json
{
  "payload_version": 2,
  "status": "CAUGHT",
  "misconception_detected": true,
  "error_name": "Treats boiling as breaking covalent bonds",
  "error_source": "library",
  "schema_id": "AP_CHEM_3_1",
  "curriculum_anchor": { "course": "AP Chemistry", "unit": 3, "topic": "3.1", "topic_title": "Intermolecular and Interparticle Forces", "standard_codes": ["3.1.A.1", "3.1.A.2"], "learning_objectives": ["3.1.A"] },
  "reader_trap": "Boiling separates whole molecules; an answer that talks about breaking bonds inside the molecule earns no credit.",
  "credit_requirement": "Name the intermolecular forces in each substance and compare their strengths to explain the boiling points.",
  "teaching_guidance": "Recommended: ask what is actually pulled apart when a liquid boils before naming any forces.",
  "probe_question": "When water boils, what particles move away from each other?",
  "tutor_response": "..."
}
```

(Illustrative example. Field contents are generated per call.)

- `status`: CAUGHT, PARTIAL, CORRECT, OUT_OF_SCOPE or ERROR.
- `error_source`: "library" (one of our curated misconceptions) or "engine" (a real error the library does not list, described by the engine).
- `schema_id`: the topic matched. Send it back as `schema_id` on follow-up calls about the same topic to skip routing. The MCP tool `get_coverage` lists every schema_id with its unit and topic.
- `curriculum_anchor`: read from our topic metadata, not generated.
- `teaching_guidance`: a recommendation for your tutor, not an instruction.

## Pricing

Free during preview. Planned price: $0.07 per call, flat.
