client.keys and client.payment require an API key.
Plan API (public)
List API plans — no key required.PlanApi
| Method | Returns | Description |
|---|---|---|
list() | Promise<PlansResponse> | List plans. |
Plan / PlansResponse
- PlansResponse:
{ plans: Plan[] } - Plan:
id,name,requests_per_minute,requests_per_day,allowed_origins,price,price_alph,validity_days
Keys API (admin)
List and create API keys. Requires apiKey.KeysApi
| Method | Returns | Description |
|---|---|---|
list(params?) | Promise<KeysResponse> | List keys; optional user_id filter. |
create(body) | Promise<KeyCreateResponse> | Create a key. |
Types
- KeysResponse:
{ keys: ApiKeyRow[] } - ApiKeyRow:
id,key_prefix,user_id,level,plan_id,allowed_origins,status,created_at,last_payment_at,valid_until - KeyCreateBody:
userId,planId,level?: "user" | "alphscan" | "admin" - KeyCreateResponse:
key,keyId,key_prefix
Payment API (admin)
Payment flow: next index, request, verify, pending, history. Requires apiKey.PaymentApi
| Method | Returns | Description |
|---|---|---|
nextIndex() | Promise<{ next_index: number }> | Next derivation index. |
request(body) | Promise<PaymentRequestResponse> | Create payment request. |
verify(body) | Promise<PaymentVerifyResponse> | Verify payment by tx_id. |
pending(telegram_user_id) | Promise<{ pending: PendingItem[] }> | Pending payments. |
history(telegram_user_id?) | Promise<{ history: HistoryItem[] }> | Payment history. |
Types
- PaymentRequestBody:
derivation_index,deposit_address,telegram_user_id,plan_id,key_id?,amount_alph_min - PaymentRequestResponse:
id,deposit_address,amount_alph_min,plan_id - PaymentVerifyResponse:
success,upgraded?,plan_id?,key_prefix?,key?,keyId? - PendingItem / HistoryItem: see SDK types.

