How can I test my API key?
Send two requests before you trust it: one with no key at all, and one with a made-up key in the header the API documents. If the two answers differ, the API tells you whether a key reached it, and the answer to your rea
Send two requests before you trust it: one with no key at all, and one with a made-up key in the header the API documents. If the two answers differ, the API tells you whether a key reached it, and the answer to your real key means something. If the two answers are the same, a 401 cannot tell you whether your key arrived, and only a call that has to succeed proves the key works.
I sent exactly these two requests to six hosted memory APIs on 19 November 2026. Every request got a 401. Two APIs changed the message between the two requests, and four did not.
| API (documented header) | No key | Made-up key in the documented header |
|---|---|---|
Hindsight Cloud (Authorization: Bearer) |
"Authentication failed: API key required" | "Authentication failed: Invalid API key format" |
Mnemoverse (X-Api-Key) |
"Missing API key. Send X-Api-Key header." | "This value does not have the shape of a Mnemoverse API key (mk_live_ followed by 32 lower-case hex characters)" |
Letta Cloud (Authorization: Bearer) |
"Unauthorized" | the same |
Mem0 Platform (Authorization: Token) |
"Invalid API key. You can find your API key on https://app.mem0.ai/dashboard/api-keys." | the same |
Supermemory (Authorization: Bearer) |
"Unauthorized" | the same |
Zep (Authorization: Api-Key) |
"unauthorized" | the same |
Why a right key can still fail to arrive
An SDK sets the header for you. A proxy, a CI secret, a plain curl call or an MCP client configuration does not, and these six APIs alone use four ways to send a key: Bearer, Token and Api-Key in the Authorization header, and a separate X-Api-Key header. A key in a header the server does not read is, for the server, no key at all. At the four APIs that answer both requests the same way, that mistake looks exactly like a wrong key.
The two-minute check
URL=https://api.vendor.example/v1/some-endpoint
curl -s -w ' %{http_code}\n' "$URL"
curl -s -w ' %{http_code}\n' "$URL" -H "Authorization: Bearer not-a-real-key"
curl -s -w ' %{http_code}\n' "$URL" -H "Authorization: Bearer $KEY"
Put the header your vendor documents in the second and third lines. If the first two answers differ, the third one tells you what happened to your key: the "missing" message means the header was not read, the "invalid" message means the key arrived and was rejected, and a 200 means it works. If the first two answers are the same, a 401 on the third line proves nothing, so test the key with a request that has to succeed, such as listing your own resources.
Sources and method. The requests were sent on 19 November 2026 with curl from one machine, one at a time, with the made-up key probe-not-a-real-key-0000000000; the answers are quoted as the APIs returned them that day. The same requests on 17 November got the same answers. No accounts or keys were created. This article describes the APIs as of 19 November 2026.
I work on Mnemoverse; this comparison uses the same two requests for every API, Mnemoverse included.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.