(org_id, api_key_hash) and can’t reverse-lookup the org from the key without scanning.
Get your credentials
Both values come from the XTrace web app:- Sign in at app.xtrace.ai
- Open Settings → API Keys (or your organization page)
- Copy your Org id and create a new API key (
xtk_…)
Headers
| Error | Cause |
|---|---|
400 missing_org_id | No X-Org-Id header |
401 | Missing or invalid API key |
403 org_mismatch | X-Org-Id doesn’t match the org the key belongs to |
Using the SDK
The SDK builds both headers from constructor options:Storing credentials
Never commit API keys to source control. Use environment variables, a secrets manager (AWS Secrets Manager, GCP Secret Manager, 1Password CLI), or a
.env file that’s in .gitignore..env
Rotating a key
If a key leaks, treat it like any other credential incident:- Issue a new key from your org admin tool
- Roll the new key into your environment / secrets manager
- Revoke the old key
Browser vs server
The SDK works in both Node 18+ and modern browsers (it uses nativefetch). Don’t ship API keys to a browser — proxy memory-API calls through your own backend so the key never leaves the server.