REST API v1.0.0 / Reseller Commerce Gateway

Developer & Reseller REST API

Welcome to the programmatic API reference for Muse Runner. Connect your storefront, automated Telegram bot, or commerce backend to purchase instant ready-made accounts and high-concurrency referral boosts with zero-touch delivery.

Base URL: https://api.artificial.ai.id
Protocol: HTTPS / TLS 1.3
Rate Limit: 120 req / 60s
Payload: application/json
Concurrency: Hundreds of Workers
01

Authentication & Secret Keys

RFC 6750 Bearer

All reseller operations require programmatic authentication via secret API keys. Generate your secret key through the Telegram Bot menu using /api. Keys carry the prefix muse_live_ followed by a 64-character cryptographic hash.

Constant-Time Timing Guard: Incoming keys are validated in constant time via hmac.compare_digest() to eliminate side-channel timing attack vulnerabilities. In-memory TTL caching guarantees sub-millisecond authorization.
Request Headers HTTP Transport
Header Description
Authorization
string • required
Standard RFC 6750 HTTP Bearer authentication token: Bearer muse_live_...
X-API-Key
string • optional
Direct API key header accepted as alternative to Bearer header without prefix.
Content-Type
string • required for POST/PUT
Must be explicitly set to application/json for all mutating endpoints.
Req:
curl -X GET https://api.artificial.ai.id/api/v1/reseller/me \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json"
02

Cryptographic Security & Hash Verification

HMAC-SHA256 & Anti-Replay

Protect your integration from packet tampering, unauthorized webhook injection, and replay attacks with enterprise cryptographic standards:

•
Deterministic HMAC-SHA256 Signatures: Every outgoing webhook notification carries an X-Muse-Signature header. Payloads are canonicalized with sorted keys and compact separators (separators=(',', ':')) before signing.
•
Anti-Replay Attack Protection (5-Minute Window): Signatures bind the dispatch UNIX timestamp via t={timestamp},v1={hash}. Payloads with clock drift exceeding 300 seconds (5 minutes) must be discarded.
•
Idempotency-Key Guard: Pass Idempotency-Key: <uuid-v4> on purchase requests. If your network connection drops or times out, re-sending with the same key guarantees exactly-once processing with zero double-debiting.
•
Active Anti-SSRF Defense: Target webhook destinations pointing to loopback (127.0.0.1, ::1), RFC 1918 private subnets, link-local, or cloud metadata endpoints are rejected with 422 Unprocessable Entity.
Security Attributes Integrity & Idempotency
Attribute Specification
X-Muse-Signature HTTP Header
Header format: t=<timestamp>,v1=<hmac_sha256_hex>
Idempotency-Key HTTP Header • UUIDv4
Prevents duplicate transactions upon network retry during transient drops.
Signature Digest HMAC-SHA256
Computed over "{timestamp}.{raw_json_body}" using your secret API key.
Anti-Replay Window 300 Seconds
Maximum allowable time drift between dispatcher timestamp and your server clock.
Verify: • Resp:
import hashlib
import hmac
import time

def verify_muse_webhook(raw_payload: bytes, signature_header: str, secret_key: str) -> bool:
    """
    Verifies HMAC-SHA256 signature with anti-replay & timing-safe comparison.
    Header format: 't=1729482011,v1=9f83a2b1c4...'
    """
    params = dict(kv.split("=") for kv in signature_header.split(","))
    timestamp = int(params["t"])
    received_hash = params["v1"]

    # 1. Anti-Replay: Reject if clock drift > 300s (5 minutes)
    if abs(time.time() - timestamp) > 300:
        return False

    # 2. Recompute expected HMAC-SHA256 signature
    to_sign = f"{timestamp}.".encode("utf-8") + raw_payload
    expected_hash = hmac.new(
        secret_key.encode("utf-8"), to_sign, hashlib.sha256
    ).hexdigest()

    # 3. Constant-time comparison (prevents timing attacks)
    return hmac.compare_digest(expected_hash, received_hash)
03

Make Your First Request

GET /api/v1/reseller/me

Verify connectivity and inspect your wallet balance by sending a test request to /api/v1/reseller/me. A successful response confirms valid authentication and returns your live USD balance, remaining boost tickets, and default webhook URL.

Response Attributes JSON Object
Attribute Description
telegram_id integer
Unique Telegram user ID linked to your reseller wallet account.
balance_usd float
Active available balance in USD. Debited atomically when purchasing accounts or boosts.
tickets integer
Pre-allocated boost tickets usable in place of cash balance.
masked_api_key string
Masked representation of your active secret key for verification (muse_live_***b85b).
webhook_url string / null
Persistent default webhook URL registered to receive asynchronous batch completion callbacks.
Req: • Resp:
curl -X GET https://api.artificial.ai.id/api/v1/reseller/me \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json"

# Platform Architecture & Reliability Guarantees

Core behavioral invariants enforced across all API endpoints, queue workers, and webhook pipelines:

01. Sliding-Window Rate Limiting

Traffic is throttled at 120 requests per 60 seconds per API key. Exceeding requests return an HTTP 429 response ({"detail": "Rate limit exceeded"}) with standard Retry-After headers.

02. Zero-Loss Auto-Refund Guarantee

If a target referral code saturates its capacity mid-batch, the queue triggers a fast-halt Circuit-Breaker. Unprocessed tickets are 100% automatically refunded to your wallet USD balance immediately with zero support ticket required.

03. 3-Tier Webhook Resolution & DLQ

Dynamic Override (webhook_url in order payload) > Account Default > Silent Fulfillment. Failed attempts retry automatically across [5s, 15s, 30s, 60s, 300s] before Dead-Letter-Queue archival.

04. Deterministic Error Contracts

Errors follow RFC-7807 structured JSON problem details with machine-readable error codes (e.g. ERR_INSUFFICIENT_FUNDS, ERR_RATE_LIMIT_EXCEEDED, ERR_SSRF_BLOCKED) ensuring reliable programmatic handling.

Category 01 · Catalog Discovery & Reseller Profile

4 Endpoints
GET /health

Service Health & Liveness Probe

Public readiness and liveness diagnostic probe checking API gateway availability.

Auth: Public
•
Rate Limit: 120 req / 60s
Response Attributes JSON Object
Attribute Description
status string
Service health status ('ok').
service string
Service identifier ('muse-gateway').
message string
Operational status notice.
Req: • Resp:
curl -X GET https://api.artificial.ai.id/health
GET /api/v1/catalog

Browse Catalog, Live Stock & Prices

Discovers all active catalog products, available stock counts, token denominations, and dynamic unit prices.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Response Attributes JSON Object
Attribute Description
status string
Catalog status ('ok').
products array
List of available products (BYOC and Ready Accounts).
products[].product_id string
Product SKU identifier (e.g. 'BYOC', 'ACCOUNT_1B', 'ACCOUNT_31B').
products[].unit_price_usd float
Unit price per account or referral boost in USD.
products[].stock_available integer
Current inventory count (-1 for unlimited BYOC booster).
products[].delivery_type string
'SYNCHRONOUS_CREDENTIALS' or 'ASYNCHRONOUS_BOOST'.
Req: • Resp:
curl -X GET https://api.artificial.ai.id/api/v1/catalog \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY"
GET /api/v1/reseller/me

Reseller Profile, Balance & Webhook

Retrieves authenticated reseller's account profile, USD wallet balance, free voucher tickets, masked secret key, and configured default webhook URL.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Response Attributes JSON Object
Attribute Description
telegram_id integer
Unique Telegram owner account identifier.
balance_usd float
Current wallet credit balance in USD available for orders.
tickets integer
Remaining promotional ticket voucher balance.
masked_api_key string
Masked representation of your API secret key.
webhook_url string | null
Persistent default webhook URL registered on this account.
is_banned boolean
Whether the account is active or suspended.
Req: • Resp:
curl -X GET https://api.artificial.ai.id/api/v1/reseller/me \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY"
GET /api/v1/reseller/transactions

Wallet Ledger Transactions History

Retrieves paginated audit mutations for deposits, order purchases, compensations, and referral bonuses.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Query Parameters URL Encoded
Parameter Description
limit
integer • optional
Records per page (1 to 100). Default: 20
offset
integer • optional
Pagination offset. Default: 0
tx_type
string • optional
Filter by category: 'TOPUP', 'DEBIT_PURCHASE', 'REFUND_ORDER', 'BONUS'.
Response Attributes JSON Object
Attribute Description
total integer
Total ledger transactions matching criteria.
transactions array
List of financial transaction records.
transactions[].amount_usd float
Debit (negative) or credit (positive) amount in USD.
transactions[].balance_after_usd float
Wallet balance after transaction execution.
transactions[].reference_id string
Related order ID or deposit invoice ID.
Req: • Resp:
curl -X GET "https://api.artificial.ai.id/api/v1/reseller/transactions?limit=20&offset=0" \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY"

Category 02 · Unified Orders & Fulfillment Engine

4 Endpoints
POST /api/v1/reseller/orders

Unified Order Placement (Ready & BYOC)

Unified order creation endpoint for all catalog items. Instantly delivers credentials for pre-generated accounts, or dispatches asynchronous referral boosts across hundreds of background cloud queue workers with automatic default webhook fallback.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Content-Type
string • required
application/json
Request Body application/json
Field Description
product_type
string • required
SKU identifier (e.g. 'ACCOUNT_1B', 'ACCOUNT_31B', 'ACCOUNT_60B', 'BYOC').
quantity
integer • required
Quantity of accounts or referral boost tickets (1 to 500).
custom_id
string • optional
Client tracking ID for idempotency and polling (1-128 chars).
invite_code
string • optional
Target referral invite code (mandatory only for BYOC boost orders).
webhook_url
string • optional
Optional notification URL. If omitted, falls back to persistent default webhook.
auto_retry
boolean • optional
Automatically retry transient registration errors. Default: true
max_retries
integer • optional
Maximum retries per ticket (0 to 5). Default: 2
Response Attributes JSON Object
Attribute Description
status string
'completed' (instant ready account) or 'queued' (asynchronous BYOC).
order_id string
Order reference or batch identifier.
product_type string
Purchased SKU identifier.
delivery_type string
'SYNCHRONOUS_CREDENTIALS' or 'ASYNCHRONOUS_BOOST'.
total_amount_usd float
Total USD deducted from reseller wallet.
balance_remaining_usd float
Available wallet balance remaining after purchase.
delivered_accounts array | null
Delivered account credentials for ready-made purchases.
Req: • Resp:
# A. BYOC Referral Boost (Asynchronous with persistent webhook fallback):
curl -X POST https://api.artificial.ai.id/api/v1/reseller/orders \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "product_type": "BYOC",
    "quantity": 25,
    "invite_code": "6JVGXX",
    "custom_id": "boost_ord_101",
    "auto_retry": true,
    "max_retries": 2
  }'

# B. Ready-Made Account Purchase (Synchronous Instant Delivery):
curl -X POST https://api.artificial.ai.id/api/v1/reseller/orders \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "product_type": "ACCOUNT_1B",
    "quantity": 1,
    "custom_id": "acc_ord_202"
  }'
GET /api/v1/reseller/orders

List Reseller Orders

Retrieves a paginated list of all orders submitted by the authenticated reseller with optional status and product filtering.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Query Parameters URL Encoded
Parameter Description
limit
integer • optional
Records per page (1 to 100). Default: 20
offset
integer • optional
Pagination offset. Default: 0
status
string • optional
Filter by status: 'completed', 'processing', 'queued', 'failed'.
product_type
string • optional
Filter by SKU (e.g. 'BYOC', 'ACCOUNT_1B').
Req: • Resp:
curl -X GET "https://api.artificial.ai.id/api/v1/reseller/orders?limit=20&offset=0&status=completed" \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY"
GET /api/v1/reseller/orders/{order_id}

Query Order Details by ID or Custom ID

Inspects real-time progress, delivered account credentials, completion telemetry, or auto-refund counts by order_id or custom_id with strict tenant BOLA guard.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Path Parameters URI Template
Parameter Description
order_id
string • required
System order_id, batch_id, or client custom_id.
Response Attributes JSON Object
Attribute Description
status string
'queued', 'processing', 'completed', 'partial_success', or 'failed'.
completed_count integer
Number of successfully claimed accounts.
failed_count integer
Failed ticket attempts.
refund_quantity integer
Tickets automatically refunded to wallet balance.
circuit_breaker_tripped boolean
True if invite code quota exhaustion occurred.
Req: • Resp:
curl -X GET https://api.artificial.ai.id/api/v1/reseller/orders/boost_ord_101 \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY"

Category 03 · Persistent Webhooks & Diagnostic Pings

5 Endpoints
GET /api/v1/reseller/webhook

Check Persistent Default Webhook

Inspects the persistent default webhook notification URL currently configured on the authenticated reseller's account.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Req: • Resp:
curl -X GET https://api.artificial.ai.id/api/v1/reseller/webhook \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY"
PUT /api/v1/reseller/webhook

Set / Update Persistent Default Webhook

Registers or updates the persistent default webhook URL. Enforces strict anti-SSRF validation against private and loopback networks. Future orders automatically notify this URL.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Content-Type
string • required
application/json
Request Body application/json
Field Description
webhook_url
string • required
Target public HTTPS URL to receive automated order completions.
Req: • Resp:
curl -X PUT https://api.artificial.ai.id/api/v1/reseller/webhook \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "webhook_url": "https://api.your-store.com/webhooks/muse"
  }'
DELETE /api/v1/reseller/webhook

Clear Registered Default Webhook

Removes the persistent default webhook URL from your reseller profile.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Req: • Resp:
curl -X DELETE https://api.artificial.ai.id/api/v1/reseller/webhook \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY"
POST /api/v1/reseller/webhooks/test

Test Webhook Ping & HMAC Signature

Dispatches a synthetic signed test ping to verify endpoint connectivity, round-trip latency, and HMAC-SHA256 signature verification.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Content-Type
string • required
application/json
Request Body application/json
Field Description
webhook_url
string • required
Public HTTPS URL to test.
Req: • Resp:
curl -X POST https://api.artificial.ai.id/api/v1/reseller/webhooks/test \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "webhook_url": "https://api.your-store.com/webhooks/muse"
  }'
POST Client Webhook Notification

Asynchronous Batch Completion Webhook Payload

Specification of the HTTP POST payload dispatched by Muse Runner to your webhook destination when an asynchronous referral boost batch finishes.

Auth: X-Muse-Signature
•
Rate Limit: Dispatched on batch completion
Request Headers RFC 6750
Header Description
Content-Type
string • required
application/json
User-Agent
string • required
MuseRunner-WebhookDispatcher/1.0
X-Muse-Event
string • required
Event identifier ('batch.completed').
X-Muse-Batch-ID
string • required
Unique UUID of the completed batch.
X-Muse-Signature
string • required
sha256=<hex> HMAC-SHA256 signature calculated over raw JSON payload.
Response Attributes JSON Object
Attribute Description
event string
'batch.completed' event name.
batch_id string
UUID of the completed batch.
custom_id string
Your external order tracking ID.
invite_code string
Target referral invite code.
status string
'completed', 'partial_success', or 'failed'.
requested_quantity integer
Total referrals ordered.
successful_count integer
Total successful registrations.
failed_count integer
Failed ticket attempts.
refund_quantity integer
Number of tickets automatically refunded to wallet balance.
duration_seconds float
Total execution runtime in seconds.
accounts array
List of created accounts and individual outcomes.
Req: • Resp:
# Your receiving server gets an incoming HTTPS POST notification:
POST /api/muse-webhook HTTP/1.1
Host: api.your-store.com
Content-Type: application/json
User-Agent: MuseRunner-WebhookDispatcher/1.0
X-Muse-Event: batch.completed
X-Muse-Batch-ID: batch_581933f1
X-Muse-Signature: sha256=7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069

Category 04 · Prepaid Deposits & Billing Settlement

2 Endpoints
POST /api/v1/reseller/deposits

Create Instant Crypto Deposit Invoice

Generates a direct non-redirect NOWPayments cryptocurrency deposit invoice with exact destination address and crypto token amount.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Content-Type
string • required
application/json
Request Body application/json
Field Description
amount_usd
float • required
USD amount to credit to your reseller wallet balance (min: $5.00).
pay_currency
string • optional
Target crypto asset (e.g. 'usdttrc20', 'usdterc20'). Default: usdttrc20
Req: • Resp:
curl -X POST https://api.artificial.ai.id/api/v1/reseller/deposits \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_usd": 25.00,
    "pay_currency": "usdttrc20"
  }'
GET /api/v1/reseller/deposits/{invoice_id}

Query Crypto Invoice Confirmation Status

Inspects live on-chain deposit confirmation, payment address, and settlement status for cryptocurrency top-ups via NOWPayments.

Auth: Bearer Token
•
Rate Limit: 120 req / 60s
Request Headers RFC 6750
Header Description
Authorization
string • required
Bearer muse_live_... secret key.
Path Parameters URI Template
Parameter Description
invoice_id
string • required
Unique invoice identifier generated during deposit creation.
Req: • Resp:
curl -X GET https://api.artificial.ai.id/api/v1/reseller/deposits/inv_test_999 \
  -H "Authorization: Bearer muse_live_YOUR_SECRET_KEY"
Need custom reseller capacity or integration support?