Docs
Keys and quotas
Minting an anonymous token, reading your own key, and the ops routes that issue and revoke keys.
Generated from openapi.yaml (Btcintel native API 0.1.0). Every hash is canonical display order; every answer carries the index and node heights; errors use one envelope — see Semantics.
- POST
/v1/keys/anon— Mint an anonymous t1 token (shown once) - POST
/v1/keys/agent— An agent issues its own t2 key, bound to the key that signs the request - POST
/v1/keys— Issue a btci_ key (ops) - DELETE
/v1/keys/{id}— Revoke a key (ops) - GET
/v1/keys/me— The calling key's tier, quota and usage today
POST /v1/keys/anon
Mint an anonymous t1 token (shown once)
No authentication. Mints a btci_anon_ token of tier t1 (spec S3.1 FR-5): 24 random bytes in lowercase base32, stored only as its SHA-256, valid 90 days and extended by 90 days on every day of use. At most 10 mints per client address per hour. The token is returned once and never logged.
Response 201
The token, its tier and quota.
schema
tokenstring required —btci_anon_…; send it asAuthorization: Bearer.key_idinteger requiredtierstring required · one of "t1"expires_atstring (date-time) requiredquotaQuota requiredrequests_per_minintegerburst_per_minintegerrequests_per_dayintegerbulk_max_subjectsintegerpublish_per_dayintegerfeedback_per_dayinteger — Feedback entries per caller per UTC day (CC-8, spec S3.4).proposals_per_dayinteger — Curated proposals per caller per UTC day (CC-8, spec S5.1 FR-10).disputes_per_dayinteger — Disputes per caller per UTC day (CC-8, spec S5.3 FR-1).scopesarray of string
notestring
Errors
429—quota_exceeded(spec S3.1 FR-4): the caller's tier ran out of requests for the minute or the day.Retry-Aftersays when to try again; every rate-limited answer carriesX-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-ResetandX-RateLimit-Tier. While the deployment runs in log-only mode the decision is logged instead andX-RateLimit-Policy: log-onlyis set.501— The mempool engine is not enabled on this deployment (BITCOIN_ZMQ_SEQUENCEunset).
Example
curl -s -X POST https://api.btcintel.io/v1/keys/anon | jqPOST /v1/keys/agent
An agent issues its own t2 key, bound to the key that signs the request
Spec S5.10 FR-2 (P70, P12, P55). Sign this request with NIP-98 (kind 27235 naming this URL and POST, payload = the SHA-256 of the body when one is sent): the key that signs it is the only npub the new btci_ key of tier t2 is bound to (allowed_npubs), with t2's scopes, valid 90 days. The proof is the signature; btcintel never sees the agent's private key and never signs for it. A session cookie or a bearer is not a proof here (401). The secret is returned once and never logged. At most 10 issuances per client address per hour (429) and three live t2 keys per npub (409, naming when the oldest expires). Send the secret as Authorization: Bearer to the MCP endpoint or the REST routes: publish_community_event then publishes events this npub signs.
- Auth
- An operator credential as the bearer; every call is audited.
Request body (optional)
schema
labelstring — What the agent calls the key; omitted when none. · max length 80
Response 201
The secret (once) and the key row.
Headers: Cache-Control
schema
secretstring required — Shown once.keyKeyInfo required — A key row without its secret (spec S3.1 FR-6).idintegerprefixstring · one of "btci_", "btci_anon_"tierstring · one of "t1", "t2", "t4"scopesarray of stringallowed_npubsarray of stringlabelstring | nulloperator_idstring | nullcreated_atstring (date-time)expires_atstring | null (date-time)last_used_onstring | nullrevoked_atstring | null (date-time)quotaQuotarequests_per_minintegerburst_per_minintegerrequests_per_dayintegerbulk_max_subjectsintegerpublish_per_dayintegerfeedback_per_dayinteger — Feedback entries per caller per UTC day (CC-8, spec S3.4).proposals_per_dayinteger — Curated proposals per caller per UTC day (CC-8, spec S5.1 FR-10).disputes_per_dayinteger — Disputes per caller per UTC day (CC-8, spec S5.3 FR-1).scopesarray of string
usage_todayobjecttotalintegerby_routeobjectnotestring
notestring
Errors
400— Malformed input (invalid_input).401— Missing or invalid bearer (unauthorized).409— The state refuses the change (conflict): an open dispute by this caller exists already, or the dispute or claim is not open any more.422— The NIP-98 event was refused (nip98_invalid): wrong URL or method, stale, bad signature, wrong payload hash, or used before; the message names the reason.429—quota_exceeded(spec S3.1 FR-4): the caller's tier ran out of requests for the minute or the day.Retry-Aftersays when to try again; every rate-limited answer carriesX-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-ResetandX-RateLimit-Tier. While the deployment runs in log-only mode the decision is logged instead andX-RateLimit-Policy: log-onlyis set.501— The mempool engine is not enabled on this deployment (BITCOIN_ZMQ_SEQUENCEunset).
Example
curl -s -X POST https://api.btcintel.io/v1/keys/agent \
-H 'Authorization: Bearer $BTCI_KEY' \
-H 'Content-Type: application/json' \
-d '{}' | jqAn operator credential: the ops bearer or a btci_ key with the ops:agent scope.
POST /v1/keys
Issue a btci_ key (ops)
Ops bearer today; the operator scope of S3.3 later. Tier t2 (an agent that signs, bound to its npubs) or t4 (extended quotas). The secret is returned once.
- Auth
- An operator credential as the bearer; every call is audited.
Request body
schema
tierstring required · one of "t2", "t4"scopesarray of stringallowed_npubsarray of string — 32-byte public keys as 64 hex characters.labelstringexpires_atstring (date-time)operator_idstring
Response 201
The secret (once) and the key row.
schema
secretstring requiredkeyKeyInfo required — A key row without its secret (spec S3.1 FR-6).idintegerprefixstring · one of "btci_", "btci_anon_"tierstring · one of "t1", "t2", "t4"scopesarray of stringallowed_npubsarray of stringlabelstring | nulloperator_idstring | nullcreated_atstring (date-time)expires_atstring | null (date-time)last_used_onstring | nullrevoked_atstring | null (date-time)quotaQuotarequests_per_minintegerburst_per_minintegerrequests_per_dayintegerbulk_max_subjectsintegerpublish_per_dayintegerfeedback_per_dayinteger — Feedback entries per caller per UTC day (CC-8, spec S3.4).proposals_per_dayinteger — Curated proposals per caller per UTC day (CC-8, spec S5.1 FR-10).disputes_per_dayinteger — Disputes per caller per UTC day (CC-8, spec S5.3 FR-1).scopesarray of string
usage_todayobjecttotalintegerby_routeobjectnotestring
notestring
Errors
400— Malformed input (invalid_input).401— Missing or invalid bearer (unauthorized).501— The mempool engine is not enabled on this deployment (BITCOIN_ZMQ_SEQUENCEunset).
Example
curl -s -X POST https://api.btcintel.io/v1/keys \
-H 'Authorization: Bearer $BTCI_KEY' \
-H 'Content-Type: application/json' \
-d '{"tier":"t4","label":"harness"}' | jqAn operator credential: the ops bearer or a btci_ key with the ops:agent scope.
DELETE /v1/keys/{id}
Revoke a key (ops)
- Auth
- An operator credential as the bearer; every call is audited.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id required | path | integer | — |
reason | query | string | — |
Response 200
Revoked; the key stops resolving within a minute.
schema
revokedintegerreasonstring
Errors
400— Malformed input (invalid_input).401— Missing or invalid bearer (unauthorized).404— Unknown to the index and, for transactions, to the node mempool.
Example
curl -s -X DELETE https://api.btcintel.io/v1/keys/12 \
-H 'Authorization: Bearer $BTCI_KEY' | jqAn operator credential: the ops bearer or a btci_ key with the ops:agent scope.
GET /v1/keys/me
The calling key's tier, quota and usage today
- MCP tool
get_auth_identity— see For agents- Auth
- An operator credential as the bearer; every call is audited.
Response 200
The key without its secret.
schema
idintegerprefixstring · one of "btci_", "btci_anon_"tierstring · one of "t1", "t2", "t4"scopesarray of stringallowed_npubsarray of stringlabelstring | nulloperator_idstring | nullcreated_atstring (date-time)expires_atstring | null (date-time)last_used_onstring | nullrevoked_atstring | null (date-time)quotaQuotarequests_per_minintegerburst_per_minintegerrequests_per_dayintegerbulk_max_subjectsintegerpublish_per_dayintegerfeedback_per_dayinteger — Feedback entries per caller per UTC day (CC-8, spec S3.4).proposals_per_dayinteger — Curated proposals per caller per UTC day (CC-8, spec S5.1 FR-10).disputes_per_dayinteger — Disputes per caller per UTC day (CC-8, spec S5.3 FR-1).scopesarray of string
usage_todayobjecttotalintegerby_routeobjectnotestring
Errors
401— Missing or invalid bearer (unauthorized).
Example
curl -s https://api.btcintel.io/v1/keys/me \
-H 'Authorization: Bearer $BTCI_KEY' | jq '{id, prefix, tier}'An operator credential: the ops bearer or a btci_ key with the ops:agent scope.