Issue a btci_ key (ops)
POST /v1/keys- quién puede llamarla
- Un operador
- una persona:
admin - cuán reciente
- Nunca en caché
- cada respuesta lleva la altura del índice y la del nodo
- Herramienta MCP
- Ninguna
En esta página
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.
Parámetros
| Nombre | Dónde | Tipo | Obligatorio | Qué hace |
|---|---|---|---|---|
tier | cuerpo | string | obligatorio | The key's tier: t2, an agent that signs and publishes as its npubs, or t4, the extended quotas. |
scopes | cuerpo | array | opcional | The key's scopes. The tier's own when left out or empty. |
allowed_npubs | cuerpo | array | opcional | 32-byte public keys as 64 hex characters. |
label | cuerpo | string | opcional | A name for the key, trimmed. None when blank. |
expires_at | cuerpo | string | opcional | When the key expires, RFC 3339. Without it the key does not expire. |
operator_id | cuerpo | string | opcional | The operator the key acts as on the ops routes, with the ops:agent or the feedback:read scope. |
El cuerpo es application/json.
esquema
tierstring obligatorio — The key's tier:t2, an agent that signs and publishes as its npubs, ort4, the extended quotas. · uno de "t2", "t4"scopesarray de string — The key's scopes. The tier's own when left out or empty.allowed_npubsarray de string — 32-byte public keys as 64 hex characters.labelstring — A name for the key, trimmed. None when blank.expires_atstring (date-time) — When the key expires, RFC 3339. Without it the key does not expire.operator_idstring — The operator the key acts as on the ops routes, with theops:agentor thefeedback:readscope.
Qué responde
201 · application/json
The secret (once) and the key row.
| Campo | Tipo | Qué lleva |
|---|---|---|
secret | string | The key's secret, btci_…: shown in this answer only. |
key | object | A key row without its secret. |
note | string | A reminder that the secret is shown once. |
esquema
secretstring obligatorio — The key's secret,btci_…: shown in this answer only.keyKeyInfo obligatorio — A key row without its secret.idinteger — The key's id.prefixstring — The secret's prefix:btci_for an issued key,btci_anon_for an anonymous token. · uno de "btci_", "btci_anon_"tierstring — The key's tier. · uno de "t1", "t2", "t4"scopesarray de string — What the key may do: its scopes.allowed_npubsarray de string — The npubs the key publishes and proposes as, 64 hex each. Empty when it has none.labelstring | null — The key's name. Null when it has none.operator_idstring | null — The operator the key acts as on the ops routes. Null for any other key.created_atstring (date-time) — When the key was made.expires_atstring | null (date-time) — When it expires. Null when it does not.last_used_onstring | null — The last UTC day it was used, YYYY-MM-DD. Null until then.revoked_atstring | null (date-time) — When it was revoked. Null while it is live.quotaQuota — What the key's tier allows.requests_per_mininteger — The requests a minute the tier refills, on average.burst_per_mininteger — The most requests the tier lets through at once: its bucket, refilled atrequests_per_min.requests_per_dayinteger — The requests a UTC day the tier allows. 0 sets no daily cap.bulk_max_subjectsinteger — The most subjects one bulk lookup may name. 0 falls back to 20, t0's number.publish_per_dayinteger — 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 thecommunity:publishscope and an allowed npub; t0 and t1 cannot.feedback_per_dayinteger — Feedback entries per caller per UTC day.proposals_per_dayinteger — Curated proposals per caller per UTC day.disputes_per_dayinteger — Disputes per caller per UTC day.scopesarray de string — The scopes of the tier. Absent from a key's row, whose ownscopesstand beside it.
usage_todayobject — What the key has spent today, by route. Only onGET /v1/keys/me; absent when the counts could not be read.totalinteger — The requests counted today, UTC.by_routeobject — Those requests by route.notestring — A reminder that the counts are flushed every minute: the live counter may be ahead.
notestring — A reminder that the secret is shown once.
Errores
| Estado | Código | Cuándo |
|---|---|---|
| 400 | invalid_input | Malformed input (invalid_input). |
| 401 | unauthorized | unauthorized: 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. |
| 501 | not_configured | not_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
curl y jq, en cualquier 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"}' | jqThis 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.