Documentation Index
Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Synap uses API keys for all SDK authentication. One key, one environment variable — that’s all you need.Getting your API key
- Log in to the Synap Dashboard
- Navigate to your instance
- Click API Keys in the instance detail page
- Click Generate API Key, give it a label, and copy the key
synap_ and look like this:
Using the API key
Option 1: Environment variable (recommended)
SetSYNAP_API_KEY:
Option 2: Constructor parameter
Pass the key directly:Priority order
Wheninitialize() is called, the SDK resolves credentials in this order:
api_keyparameter passed to the constructorSYNAP_API_KEYenvironment variable
initialize() raises an AuthenticationError.
Multiple keys per instance
You can generate multiple API keys for the same instance. Each key has a label and can be revoked independently. Common patterns:| Label | Usage |
|---|---|
production | Your production servers |
staging | Staging/preview environment |
ci | CI/CD pipeline |
dev-alice | Developer’s local machine |
dev-bob | Another developer |
JavaScript SDK
The JavaScript SDK is a wrapper around the Python SDK and requires a Python 3.11+ runtime on the host. Edge Runtime, Cloudflare Workers, Bun, Deno Deploy, and AWS Lambda Node-only runtimes are not supported — see Installation → JavaScript / TypeScript SDK.
Security best practices
Never commit API keys to version control
Never commit API keys to version control
Use
.env files (added to .gitignore) or your platform’s secrets manager. GitHub’s secret scanning will flag leaked synap_ keys automatically.Use separate keys per environment
Use separate keys per environment
Generate a different key for development, staging, CI, and production. If one leaks, revoke only that key — the others continue working.
Rotate keys periodically
Rotate keys periodically
Generate a new key, update your environment, verify it works, then revoke the old one. There’s no expiry deadline — rotate on your own schedule.
Serverless and edge deployments
Serverless and edge deployments
API keys work everywhere — Vercel, AWS Lambda, Cloudflare Workers, Docker, Kubernetes. Set
SYNAP_API_KEY in your platform’s environment configuration and you’re done. No file I/O, no extra setup step.Troubleshooting
| Error | Cause | Fix |
|---|---|---|
AuthenticationError: No Synap API key found | SDK can’t find credentials anywhere | Set SYNAP_API_KEY env var or pass api_key= to constructor |
AuthenticationError: Invalid credentials | Key is wrong, revoked, or malformed | Check the key in your dashboard — is it active? |