Skip to main content
PATCH
/
api
/
v1
/
admin
/
credentials
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"}'
{
  "message": "Credentials updated",
  "restarted": ["alfred", "openclaw"]
}
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
string | null
OpenRouter API key. Routes to 200+ models.
ANTHROPIC_API_KEY
string | null
Anthropic API key. For direct Claude access.
OPENAI_API_KEY
string | null
OpenAI API key. For GPT-4 and other OpenAI models.
XAI_API_KEY
string | null
xAI API key. For Grok models.
GOOGLE_API_KEY
string | null
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

message
string
Confirmation message.
restarted
string[]
List of containers that were restarted to pick up the new credentials. Always ["alfred", "openclaw"].

Request Example

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

{
  "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.