Authentication
Authenticate to the Silos REST API with an API key passed as a Bearer token.
The Silos API authenticates requests with API keys. You pass the key as a Bearer
token in the Authorization header on every request.
curl https://api.silos.sh/v1/projects \
-H "Authorization: Bearer $SILOS_API_KEY"The API is stabilizing ahead of general availability. The Bearer-token scheme is stable; additional auth options may be added over time.
Creating an API key
You can create keys from the console, or with the CLI:
silos auth keys create "ci-pipeline"This prints the key value once. Store it as a secret — it isn't retrievable later. See silos auth for listing and revoking keys.
Treat API keys like passwords. Never commit them to source control or embed them in client-side code. Inject them as environment variables or secrets, and revoke any key you suspect has leaked.
Using the key
Set the key in your environment and reference it in requests:
export SILOS_API_KEY="your-api-key"
curl https://api.silos.sh/v1/databases \
-H "Authorization: Bearer $SILOS_API_KEY"The same environment variable is read by the CLI, so a single secret works across both.
Unauthorized requests
A request with a missing or invalid key is rejected:
{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}The response uses HTTP status 401 Unauthorized.
Rotating keys
To rotate a key, create a new one, update your secrets to use it, then revoke the old key:
Create a replacement
silos auth keys create "ci-pipeline-v2"Update your secrets
Update your CI/CD secret or environment to the new key and redeploy.
Revoke the old key
silos auth keys revoke key_abc123