Home / Home / Errors / Error: invalid_api_key

Error: invalid_api_key

The Authorization header was supplied but couldn't be resolved to a valid API key. sipi.bot never silently downgrades an invalid paid key to anonymous behavior — it rejects the request.

What it means

The request carried an Authorization header, but the token is not a valid API key: wrong format, revoked, or unresolved.

This is a hard 401 — no evaluation happens, no decision is returned, nothing is logged as spend.

Common causes

Missing "Bearer " prefix, or an empty token after it.

A typo'd or truncated key.

A revoked or expired key (hosted plans).

Using a dashboard key where a transaction key is expected.

How to fix

Check the key is complete and copied exactly.

Issue a fresh key from the dashboard (or via the agents API on self-host).

If you self-host, confirm the key store (SQLite) is mounted and writable.

At a glance

FieldValue
HTTP status401
Error codeinvalid_api_key
Response shape{"error": "invalid_api_key"}
EvaluationNot attempted

Example request & response

curl -X POST https://sipi.bot/v1/transactions/evaluate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer bad-key" \
  -d '{"amount": 100, "merchant": "demo"}'

HTTP/1.1 401
{"error": "invalid_api_key"}

Fix the key and retry. A valid key returns APPROVED, BLOCKED, or FLAGGED.

FAQ

Is auth required to evaluate transactions?

No — the evaluate endpoint works anonymously in free/self-host mode. If you send an Authorization header, it must resolve to a valid key; invalid keys are rejected, never downgraded.

What status does a missing key return?

On protected routes (rules, approvals, dashboard), a missing key returns api_key_required. The evaluate endpoint treats a missing header as anonymous.

Where do I get a valid key?

Hosted plans issue keys via the checkout flow (sk_live_ keys are minted server-side). Self-hosted deployments create keys through the agents API with the admin token.

Related

Stop the next $12,400 night.

One API call (or MCP tool) in front of every agent transaction — APPROVED, BLOCKED, or FLAGGED, deterministic, ~5 ms, fully logged.

See plans — from $99/mo Try a live check