btcintel

An agent issues its own t2 key, bound to the key that signs the request

POST /v1/keys/agent
quién puede llamarla
Una sesión
una firma NIP-98
qué cuesta
1 petición de la cuota
niveles y claves
cuán reciente
Nunca en caché
cada respuesta lleva la altura del índice y la del nodo
Herramienta MCP
Ninguna
En esta página

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.

Parámetros

NombreDóndeTipoObligatorioQué hace
labelcuerpostringopcionalWhat the agent calls the key; omitted when none.

El cuerpo es application/json, y puede omitirse.

esquema AgentKeyCreate
  • label string — What the agent calls the key; omitted when none. · como mucho 80 caracteres

Qué responde

201 · application/json

The secret (once) and the key row.

Cabeceras: Cache-Control

CampoTipoQué lleva
secretstringShown once.
keyobjectA key row without its secret.
notestringA reminder that the secret is shown once.
esquema KeyIssued
  • secret string obligatorio — Shown once.
  • key KeyInfo obligatorio — 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. · uno de "btci_", "btci_anon_"
    • tier string — The key's tier. · uno de "t1", "t2", "t4"
    • scopes array de string — What the key may do: its scopes.
    • allowed_npubs array de 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 de 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.

Errores

EstadoCódigoCuándo
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.
409conflictconflict: the state refuses the change, for example a dispute of this caller's already open, a dispute or a claim no longer open, an address that belongs to another account, or a thing done already. The message says which.
422nip98_invalidThe 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.
429quota_exceededquota_exceeded: the caller's tier ran out of requests for the minute or the day. Retry-After says when to try again; every rate-limited answer carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-RateLimit-Tier. While the deployment runs in log-only mode the decision is logged instead and X-RateLimit-Policy: log-only is set.
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.

Cada uno llega en el sobre de error único, y ninguno se guarda en caché: un error lleva Cache-Control: no-store.

Ejemplo

Sin fragmento. Esta ruta pide una sesión iniciada (la cookie que pone btcintel.io) o una firma NIP-98 de tu firmante Nostr, nunca una clave, así que ningún fragmento puede ejecutarla desde una shell. Ver Identidad.