btcintel

Issue a btci_ key (ops)

POST /v1/keys
who may call it
An operator
a human: admin
what it costs
1 request of the quota
tiers and keys
how fresh
Never cached
every answer carries the index's height and the node's
MCP tool
None
On this page

Ops bearer today; the operator scope later. Tier t2 (an agent that signs, bound to its npubs) or t4 (extended quotas). The secret is returned once.

Parameters

NameWhereTypeRequiredWhat it does
tierbodystringrequiredThe key's tier: t2, an agent that signs and publishes as its npubs, or t4, the extended quotas.
scopesbodyarrayoptionalThe key's scopes. The tier's own when left out or empty.
allowed_npubsbodyarrayoptional32-byte public keys as 64 hex characters.
labelbodystringoptionalA name for the key, trimmed. None when blank.
expires_atbodystringoptionalWhen the key expires, RFC 3339. Without it the key does not expire.
operator_idbodystringoptionalThe operator the key acts as on the ops routes, with the ops:agent or the feedback:read scope.

The body is application/json.

schema
  • tier string required — The key's tier: t2, an agent that signs and publishes as its npubs, or t4, the extended quotas. · one of "t2", "t4"
  • scopes array of string — The key's scopes. The tier's own when left out or empty.
  • allowed_npubs array of string — 32-byte public keys as 64 hex characters.
  • label string — A name for the key, trimmed. None when blank.
  • expires_at string (date-time) — When the key expires, RFC 3339. Without it the key does not expire.
  • operator_id string — The operator the key acts as on the ops routes, with the ops:agent or the feedback:read scope.

What it answers

201 · application/json

The secret (once) and the key row.

FieldTypeWhat it carries
secretstringThe key's secret, btci_…: shown in this answer only.
keyobjectA key row without its secret.
notestringA reminder that the secret is shown once.
schema
  • secret string required — The key's secret, btci_…: shown in this answer only.
  • key KeyInfo required — A key row without its secret.
    • id integer — The key's id.
    • prefix string — The secret's prefix: btci_ for an issued key, btci_anon_ for an anonymous token. · one of "btci_", "btci_anon_"
    • tier string — The key's tier. · one of "t1", "t2", "t4"
    • scopes array of string — What the key may do: its scopes.
    • allowed_npubs array of string — The npubs the key publishes and proposes as, 64 hex each. Empty when it has none.
    • label string | null — The key's name. Null when it has none.
    • operator_id string | null — The operator the key acts as on the ops routes. Null for any other key.
    • created_at string (date-time) — When the key was made.
    • expires_at string | null (date-time) — When it expires. Null when it does not.
    • last_used_on string | null — The last UTC day it was used, YYYY-MM-DD. Null until then.
    • revoked_at string | null (date-time) — When it was revoked. Null while it is live.
    • quota Quota — What the key's tier allows.
      • requests_per_min integer — The requests a minute the tier refills, on average.
      • burst_per_min integer — The most requests the tier lets through at once: its bucket, refilled at requests_per_min.
      • requests_per_day integer — The requests a UTC day the tier allows. 0 sets no daily cap.
      • bulk_max_subjects integer — The most subjects one bulk lookup may name. 0 falls back to 20, t0's number.
      • publish_per_day integer — The Community events a UTC day each author may publish through the API at this tier. 0 sets no daily cap. Who may publish at all is decided apart: a person signed in with their key, or a key with the community:publish scope and an allowed npub; t0 and t1 cannot.
      • feedback_per_day integer — Feedback entries per caller per UTC day.
      • proposals_per_day integer — Curated proposals per caller per UTC day.
      • disputes_per_day integer — Disputes per caller per UTC day.
      • scopes array of string — The scopes of the tier. Absent from a key's row, whose own scopes stand beside it.
    • usage_today object — What the key has spent today, by route. Only on GET /v1/keys/me; absent when the counts could not be read.
      • total integer — The requests counted today, UTC.
      • by_route object — Those requests by route.
      • note string — A reminder that the counts are flushed every minute: the live counter may be ahead.
  • note string — A reminder that the secret is shown once.

Errors

StatusCodeWhen
400invalid_inputMalformed input (invalid_input).
401unauthorizedunauthorized: the request does not say who makes it, or what it offers does not verify: no key or session where one is needed, or a password, a code, a passkey or a signed event that does not check. The message says what is missing.
501not_configurednot_configured: this deployment does not run what the route needs, for example the mempool engine, accounts, the intel store or watchlists. The message names it.

Each comes in the one error envelope, and none is cached: an error carries Cache-Control: no-store.

Example

curl and jq, in any shell.

curl -s -X POST https://api.btcintel.io/v1/keys \
  -H "Authorization: Bearer $BTCINTEL_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"tier":"t4","label":"harness"}' | jq

This route needs a key. Set BTCINTEL_KEY in your environment first: the snippet reads it from there and holds no key. The description above names the tiers the route takes.