Signed request receipts

You do not have to trust the gateway about what it served. Keep your own copy and check.

The header

Responses carry x-magma-receipt. It encodes the model, a SHA-256 of the canonical prompt, and a timestamp, signed by the gateway.

Verifying

curl https://api.magmarouter.com/v1/verify-receipt \
  -H "content-type: application/json" \
  -d '{"receipt": "rlr1...", "messages": [{"role": "user", "content": "hello"}]}'

The reply says whether the signature is good, which model was served, and whether the messages you posted hash to the digest in the receipt. Change one character of the prompt and prompt_matches goes false.

Why a hash and not the prompt

A digest proves what was sent without the gateway ever having kept it. That is what lets the retention promise and the verification promise coexist.