Skip to content
developer · developer · research · code-review · static-analysis · python

Code change review

Compare caller-supplied before and after source snapshots without execution or network access, returning source fingerprints, syntax regressions, structural deltas, function-level changes, and bounded review findings.

$0.05 USDCBase + Solanax402 v2POSTCustomer-evidenced
Pay $0.05 USDC and run in your browserView free result sample

Endpoint

https://apiacre.com/v1/developer/code-change-review

Send the JSON body below. An unpaid request returns HTTP 402 with a PAYMENT-REQUIRED header; an x402-compatible buyer signs the requirement and retries with PAYMENT-SIGNATURE.

Pay $0.05 USDC and run in your browser

Official Coinbase agent path

Coinbase Agentic Wallet can satisfy this x402 request in one command. Running it may pay automatically, so --max-amount is fixed to $0.05 USDC in atomic units. Copying the command does not install, authenticate, sign, or pay; review the request and use a separate low-value wallet before running it.

npx --yes awal@latest x402 pay https://apiacre.com/v1/developer/code-change-review \
  -X POST \
  -d '{"before":"def invoice_total(items):\n    return sum(item[\"price\"] for item in items)\n","after":"def invoice_total(items, discount=0):\n    subtotal = sum(item[\"price\"] for item in items)\n    if discount:\n        subtotal *= 1 - discount\n    return subtotal  # TODO: validate discount bounds\n","language":"python","filename":"billing.py"}' \
  --max-amount 50000 \
  --json

Coinbase pay-for-service documentation · Buyer setup and wallet safety

Alternative third-party AgentCash commands

Run check first without payment. Its fetch command may automatically pay up to the exact listed price.

npx --yes agentcash@latest check https://apiacre.com/v1/developer/code-change-review
npx --yes agentcash@latest fetch https://apiacre.com/v1/developer/code-change-review \
  --method POST \
  --header 'content-type: application/json' \
  --body '{"before":"def invoice_total(items):\n    return sum(item[\"price\"] for item in items)\n","after":"def invoice_total(items, discount=0):\n    subtotal = sum(item[\"price\"] for item in items)\n    if discount:\n        subtotal *= 1 - discount\n    return subtotal  # TODO: validate discount bounds\n","language":"python","filename":"billing.py"}' \
  --payment-protocol x402 \
  --payment-network base \
  --max-amount 0.050

AgentCash CLI documentation

Input example

{
  "before": "def invoice_total(items):\n    return sum(item[\"price\"] for item in items)\n",
  "after": "def invoice_total(items, discount=0):\n    subtotal = sum(item[\"price\"] for item in items)\n    if discount:\n        subtotal *= 1 - discount\n    return subtotal  # TODO: validate discount bounds\n",
  "language": "python",
  "filename": "billing.py"
}

Response shape

View free static sample JSON

{
  "request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a",
  "service": "developer.code-change-review",
  "version": "1",
  "data": {
    "changed": true,
    "filename": "billing.py",
    "language": "python",
    "before": {
      "source": {
        "sha256": "69316f24997a9cbf73019f697f3f2373e39da67d1835885998775037c600a624",
        "characters": 74,
        "utf8Bytes": 74
      },
      "lines": {
        "total": 2,
        "code": 2,
        "comments": 0,
        "blank": 0
      },
      "functions": 1,
      "classes": 0,
      "branchPoints": 1,
      "estimatedCyclomaticComplexity": 2,
      "maximumFunctionComplexity": 2,
      "maintainabilitySignal": 94,
      "syntax": {
        "engine": "python-ast",
        "valid": true,
        "error": null
      }
    },
    "after": {
      "source": {
        "sha256": "f37990278fe5bda7fdae643ec96f54997271ed3992cefdd5f407736c2e843d00",
        "characters": 194,
        "utf8Bytes": 194
      },
      "lines": {
        "total": 5,
        "code": 5,
        "comments": 0,
        "blank": 0
      },
      "functions": 1,
      "classes": 0,
      "branchPoints": 2,
      "estimatedCyclomaticComplexity": 3,
      "maximumFunctionComplexity": 3,
      "maintainabilitySignal": 87,
      "syntax": {
        "engine": "python-ast",
        "valid": true,
        "error": null
      }
    },
    "summary": {
      "lineDelta": 3,
      "codeLineDelta": 3,
      "functionDelta": 0,
      "classDelta": 0,
      "branchPointDelta": 1,
      "complexityDelta": 1,
      "maximumFunctionComplexityDelta": 1,
      "maintainabilityDelta": -7,
      "longLineDelta": 0,
      "workMarkerDelta": 1
    },
    "functionChanges": {
      "addedCount": 0,
      "removedCount": 0,
      "changedCount": 1,
      "added": [],
      "removed": [],
      "changed": [
        {
          "name": "invoice_total",
          "sourceChanged": true,
          "sourceSha256Before": "69316f24997a9cbf73019f697f3f2373e39da67d1835885998775037c600a624",
          "sourceSha256After": "f37990278fe5bda7fdae643ec96f54997271ed3992cefdd5f407736c2e843d00",
          "complexityBefore": 2,
          "complexityAfter": 3,
          "complexityDelta": 1,
          "linesBefore": 2,
          "linesAfter": 5,
          "lineDelta": 3,
          "parametersBefore": 1,
          "parametersAfter": 2,
          "parameterDelta": 1
        }
      ],
      "truncated": false
    },
    "reviewDecision": "review",
    "attentionScore": 2,
    "attentionLevel": "medium",
    "findings": [
      {
        "id": "new-work-markers",
        "severity": "low",
        "message": "The change adds TODO, FIXME, HACK, or XXX markers.",
        "evidence": {
          "added": 1
        }
      }
    ],
    "execution": {
      "codeExecuted": false,
      "networkAccessed": false
    },
    "analysis": {
      "version": "apiacre-code-change-review/1",
      "method": "two deterministic code-metrics snapshots plus Python function-level deltas",
      "limitations": [
        "Static heuristics do not prove runtime behavior, correctness, test coverage, or production safety.",
        "Function-level deltas are complete only when both Python snapshots parse and neither function list is truncated.",
        "Renamed functions appear as one removal and one addition."
      ]
    }
  },
  "meta": {
    "duration_ms": 42,
    "cached": false,
    "sources": [],
    "warnings": [],
    "next_actions": [
      {
        "service": "document.diff",
        "title": "Document diff",
        "reason": "Inspect exact line additions, removals, and a bounded unified diff after reviewing the static syntax, complexity, function, and maintainability deltas. The diff route accepts snapshots up to 500,000 characters each.",
        "method": "POST",
        "path": "/v1/document/diff",
        "price": "$0.01",
        "input_template": {
          "before": "$request.before",
          "after": "$request.after",
          "context_lines": 3
        },
        "use_output": "Review result.data.diff and added/removed counts as caller-supplied line evidence; it does not prove runtime correctness or safety.",
        "handoff_path": "/catalog/document.diff",
        "checkout_path": "/try/document.diff",
        "sample_path": "/samples/document.diff",
        "maximum_atomic_usdc": "10000",
        "handoff_payment_required": false,
        "executes_automatically": false,
        "authorization_required": true
      }
    ]
  }
}

Complete recipes using this API

These buyer-controlled recipes connect this service to compatible API Acre results. Every step has its own exact price and requires separate authorization.

Continue this workflow

These optional follow-ups use this result in a larger workflow. Each call shows a fresh x402 challenge and requires separate buyer authorization.

Try the payment challenge

curl -i -X POST 'https://apiacre.com/v1/developer/code-change-review' \
  -H 'content-type: application/json' \
  --data '{"before":"def invoice_total(items):\n    return sum(item[\"price\"] for item in items)\n","after":"def invoice_total(items, discount=0):\n    subtotal = sum(item[\"price\"] for item in items)\n    if discount:\n        subtotal *= 1 - discount\n    return subtotal  # TODO: validate discount bounds\n","language":"python","filename":"billing.py"}'