AgentCourt API

v1.0.0 · 4 Policies · 20 Rules · Live

Base URL: https://agentcourt-api-production.up.railway.app

Full API docs: /api-docs · Interactive Swagger: /docs · Verdict Dashboard: /verdicts

Quick Start

Submit a dispute in one API call. Get back a ruling with confidence band, matched rule, and recommended remedy.

# Submit a non-delivery dispute
curl -X POST https://agentcourt-api-production.up.railway.app/v1/disputes \
  -H "Content-Type: application/json" \
  -d '{
    "claimant": "buyer_agent",
    "respondent": "seller_agent",
    "contract": {
      "parties": ["buyer_agent", "seller_agent"],
      "obligations": ["Deliver logo design by June 20"],
      "deadlines": ["2026-06-20"],
      "deliverables": ["3 logo concepts"],
      "payment_terms": "10 USDC on delivery"
    },
    "claim": "Deliverable was never received.",
    "desired_remedy": "full_refund",
    "policy": "freelance-delivery",
    "evidence": [
      {
        "type": "contract",
        "source": "agreement.json",
        "timestamp": "2026-06-15",
        "claimed_fact": "Seller must deliver 3 logo concepts by June 20"
      },
      {
        "type": "payment_proof",
        "source": "x402_receipt",
        "timestamp": "2026-06-15",
        "claimed_fact": "Buyer paid 10 USDC upfront"
      },
      {
        "type": "log",
        "source": "design_tool",
        "timestamp": "2026-06-22",
        "claimed_fact": "No design files exported"
      }
    ]
  }'

Response:

{
  "case_id": "73237472-a53e-4b...",
  "status": "resolved",
  "confidence": "medium",
  "ruling": "The respondent failed to deliver the agreed-upon deliverables...",
  "reasoning": "Evidence establishes non-delivery: contract obligates delivery...",
  "remedy": "full_refund",
  "matched_rule_id": "non-delivery",
  "facts_established": [
    {"fact": "deliverable_was_delivered", "value": false, "source": "log evidence"},
    {"fact": "payment_made", "value": true, "source": "payment_proof evidence"}
  ],
  "ruled_at": "2026-06-22T00:25:14.389060"
}

Want to test all 4 policy templates instantly? Import our Postman collection:

git clone https://github.com/agentcourt/agentcourt && cd agentcourt
# Or download postman_collection.json and import into Postman

Submit Dispute

POST /v1/disputes

Request Body

FieldTypeRequiredDescription
claimantstringYesParty filing the claim
respondentstringYesParty being claimed against
claimstringYesNatural language description of the dispute
desired_remedystringYesWhat the claimant wants (e.g., full_refund, payment)
policystringYesPolicy template name (see Policies)
contractobjectNoContract terms: obligations, deadlines, deliverables, payment_terms
evidencearrayYesEvidence items (see below)

Evidence Item Structure

FieldTypeDescription
typestringEvidence type. Recognized: contract, commit, log, message, file, payment_proof, invoice, receipt, screenshot
sourcestringWhere the evidence came from (filename, URL, system name)
timestampstringISO timestamp of when the evidence was created
claimed_factstringNatural language statement of what this evidence proves. This is the key field — the engine reads this to establish facts.
reliabilitystringOptional. high, medium, low. Defaults to type-based scoring.
hashstringOptional. Content hash for verification.

The claimed_fact field is the most important. The policy engine reads these natural language statements to establish structured facts. Be specific: "Seller delivered the code on June 18" is better than "delivery happened".

Response

FieldTypeDescription
case_idstringUnique case identifier
statusstringresolved or escalated
confidencestringhigh, medium, or low
rulingstringNatural language ruling
reasoningstringExplanation of how the ruling was reached
remedystringRecommended action (e.g., full_refund, full_payout, escalate)
matched_rule_idstringWhich policy rule triggered
facts_establishedarrayStructured facts derived from evidence
facts_disputedarrayFacts with conflicting evidence
facts_unknownarrayFacts that couldn't be established
evidence_scoresarrayScore for each evidence item (0-1)

Policy Templates

GET /v1/policies
GET /v1/policies/{policy_name}

freelance-delivery

Disputes over digital work delivery: non-delivery, late delivery, scope issues.

RuleConfidenceRemedy
non-deliveryhighfull_refund
late-delivery-acceptedmediumpartial_refund
late-delivery-rejectedmediumfull_refund
partial-deliverymediumpartial_refund
disputed-acceptancelowescalate

milestone-payment

Disputes over milestone payments: unpaid milestones, overdue payments.

RuleConfidenceRemedy
milestone-completed-unpaidhighfull_payment_plus_penalty
milestone-completed-paidhighnone
milestone-incomplete-payment-demandedhighdeny_payment
milestone-partially-completemediumproportional_payment
milestone-disputed-completionlowescalate

bug-bounty

Disputes over bug bounty claims: reproducibility, severity, disclosure.

RuleConfidenceRemedy
valid-bug-full-payouthighfull_payout
non-reproducible-bughighdeny_payout
valid-bug-partial-severitymediumpartial_payout
disclosure-violationmediumreduced_or_denied
disputed-reproducibilitylowescalate

sla-monitoring

Disputes over Service Level Agreement violations: uptime, latency, availability.

RuleConfidenceRemedy
uptime-violationhighservice_credit
latency-breachhighservice_credit
partial-degradationmediumpartial_credit
incidents-within-slahighdeny_credit
insufficient-monitoringlowescalate

Cases

GET /v1/cases
GET /v1/cases/{case_id}
# List all cases
curl https://agentcourt-api-production.up.railway.app/v1/cases

# Get a specific case
curl https://agentcourt-api-production.up.railway.app/v1/cases/{case_id}

Public Verdicts

GET /v1/verdicts
GET /verdicts (HTML dashboard)

Every ruling is public and auditable. The JSON API returns structured verdict data. The HTML dashboard renders it visually.

curl https://agentcourt-api-production.up.railway.app/v1/verdicts | jq .total
# → 3

SDKs & Integration

Python (zero-dependency)

from agentcourt import AgentCourt

court = AgentCourt()
ruling = court.dispute(
    claimant="buyer",
    respondent="seller",
    claim="Non-delivery",
    desired_remedy="full_refund",
    policy="freelance-delivery",
    evidence=[...],
)
print(ruling.confidence)  # "medium"
print(ruling.remedy)      # "full_refund"

JavaScript (zero-dependency)

import { AgentCourt } from '@agentcourt/sdk';

const court = new AgentCourt();
const ruling = await court.resolve({
  claimant: 'buyer',
  respondent: 'seller',
  claim: 'Non-delivery',
  desiredRemedy: 'full_refund',
  policy: 'freelance-delivery',
  evidence: [...],
});

MCP Server

# Run as stdio transport
python3 mcp_server.py

# 5 tools available to any MCP client:
# - resolve_dispute
# - list_policies
# - get_policy
# - get_case
# - health_check

How Rulings Work

  1. Submit evidence — contracts, commits, logs, payment proofs, messages
  2. Evidence scoring — each item weighted by type, reliability, recency, hash verification
  3. Fact extraction — natural language claimed_fact fields are parsed into structured facts
  4. Policy matching — facts evaluated against deterministic policy rules
  5. Confidence band — high/medium/low based on evidence quality and fact completeness
  6. Ruling generated — with remedy, matched rule, full audit trail, and explainable reasoning

Same evidence + same policy always produces the same ruling. Deterministic, not predictive.

AgentCourt — The Dispute Layer for Agent Commerce · Home · Verdicts · Swagger · Contact