Appearance
Authentication
This page defines how clients authenticate to Aionis APIs in production.
Supported modes
- API key via
X-Api-Key. - Bearer token via
Authorization: Bearer <token>. - Admin token via
X-Admin-Tokenfor admin/control endpoints.
Recommended production posture
- Use API keys or JWT in data-plane traffic.
- Keep admin token isolated from app/runtime credentials.
- Rotate credentials and scope them per environment.
- Keep one auth strategy per environment to reduce debugging ambiguity.
Example requests
cURL
bash
curl -sS "$BASE_URL/v1/memory/recall_text" \
-H 'content-type: application/json' \
-H "X-Api-Key: $API_KEY" \
-d '{"tenant_id":"default","scope":"default","query_text":"auth check","limit":1}'TypeScript
ts
await client.recallText({
tenant_id: 'default',
scope: 'default',
query_text: 'auth check',
limit: 1
})Python
python
client.recall_text({
'tenant_id': 'default',
'scope': 'default',
'query_text': 'auth check',
'limit': 1,
})Common issues
401/403: invalid header name or invalid credential value.- Mixed auth modes across environments.
- Using admin token for normal data-plane calls.
- Forgetting to update automation, worker, or replay jobs after credential rotation.
Error example and fix
Example error:
json
{
"error": "unauthorized",
"message": "missing or invalid credentials"
}Fix:
- Verify the header name matches your auth mode (
X-Api-KeyvsAuthorization). - Verify token/key belongs to target tenant and environment.
- Retry with the same payload after correcting credentials.