CLI Reference
aon token get
Exchange a saved API key for a 5-minute session token with aon token get
aon token get
Exchange one of your saved API keys for a short-lived session token. The session token is what your agents send to partner APIs instead of your static key — it is valid for 5 minutes.
Usage
aon token get [label]The label is optional. When omitted, the CLI uses the latest saved key.
aon token get:
- Uses the chosen saved key
- Prints the session token to stdout on success
- Prints an error to stderr and exits non-zero on failure
Examples
Use the latest saved key:
aon token getUse a specific key by label:
aon token get productionThe label must match exactly
The label must match one you set with aon save. aon token get production will not match a key saved as Key #1.
Failure modes
| Condition | What happens |
|---|---|
| No key saved yet | Non-zero exit, error message |
| Label does not match a saved key | Non-zero exit, error message |
| API rejects the key | Non-zero exit, error message |
| Network/API failure | Non-zero exit, error message |
Related
aon save— save the key you exchangeaon list— see your saved keys and labelsaon doctor— test that the exchange works