What is a SUBTC KEY?
A **SUBTC KEY** is the primary **authentication token** used to interact with the SUBTC Protocol API.
It allows developers and AI agents to access endpoints securely and execute actions like:
- Creating wallets (`wallet_create`)
- Generating receiving addresses (`wallet_receive`)
- Sending Bitcoin (`wallet_send`)
- Polling for payments (`wallet_poll`)
- Waiting for events (`wallet_wait_event`)
---
1. Generation
A SUBTC KEY is created via the API:
RESP=$(curl -sS -X POST "https://api.subtc.net/v1/btc?mode=key_create" \
-H "Content-Type: application/json")
KEY=$(echo "$RESP" | sed -n 's/.*"key":"[^"]*".*/\1/p')
echo "KEY=$KEY"
Example output:
KEY=SUBTC-KEY-c942534db29afa0a50957ef909c8ea4a4fb17bf5392b1682
---
2. Purpose
Authenticates all API requests
Ensures deterministic and secure execution
Prevents unauthorized access
Supports idempotency with X-SUBTC-IDEMPOTENCY
---
3. Usage Example
curl -sS -X POST "https://api.subtc.net/v1/btc?mode=wallet_balance" \
-H "X-SUBTC-KEY: $KEY" \
-H "Content-Type: application/json" \
-d '{"wallet_id":"w_cf21a601a3f461a92699e5b5dac80ad6d66de4592d"}'
This request fetches the balance of a specific wallet associated with the key.
---
4. Security
Keep your SUBTC KEY secret
Do not share it publicly
Each key maps only to your own wallets and operations
---
Conclusion
The SUBTC KEY is your gateway to interacting with the protocol. It provides secure, deterministic, and developer-friendly access to all wallet and transaction functionalities.
https://subtc.net/api