What a stored key changes #
A team that stores an Anthropic or OpenAI API key pays for its own caption model calls. Every generate and match call of the team, in every space, is then made with that key at that provider, and the provider bills your account for it.
A call your key pays for does not count toward the daily cap, and a team with a stored key is not refused at the cap.
The key is stored encrypted, and it is left out of every response and every log. A read tells you whether a key is stored, when it was stored, its provider and its last four characters.
While a key is stored, each meme your team creates is charged at the lower price for teams with their own key. Usage shows the count at each price.
The platform's key is never used in place of a stored key. If the provider rejects your key, generate and match return 402 until you store a working key or delete the stored one.
Store a key #
PUT /v1/settings/model-key
Storing a key decides which account pays for your team's model calls, so it takes an owner or an admin API key.
| Field | Type | What it does |
|---|---|---|
provider |
string | anthropic or openai. Required. |
apiKey |
string, 20 to 400 characters | Your API key with that provider. An Anthropic key starts with sk-ant- and an OpenAI key with sk-. Required. |
curl -X PUT https://api.memelemur.com/v1/settings/model-key \
-H "Authorization: Bearer $MEMELEMUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d "{\"provider\": \"anthropic\", \"apiKey\": \"$ANTHROPIC_API_KEY\"}"{ "modelKey": { "set": true, "setAt": "2026-10-02T00:58:17.162Z", "lastFour": "aB3x", "provider": "anthropic" } }Storing a key again replaces the one that was stored. The key is not checked with the provider when you store it, so make a generate call afterwards to see that it works.
Read whether a key is stored #
GET /v1/settings/model-key
curl https://api.memelemur.com/v1/settings/model-key \
-H "Authorization: Bearer $MEMELEMUR_KEY"{ "modelKey": { "set": false, "setAt": null, "lastFour": null, "provider": null } }Delete the stored key #
DELETE /v1/settings/model-key
Removes the key and returns 204 with no body. Your team's calls go back to the platform's key and count toward the daily cap again.
curl -X DELETE https://api.memelemur.com/v1/settings/model-key \
-H "Authorization: Bearer $MEMELEMUR_ADMIN_KEY"Errors #
| Status | When |
|---|---|
| 400 | provider is missing or is not a supported provider, or apiKey is missing, is shorter than 20 characters, or does not start the way that provider's keys do. |
| 402 | On generate and match: the provider rejected the stored key. Store a working key, or delete this one to use the platform's. |
| 403 | A signed-in member or editor, or a regular API key, tried to store or delete the key. An owner or an admin API key can. Everyone can read whether one is stored. |
| 503 | Storing and reading return this when the platform has not turned stored keys on. Generate and match return it when the stored key can no longer be read, and the message says to store the key again. |