Authentication
The Opsion API uses API keys for authentication. Every request must include a valid key in theAuthorization header. The console and dashboard use session cookies — API keys are exclusively for programmatic access.
Plan requirement
Enterprise plan required
API key access is available on the Enterprise and Custom plans. Upgrade from Settings → Plan in the console.Generating keys
Generate API keys from Settings → API Keys in the console. The full key is shown once at creation time and cannot be retrieved afterwards — store it immediately in an environment variable or secrets manager.
Keys use the prefix opsk_ followed by 40 random hex characters, for example:
opsk_a3f9e2b1c4d7f8a0e5b2c9d3f6a1e4b7c0d2f5a8Keep keys secret
Never commit API keys to source control or expose them in client-side code. Use environment variables or a secrets manager such as AWS Secrets Manager, HashiCorp Vault, or Doppler.Making requests
Pass your API key as a Bearer token in the Authorization header:
curl https://api.opsion.xyz/api/wallets \
-H "Authorization: Bearer opsk_your_key_here"const res = await fetch('https://api.opsion.xyz/api/wallets', {
headers: {
Authorization: `Bearer ${process.env.OPSION_API_KEY}`,
},
})
const data = await res.json()import httpx
headers = {"Authorization": f"Bearer {OPSION_API_KEY}"}
r = httpx.get("https://api.opsion.xyz/api/wallets", headers=headers)
data = r.json()Rotating keys
Rotate a key without downtime: create a new key, update your application to use it, then revoke the old key from the console. Revocation is immediate.
