Updates one or more credential values in the tenant’s .env file. After updating, the alfred and openclaw containers are automatically restarted so the new credentials take effect.
Request Body
The request body is a JSON object where keys are credential names and values are either a string (to set) or null (to remove).
OpenRouter API key. Routes to 200+ models.
Anthropic API key. For direct Claude access.
OpenAI API key. For GPT-4 and other OpenAI models.
xAI API key. For Grok models.
Google API key. For Gemini and other Google AI models.
You can update multiple credentials in a single request. Only include the keys you want to change. Pass null as the value to remove a credential.
Response
List of containers that were restarted to pick up the new credentials. Always ["alfred", "openclaw"].
Request Example
cURL — Set a credential
cURL — Set multiple credentials
cURL — Remove a credential
JavaScript
curl -X PATCH https://alfred.black/api/v1/admin/credentials \
-H "Authorization: Bearer alf_your_key_here" \
-H "Content-Type: application/json" \
-d '{"OPENROUTER_API_KEY": "sk-or-v1-your-key-here"}'
Response Example
200 OK
400 Bad Request — Unknown key
400 Bad Request — Protected key
400 Bad Request — Invalid value type
401 Unauthorized
{
"message" : "Credentials updated" ,
"restarted" : [ "alfred" , "openclaw" ]
}
Updating credentials restarts the alfred and openclaw containers. Any in-progress agent operations will be interrupted. Time credential updates for when your agents are idle.