Summit CognitiveDocs

GUIDE

Examples & recipes

A cookbook of short, real curl recipes you can run against the live API at https://decrec.summitcognitive.ai. Read endpoints need no auth; write endpoints take X-API-Key. Each block stands alone — copy, fill in your key, run.

Setup

Most recipes assume jq for readability and a key in $API_KEY. Get one with recipe 1, then export API_KEY="sk_decrec_<your-key>".

Keys & health

1 · Get an API key

Issues a free-tier key (100 requests/hour). Re-using the same email returns the existing key.

curl -s https://decrec.summitcognitive.ai/v1/signup \
  -H "Content-Type: application/json" \
  -d '{"email":"dev@example.com"}' | jq -r .api_key

2 · Check service health

No auth. Add ?deep=true to include database connectivity (returns 503 if any component is down).

curl -s https://decrec.summitcognitive.ai/health | jq .
curl -s "https://decrec.summitcognitive.ai/health?deep=true" | jq .

The core flow

3 · Evaluate → extract receipt → verify

The canonical happy path: submit a claim, pull the signed receipt out of the response, and verify its integrity in one chain.

curl -s https://decrec.summitcognitive.ai/v1/evaluate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "claim_id": "demo-001",
    "entity": "acme-corp/widget-api",
    "claim": "PR #42: Add input validation",
    "sources": [
      { "id": "evd_test_1", "type": "test_result",
        "uri": "https://github.com/acme-corp/widget-api/actions/runs/99",
        "confidence": 0.9, "content": "All tests passing" },
      { "id": "evd_review_1", "type": "code_review",
        "uri": "https://github.com/acme-corp/widget-api/pull/42",
        "confidence": 0.85, "content": "Approved by two reviewers" }
    ]
  }' | tee /tmp/eval.json | jq '.policy.verdict, .receipt.admissibility.status'

# verify the receipt that came back
jq '.receipt' /tmp/eval.json | \
  curl -s https://decrec.summitcognitive.ai/v1/verify \
    -H "Content-Type: application/json" -d @- | jq '.valid, .checks'

4 · Dry-run a strict policy (no receipt persisted)

/v1/simulate evaluates a claim against a policy without writing a receipt — ideal for testing a policy before you enforce it.

curl -s https://decrec.summitcognitive.ai/v1/simulate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "claim_id": "sim-001",
    "entity": "acme-corp/infra",
    "claim": "Production deploy",
    "sources": [ /* ... */ ],
    "policyConfig": {
      "minSources": 3, "minSourceTypes": 3,
      "minConfidence": 0.8, "requireProvenance": true,
      "requireHumanApproval": true, "maxRiskScope": 3
    }
  }' | jq '.policy.verdict, .policy.rules'

Read the ledger

5 · Aggregate stats

No auth. Totals across every receipt, plus the agents and repositories seen.

curl -s https://decrec.summitcognitive.ai/v1/ledger/stats | jq .

6 · Search receipts

Filter by free text, agent, repo, or verdict.

curl -s "https://decrec.summitcognitive.ai/v1/receipts/search?agent=claude-code&verdict=ALLOWED" | jq .

7 · Diff a PR's receipts across pushes

See how a pull request's receipts changed from one push to the next.

curl -s "https://decrec.summitcognitive.ai/v1/receipts/diff?repository=acme-corp/widget-api&pr=42" | jq .

8 · Compare two receipts side by side

curl -s "https://decrec.summitcognitive.ai/v1/receipts/compare?ids=dr-aaa,dr-bbb" | jq .

Integrate

9 · Register an outbound webhook

Get notified on receipt.created so you can post a verdict back to a PR, a channel, or your own store. See Webhooks.

curl -s https://decrec.summitcognitive.ai/v1/webhooks/outbound \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{"url":"https://your-app.example.com/hooks/decrec","event":"receipt.created"}' | jq .

10 · Fetch the server public key (offline verification)

The Ed25519 public key in PEM, so a third party can verify a receipt's signature without trusting the API. See Verifying receipts.

curl -s https://decrec.summitcognitive.ai/v1/keys/server > server-key.pem
More

Try these interactively in the playground, and see the full contract — every field, header, and status code — in the API reference.