Skip to content

Quickstart

Get a first successful local inspection in five minutes after the API is already listening on http://localhost:5150. Cold Postgres bring-up and the first Rust compile are prerequisites outside that clock.

From the repository root:

  1. Start Postgres 18.7: just db-up. If you ran an older checkout that used Postgres 16, drop its volume first with docker compose down -v, which permanently deletes that local database, so export anything you need before running it
  2. Start the API and wait until it listens: just start (default http://localhost:5150)
  3. Have curl available (jq optional)
Terminal window
curl -fsS http://localhost:5150/health/ready

Expect JSON with "status":"ready". "inference":"not_loaded" is normal on this scaffold — no weights are loaded.

Start the API with ANANZI_OPERATOR_TOKEN exported (any non-empty value locally) and send the same value as a Bearer token; the route refuses without it.

Terminal window
curl -fsS http://localhost:5150/v1/accounts \
-H 'content-type: application/json' \
-H "authorization: Bearer $ANANZI_OPERATOR_TOKEN" \
-d '{"organization_name":"Quickstart Org"}'

Save api_key.key once. It is shown only on create:

Terminal window
export ANANZI_API_KEY='paste-the-raw-key-here'
Terminal window
curl -fsS http://localhost:5150/v1/inspect \
-H 'content-type: application/json' \
-H "Authorization: Bearer ${ANANZI_API_KEY}" \
-H 'Idempotency-Key: demo-1' \
-d '{
"content":"AKIAIOSFODNN7EXAMPLE",
"source":"user_prompt",
"checks":["secrets"]
}'

Expect a 200 body shaped like:

{
"request_id": "…",
"decision": "review",
"findings": [
{
"category": "secrets",
"detector": "secrets-rules",
"version": "mvp-0",
"score": null,
"severity": "high"
}
],
"usage": { "units": 1 }
}

That sample charges 1 because the content is shorter than 1024 bytes: units are ceil(content_bytes / 1024), not a constant. Reuse the same Idempotency-Key when you retry that call; a second success does not add another charge. A new logical call needs a new key. The example key is the AWS documentation sample. Do not treat this body as permission to store it.

Repeat the inspect call with content that is not an MVP secret and checks: ["secrets"]. Expect decision: "no_findings" and an empty findings array when the scanner completes. checks: ["prompt_injection"] returns 503 detector_failed until a model is loaded. That is not no_findings.

When a model is loaded, successful prompt_injection responses report prompt_injection_truncated. If it is true, some submitted text was outside the model context. A no_findings response then covers only the inspected prefix.

  • prompt_injection — registered, fails closed (detector_failed), not mock / scaffold-0
  • secrets — registered rules scanner (secrets-rules / mvp-0). A match recommends review.

Limits: 512-token model context, special tokens included (longer text is right-truncated; the response sets prompt_injection_truncated when coverage is known), content 4096 bytes, HTTP body 32 KiB, request timeout 3 seconds, inference timeout 2 seconds. The latency target is p50 at most 100 ms and p95 at most 500 ms, warm, one request in flight, on a local Apple M2 container basis, covering tokenization and inference only. It is a target, not an SLA, and is unmeasured at 512 tokens (ADR 0039, ADR 0040).

Next: Authentication · Errors