AITL (Adjudicator-in-the-Loop) flow
The API drives a structured flow. The agent calls the API and relays prompts to you; you confirm or provide feedback until the classification is approved.
Steps
- Start — Call
POST /api/classify/start-free(withwalletAddress) or paidPOST /api/classify/start. You get ajobIdand a prompt asking for item details. - Submit item info — Agent sends to
POST /api/classify/submit-info:jobIdplus item fields (description, specifications, intendedUse, notes; optionally performanceParameters, valuation, units, htsCode, scheduleBNumber, endUser, endUse, destinationCountry). API returns jurisdiction (BIS or ITAR), rationale, and structured output (justification, exportRestrictions, licenseRequirements, auditLog). - Get proposed classification — Either API-driven: confirm jurisdiction via
POST /api/classify/confirm-jurisdiction, thenPOST /api/classify/request-oor(API runs Order of Review). Or agent-driven: agent runs classification using the skill prompts, callsPOST /api/classify/submit-classificationwithproposedClassification, thenPOST /api/classify/request-oorto retrieve the proposal for you. - Review and refine — You approve or give feedback. Agent calls
POST /api/classify/refine-oorwithfeedbackif needed (or re-submits classification in agent-driven flow). Repeat until you are satisfied. - Approve — Agent calls
POST /api/classify/approve. API stores the classification and generates an audit-ready report; returnsreportUrlwhen Supabase Storage is configured. If report storage fails, the response includesreportStorageError; the classification is still approved.
All session steps (submit-info, submit-classification, confirm-jurisdiction, request-oor, refine-oor, approve, status) require the same jobId in the request body. Only start (and optionally jurisdiction) are paid. To recover context (e.g. "where are we?"), call POST /api/classify/status with jobId; the API returns state, nextStep, and promptForUser.