A chhunga thu awmte chu skip rawh
निम्बोट पर वापस जाएँ

Hriatna (knowledge base) a ni Siamtu te

Balance, top-ups leh keys

Eng nge i neih tih en rawh, Lightning hmangin top up rawh, i wallet atangin top up automatic awm rawh, thil dil zawng zawng awmzia hrang hrang en rawh, leh code atangin keys manage rawh.

Balance enzawng enna checkingna

नोंथांनि मोन्नैनि बेलेन्स, आरो बे चाबीनि केपआ बेसेबां बाहायनाय जायो।

GET https://nymbot.ai/api/v1/credits/balance — API key a mamawh. POST जिन ग्राहकों को इसकी उम्मीद है, उनके लिए भी यह काम करता है।

balance Bitcoin hman dan dik (current price) hmanga, dollar-in sum hrang hrang pahnih kha thlunzawm (total) teh chuan, a chhunga sum chhun chauh (single number) hmang tur tool tan chuan,null अथवा यदि कीमत पढ़ी नहीं जा सकती). बाकी क्रेडिट और सैट्स में है, जो कि वास्तव में शेष राशि को कैसे रखा जाता है। key zawhna hman a nih hnu hian a hman tur tlangpui a hrilhfiah. Limit a tam tawh hnu pawha hman leh theih reng, check balance siam thei key a ni.

Chhanna

{
  "balance": 49.18,
  "balance_sats": 42037,
  "standard": { "credits": 120.4, "sats": 1204 },
  "pro": { "credits": 408.33, "sats": 40833 },
  "key": {
    "id": "4f0c9a1be27d3856",
    "name": "laptop scripts",
    "limit_sats": 20000,
    "period_used_sats": 3412,
    "total_used_sats": 18230,
    "reset_period": "monthly",
    "reset_at": "2026-10-01T00:00:00Z"
  }
}
पी. टी. यू. स्थितिकद...
401Key a awm lo, hriat loh, tihpawt leh awm rei tawh/a tlak lo.

cURL

curl https://nymbot.ai/api/v1/credits/balance \
  -H "Authorization: Bearer $NYMBOT_API_KEY"

Python

import os
import requests

res = requests.get(
    "https://nymbot.ai/api/v1/credits/balance",
    headers={"Authorization": "Bearer " + os.environ["NYMBOT_API_KEY"]},
)
balance = res.json()
print(balance["standard"]["sats"], balance["pro"]["sats"])

JavaScript

const res = await fetch("https://nymbot.ai/api/v1/credits/balance", {
  headers: { "Authorization": "Bearer " + process.env.NYMBOT_API_KEY },
});
const balance = await res.json();
console.log(balance.standard.sats, balance.pro.sats);

Dawngbawh dan turte

Engtin nge i top up thei ang leh, limit te chu. Lightning hi a chhun ber a ni.

GET https://nymbot.ai/api/v1/topup/payment-methods — key a ngai lo.

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ bulk_bonus top-up lian zawkah credit bik a hman tur a tarlang a, app-a awm ang khan: standard top-ups 500, 1,000 emaw 5,000 sats atanga hman tan 10%, 15% emaw 20% a ring zawk ang a, Pro top-ups 5,000, 10,000 emaw 50,000 sats atanga hman tan pawh a ni bawk.

Chhanna

{
  "supported_methods": [
    {
      "method": "btc-lightning",
      "display_name": "Bitcoin Lightning",
      "supported_currencies": ["SATS", "USD", "BTC"],
      "limits": {
        "SATS": { "min": 10, "max": 1000000 },
        "USD": { "min": 0.02, "max": 1170 },
        "BTC": { "min": 1e-7, "max": 0.01 }
      },
      "tiers": ["standard", "pro"],
      "default_tier": "pro",
      "tier_min_sats": { "standard": 10, "pro": 100 },
      "sats_per_credit": { "standard": 10, "pro": 100 },
      "bulk_bonus": [
        { "bonus": 0.1, "standard_sats": 500, "pro_sats": 5000 },
        { "bonus": 0.15, "standard_sats": 1000, "pro_sats": 10000 },
        { "bonus": 0.2, "standard_sats": 5000, "pro_sats": 50000 }
      ]
    }
  ]
}

cURL

curl https://nymbot.ai/api/v1/topup/payment-methods

Python

import requests

methods = requests.get("https://nymbot.ai/api/v1/topup/payment-methods").json()
print(methods["supported_methods"][0]["limits"])

JavaScript

const methods = await (await fetch("https://nymbot.ai/api/v1/topup/payment-methods")).json();
console.log(methods.supported_methods[0].limits);

बज्रपात के ऊपर चढ़ना

Lightning invoice siam la, chu chuan key awmna nym kha credit a thlunzawm ang. Lightning wallet eng pawh atangin hlawhtlin zawk rawh, chumi hnuah, इसे जांचो credit zat awm belh tur.

POST https://nymbot.ai/api/v1/topup/create/btc-lightning — API key a mamawh.

Chhungkhar/Hmunए. डब्ल्यू. ए. प्रकारकियत् आवश्यकHrilhfiahna
amountnumberAwleEngzat nge, in currency. Sats tana number thuhlim.
currencythlawpAih loSATS (a tlangpui), USD り BTCDollar te hi Bitcoin man hman lai nenin a let (convert) ang.
tierthlawpAih lopro (a default) emaw standard: credit kha khawngaihin eng balance-ah nge a luh ang le.

एक मानक क्रेडिट 10 सैट्स है और एक प्रो क्रेडिट 100 सैट्स है, साथ ही कोई भी थोक बोनस; credits he invoice hian eng nge a thlunzawm ang tih a sawi.

Chhanna

{
  "invoice_id": "b7d41e0c95a2f38e6c1d0e9a4b7f2c61d3e8a05f9b2c4d7e1a6f3b8c0d5e2a9f4",
  "payment_request": "lnbc100u1p5...",
  "amount_sats": 10000,
  "credits": 115,
  "tier": "pro",
  "expires_at": "2026-09-30T09:27:00Z",
  "status": "pending"
}
पी. टी. यू. स्थितिकद...
400Path chhung, hmetlang thar dang (unsupported_method), एक अज्ञात मुद्रा (unsupported_currency) अथवा स्तर, एक लापता राशि, या न्यूनतम (amount_too_small), 1,000,000 sats (amount_too_large) अथवा लाइटनिंग वॉलेट (लाईटनिंग वॉलेट) ने मना कर दिया (amount_out_of_range).
429इस एन. आई. एम. के लिए 60 से अधिक चालान, या इस पते से 120, एक घंटे में (rate_limit_exceeded, के साथ Retry-After).
502तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तफ् तinvoice_unavailable, के साथ Retry-After).

cURL

curl https://nymbot.ai/api/v1/topup/create/btc-lightning \
  -H "Authorization: Bearer $NYMBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 10000, "currency": "SATS", "tier": "pro"}'

Python

import os
import requests

res = requests.post(
    "https://nymbot.ai/api/v1/topup/create/btc-lightning",
    headers={"Authorization": "Bearer " + os.environ["NYMBOT_API_KEY"]},
    json={"amount": 10000, "currency": "SATS", "tier": "pro"},
)
invoice = res.json()
print(invoice["payment_request"])

JavaScript

const res = await fetch("https://nymbot.ai/api/v1/topup/create/btc-lightning", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.NYMBOT_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ amount: 10000, currency: "SATS", tier: "pro" }),
});
const invoice = await res.json();
console.log(invoice.payment_request);

Top-up en tur checking a nei mek

ये पूछते हैं कि चालान का भुगतान किया गया है या नहीं और, एक बार हो जाने के बाद, क्रेडिट जोड़ता है। जाँच करना वह है जो इसे क्रेडिट करता है, इसलिए भुगतान करने के बाद, स्थिति प्राप्त होने तक जाँच करें। creditedA hnuaiah khan i en leh leh thei a, chu chu a him%: credit chu i dil tam pawhin a inziak hnih leh hnih reng mai a ni.

GET https://nymbot.ai/api/v1/topup/status/{invoice_id} â-चालान बनाने वाले एन. आई. एम. से एक चाबी चाहिए।

status ni pending (huidat lo te), paid (hnawh tawh, mahse luh a la lo lo; lehlin leh rawh), credited (i balance-ah) emaw expired (समय पर भुगतान नहीं किया गया). शेष राशि उस स्तर के लिए होती है जिस स्तर पर चालान शीर्ष पर होता है।

Chhanna

{
  "invoice_id": "b7d41e0c95a2f38e6c1d0e9a4b7f2c61d3e8a05f9b2c4d7e1a6f3b8c0d5e2a9f4",
  "status": "credited",
  "amount_sats": 10000,
  "credits": 115,
  "tier": "pro",
  "expires_at": null,
  "balance_credits": 523.33,
  "balance_sats": 52333
}
पी. टी. यू. स्थितिकद...
400आईडीएफआर क्रिएट कॉल का 64-वर्ण का आईडी नहीं है।
404आपके एन. आई. एम. के लिए उस आई. डी. द्वारा कोई चालान नहीं (invoice_not_found).

cURL

curl https://nymbot.ai/api/v1/topup/status/$INVOICE_ID \
  -H "Authorization: Bearer $NYMBOT_API_KEY"

Python

import os, time
import requests

headers = {"Authorization": "Bearer " + os.environ["NYMBOT_API_KEY"]}
url = "https://nymbot.ai/api/v1/topup/status/" + invoice["invoice_id"]

while True:
    status = requests.get(url, headers=headers).json()["status"]
    if status in ("credited", "expired"):
        break
    time.sleep(3)
print(status)

JavaScript

const headers = { "Authorization": "Bearer " + process.env.NYMBOT_API_KEY };
const url = "https://nymbot.ai/api/v1/topup/status/" + invoice.invoice_id;

let status;
do {
  await new Promise((r) => setTimeout(r, 3000));
  status = (await (await fetch(url, { headers })).json()).status;
} while (status !== "credited" && status !== "expired");
console.log(status);

Sakhua zawhna chanchin

प्रति अनुरोध के लिए एक पंक्तिः यह क्या था, कौन सा मॉडल, कितने टोकन और इसकी कीमत क्या है। कोई संकेत या उत्तर नहीं रखे जाते हैं, इसलिए कोई भी वापस नहीं किया जाता है। पंक्तियों को 90 दिनों के लिए रखा जाता है, सबसे नया पहले। एक कुंजी जो अपनी टोपी तक पहुंच गई है वह अभी भी अपना इतिहास पढ़ सकती है।

GET https://nymbot.ai/api/v1/queries/history φ-API की चाहींदी है, जो अपने अनुरोधों को देखे, या एक thup chu thurawn duat tura duhna a awm viau i hming atangin, a hming zawng zawng a thlir thei ang.

Chhungkhar/Hmunए. डब्ल्यू. ए. प्रकारकियत् आवश्यकHrilhfiahna
pageinteger (zawhna)Aih loडिफ़ॉल्ट 1, अधिकतम 1,000 पर; एक उच्च पृष्ठ है 400 invalid_value.
page_countinteger (zawhna)Aih loप्रति पृष्ठ पंक्तियाँ। पूर्वनिर्धारित 20, अधिकतम 100।
start_date
end_date
string (zawhna)Aih loISO 8601 ni hmanraw leh hun.
modelstring (zawhna)Aih loकेवल यह मॉडल।
typestring (zawhna)Aih lochat, responses, messages, image, video, speech, transcription り embedding.
all_keysboolean (zawhna)Aih loKey hmangin: true nym in hming ang zawng zawng a huam a. Default false.
key_idstring (zawhna)Aih loSign duhna neiin, emaw... all_keys=true: he key hi chauh.

Chhanna

{
  "data": [
    {
      "id": "q_71c4e9a0",
      "timestamp": "2026-09-30T08:12:00Z",
      "model": "anthropic/claude-sonnet-5",
      "type": "chat",
      "input_tokens": 1240,
      "output_tokens": 380,
      "cached_tokens": 0,
      "cost_sats": 16.2,
      "cost_usd": 0.01895,
      "balance": "pro",
      "key_id": "4f0c9a1be27d3856",
      "web_search": false,
      "status": "ok"
    }
  ],
  "pagination": { "page": 1, "page_count": 20, "total": 311, "total_pages": 16 }
}

cURL

curl "https://nymbot.ai/api/v1/queries/history?page_count=50&type=chat" \
  -H "Authorization: Bearer $NYMBOT_API_KEY"

Python

import os
import requests

res = requests.get(
    "https://nymbot.ai/api/v1/queries/history",
    headers={"Authorization": "Bearer " + os.environ["NYMBOT_API_KEY"]},
    params={"page_count": 50, "type": "chat"},
)
for row in res.json()["data"]:
    print(row["timestamp"], row["model"], row["cost_sats"])

JavaScript

const res = await fetch("https://nymbot.ai/api/v1/queries/history?page_count=50&type=chat", {
  headers: { "Authorization": "Bearer " + process.env.NYMBOT_API_KEY },
});
for (const row of (await res.json()).data) console.log(row.timestamp, row.model, row.cost_sats);

Account thurawn sign leh thurawn dilna te

Key siam, thlak leh tihchhiat te, account summary leh automatic top-ups te hi API key an ngai lo. I nym signature an ngai zawk a, chuvangin key leak loh loh pawh chuan a limit hmaa sum a hmang thei a, mahse key dang a siam thei leh a limit a san thei lovang.

App hian hetiang hian i tan a ti: engkim a hmanraw hman tur ang zawngin ए. पि. आइ. आप शीट इन अंतिम बिंदुओं का उपयोग करती है। आपको केवल अपने स्वयं के कोड से कुंजी प्रबंधित करने के लिए इस खंड की आवश्यकता है।

हस्ताक्षर प्रकार 27235 (एन. आई. पी.-98) की एक नोस्टर घटना है, जिसे बेस 64-एन्कोडेड में भेजा गया है। Authorization शब्द के साथ हेडर चलाओ Nostr मूहर्तेः

इफ्तार सेरेमनी

{
  "kind": 27235,
  "created_at": 1790726400,
  "tags": [
    ["u", "https://nymbot.ai/api/v1/keys"],
    ["method", "POST"],
    ["nonce", "9c4e21f07a3b...16 random bytes in hex"],
    ["payload", "3f1a0d7c8e2b...sha256 of the exact request body in hex"]
  ],
  "content": "",
  "pubkey": "your public key in hex",
  "id": "...",
  "sig": "..."
}
  • u request-a query string telin, thawn ang tak URL hmun zawng zawng kha a ni em.
  • method HTTP method a ni.
  • payload request body raw kha hex-a in, SHA-256 a ni em? A hman a ngai a POST leh PATCH, chhunzawmna leh i thawn body chu i hash tawh kha i bang kawng thlunzawm lo takin a inang tur a ni.
  • created_at server clock atanga second 60 inṭhahte a nih tur a ni.
  • Thil thleng tin hian a hnihna a nei lo, a GET a tel a, chuvangin captured header hi replayed a ni thei lo vang. Request tinah thar sign rawh. Add a nonce value random deuhin tag la chuvangin second pakhat ah sign-in awm hrang hrang pawh chuan an inang lo vang.
  • Sign siam tawh request thupui hi a changtam ber 64 KB a ni thei a, thupui a ngai a Content-Type: application/json.

Event hmuh loh leh awm lohna a thlen leh thin 401 missing_nostr_auth; a siam tham, sign siam tha lo, a thla dam tawh, emaw URL, method emaw body dang vangin a thlen chuan a chhuak ang invalid_nostr_auth, thuchah hnuaia chhan nen; hman tawh bik a lo let leh leh thin nostr_auth_replayedEndpoint-te hi an hnenah API key dah/thawn te hi an phal lo. Body hi an chhiak hmaa signature kha an enfiah a, address tinin minute khatah vawi 30 ngei pawh an phal lo thei (IPv6 address pakhat hi a /64 zawng zawngin a in cntai a); chuta hnuah chuan... 429 nenin Retry-After.

Browser-te hian heng endpoint-te hi Nymbot site mah lai atanga an lo hman chauh thei ang (https://nymbot.ai, https://nymchat.app leh an subdomains te pawhin). Site dang hrang hrang atanga page pakhat chuan CORS headers engmah a hmu thei lo a, chuvangin an thawn chhuah zawng zawng hi a chhiar thei lo a ni. Scripts leh native app-te, an thawn chhuah... Origin, hrin an tawng lo.

I thuruk key

सही करने के लिए आपके एन. आई. एम. की की (गुप्त चाबी) की आवश्यकता होती है। nsec), जे हर चीज को नियंत्रित करता हैः आपकी पहचान, आपका इतिहास और आपका संतुलन। इसे केवल उस मशीन पर एक स्क्रिप्ट में रखें जिस पर आप भरोसा करते हैं, इसे फाइल में लिखने के बजाय वातावरण से पढ़ें, और जब आप कर सकते हैं तो ऐप को प्राथमिकता दें।

ई हेल्पर हेडर का निर्माण करते हैं। इस पृष्ठ पर बाद के उदाहरण उन्हें उपयोग करते हैं। वे हेक्स में गुप्त कुंजी को यहाँ से पढ़ते हैं। NOSTR_SECRET_HEX; cURL hmang chu a hmang a नाका. command-line tool, nsec emaw hex key hman a nih chuan, leh sha256sum (macOS पर, shasum -a 256).

cURL

nostr_auth() {
  method="$1"; url="$2"; body="$3"
  nonce=$(openssl rand -hex 16)
  if [ -n "$body" ]; then
    hash=$(printf '%s' "$body" | sha256sum | cut -d' ' -f1)
    event=$(nak event --sec "$NOSTR_SECRET_HEX" -k 27235 -t "u=$url" -t "method=$method" -t "nonce=$nonce" -t "payload=$hash")
  else
    event=$(nak event --sec "$NOSTR_SECRET_HEX" -k 27235 -t "u=$url" -t "method=$method" -t "nonce=$nonce")
  fi
  printf 'Nostr %s' "$(printf '%s' "$event" | base64 | tr -d '\n')"
}

Python

# pip install coincurve requests
import base64, hashlib, json, os, time
from coincurve import PrivateKey, PublicKeyXOnly

SECRET = bytes.fromhex(os.environ["NOSTR_SECRET_HEX"])

def nostr_auth(method, url, body=b""):
    pubkey = PublicKeyXOnly.from_secret(SECRET).format().hex()
    tags = [["u", url], ["method", method], ["nonce", os.urandom(16).hex()]]
    if body:
        tags.append(["payload", hashlib.sha256(body).hexdigest()])
    created_at = int(time.time())
    serialized = json.dumps([0, pubkey, created_at, 27235, tags, ""], separators=(",", ":"), ensure_ascii=False)
    event_id = hashlib.sha256(serialized.encode()).digest()
    event = {
        "id": event_id.hex(),
        "pubkey": pubkey,
        "created_at": created_at,
        "kind": 27235,
        "tags": tags,
        "content": "",
        "sig": PrivateKey(SECRET).sign_schnorr(event_id).hex(),
    }
    return "Nostr " + base64.b64encode(json.dumps(event).encode()).decode()

JavaScript

// npm install nostr-tools
import { createHash, randomBytes } from "node:crypto";
import { finalizeEvent } from "nostr-tools/pure";

const secret = Buffer.from(process.env.NOSTR_SECRET_HEX, "hex");

export function nostrAuth(method, url, body = "") {
  const tags = [["u", url], ["method", method], ["nonce", randomBytes(16).toString("hex")]];
  if (body) tags.push(["payload", createHash("sha256").update(body).digest("hex")]);
  const event = finalizeEvent(
    { kind: 27235, created_at: Math.floor(Date.now() / 1000), tags, content: "" },
    secret,
  );
  return "Nostr " + Buffer.from(JSON.stringify(event)).toString("base64");
}

खातानिर्मित सारांश

ऐप की एपीआई शीट शीर्ष पर क्या दिखाती हैः आपकी सार्वजनिक कुंजी, दोनों शेष राशि, कितनी कुंजी सक्रिय हैं (रद्द या समाप्त नहीं हुई हैं), और आटोमेटिक टॉप-अप क्रमीकरण, अथवा null server chuan an hlan loh hian.

GET https://nymbot.ai/api/v1/account — mamawh a thup chu thurawn duat tura duhna a awm viau.

Chhanna

{
  "data": {
    "pubkey": "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
    "balances": {
      "standard": { "credits": 120.4, "sats": 1204 },
      "pro": { "credits": 408.33, "sats": 40833 }
    },
    "keys_active": 3,
    "nwc_auto_topup": {
      "connected": true, "threshold_sats": 5000, "topup_sats": 20000, "tier": "pro",
      "last_topup_at": null, "last_topup_sats": null, "last_error": null
    }
  }
}

cURL

URL=https://nymbot.ai/api/v1/account
curl "$URL" -H "Authorization: $(nostr_auth GET "$URL")"

Python

import requests

url = "https://nymbot.ai/api/v1/account"
print(requests.get(url, headers={"Authorization": nostr_auth("GET", url)}).json())

JavaScript

const url = "https://nymbot.ai/api/v1/account";
const res = await fetch(url, { headers: { "Authorization": nostrAuth("GET", url) } });
console.log(await res.json());

कुञ्जीआं दा प्रबंधन

एप की सूची के पीछे के अंतिम बिंदु। उन सभी को एक आवश्यकता है हस्ताक्षरित निवेदन. Key zawng zawngte hi he hmelhmang hian pek chhuah an ni a, hun hi ISO 8601-in leh amount hi sats-in a ni:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

{
  "id": "4f0c9a1be27d3856",
  "name": "laptop scripts",
  "hint": "sk-nymbot-Qm7x…c2Lw",
  "limit_sats": 20000,
  "reset_period": "monthly",
  "reset_at": "2026-10-01T00:00:00Z",
  "expire_at": null,
  "period_used_sats": 3412,
  "total_used_sats": 18230,
  "created_at": "2026-08-14T09:21:07Z",
  "updated_at": "2026-09-02T17:40:55Z",
  "last_used_at": "2026-09-30T08:12:00Z",
  "revoked_at": null
}

hint कीकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींकींक

Key te list chhuah

GET https://nymbot.ai/api/v1/keys फर-हस्ताक्षरित।

Chhungkhar/Hmunए. डब्ल्यू. ए. प्रकारकियत् आवश्यकHrilhfiahna
include_revokedboolean (zawhna)Aih loरद्द कीज समावेश करो। पूर्वनिर्धारित false.

Chhanna

{ "data": [ { "id": "4f0c9a1be27d3856", "name": "laptop scripts", "hint": "sk-nymbot-Qm7x…c2Lw", "...": "..." } ] }

cURL

URL=https://nymbot.ai/api/v1/keys
curl "$URL" -H "Authorization: $(nostr_auth GET "$URL")"

Python

import requests

url = "https://nymbot.ai/api/v1/keys"
for key in requests.get(url, headers={"Authorization": nostr_auth("GET", url)}).json()["data"]:
    print(key["id"], key["name"], key["period_used_sats"], key["limit_sats"])

JavaScript

const url = "https://nymbot.ai/api/v1/keys";
const { data } = await (await fetch(url, { headers: { "Authorization": nostrAuth("GET", url) } })).json();
for (const key of data) console.log(key.id, key.name, key.period_used_sats, key.limit_sats);

चाबी बनाना

POST https://nymbot.ai/api/v1/keys ए. एफ. आर.-हस्ताक्षरित। वापसी 201.

Chhungkhar/Hmunए. डब्ल्यू. ए. प्रकारकियत् आवश्यकHrilhfiahna
namethlawpAwle1-40 अक्षर, आपकी अन्य सक्रिय कुंजियों से अलग (केस को नजरअंदाज करना)।
limit_satsपूर्णांक संख्याAih loसेट्स में खर्च की सीमा, कम से कम 1. इसे बिना किसी सीमा के छोड़ दें।
reset_periodthlawpAih lodaily, weekly り monthlyNgaihna a nei. limit_satsवा.......................................................................................................................................................................................................
expire_atस्ट्रिंग या पूर्णांकAih lo"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""

जवाब (201)

{
  "data": {
    "id": "4f0c9a1be27d3856",
    "name": "laptop scripts",
    "hint": "sk-nymbot-Qm7x…c2Lw",
    "limit_sats": 20000,
    "reset_period": "monthly",
    "key": "sk-nymbot-Qm7x...c2Lw",
    "...": "the rest of the key object"
  }
}
पी. टी. यू. स्थितिकद...
400"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""duplicate_name); एक कैप जो कम से कम 1 की पूरी संख्या नहीं है; कैप के बिना एक रीसेट अवधि; अतीत में एक समाप्ति; एक अज्ञात क्षेत्र (unknown_parameter); emaw key active 25 tawh (too_many_keys).
429He hming hmanga key siam zat 60 aia tam, emaw he address hmanga an hour chhungin 120 aia tam (rate_limit_exceeded, के साथ Retry-After).

cURL

URL=https://nymbot.ai/api/v1/keys
BODY='{"name":"laptop scripts","limit_sats":20000,"reset_period":"monthly"}'
curl "$URL" \
  -H "Authorization: $(nostr_auth POST "$URL" "$BODY")" \
  -H "Content-Type: application/json" \
  -d "$BODY"

Python

import json
import requests

url = "https://nymbot.ai/api/v1/keys"
body = json.dumps({"name": "laptop scripts", "limit_sats": 20000, "reset_period": "monthly"}).encode()
res = requests.post(
    url,
    data=body,
    headers={"Authorization": nostr_auth("POST", url, body), "Content-Type": "application/json"},
)
print(res.json()["data"]["key"])

JavaScript

const url = "https://nymbot.ai/api/v1/keys";
const body = JSON.stringify({ name: "laptop scripts", limit_sats: 20000, reset_period: "monthly" });
const res = await fetch(url, {
  method: "POST",
  headers: { "Authorization": nostrAuth("POST", url, body), "Content-Type": "application/json" },
  body,
});
console.log((await res.json()).data.key);

Key pakhat chhiar

GET https://nymbot.ai/api/v1/keys/{id} फर-हस्ताक्षरित।

Thawnhnawnna {"data": {…}} key object nen, emaw 404 key_not_found बेर् अगर आपकी कोई चाबी में वह आई. डी. नहीं है।

cURL

URL=https://nymbot.ai/api/v1/keys/4f0c9a1be27d3856
curl "$URL" -H "Authorization: $(nostr_auth GET "$URL")"

Python

import requests

url = "https://nymbot.ai/api/v1/keys/4f0c9a1be27d3856"
print(requests.get(url, headers={"Authorization": nostr_auth("GET", url)}).json()["data"])

JavaScript

const url = "https://nymbot.ai/api/v1/keys/4f0c9a1be27d3856";
console.log((await (await fetch(url, { headers: { "Authorization": nostrAuth("GET", url) } })).json()).data);

चाबी बदलो

PATCH https://nymbot.ai/api/v1/keys/{id} फर-हस्ताक्षरित।

जिंʼदे चाभी भेजो name, limit_sats, reset_period leh expire_atखैर, चाबी बनाते समय के समान नियमों के साथ। null कोई सीमा नहीं, कोई पुनर्संचयित नहीं, कोई समाप्ति नहीं। पुनर्संचयित अवधि को बदलने से शून्य पर एक नया अवधि शुरू होती है। एक रद्द की को बदला नहीं जा सकता (400 key_revokedवा). रिटर्न्स {"data": {…}} अपडेटेड की ऑब्जेक्ट के साथ।

cURL

URL=https://nymbot.ai/api/v1/keys/4f0c9a1be27d3856
BODY='{"limit_sats":50000,"expire_at":null}'
curl -X PATCH "$URL" \
  -H "Authorization: $(nostr_auth PATCH "$URL" "$BODY")" \
  -H "Content-Type: application/json" \
  -d "$BODY"

Python

import json
import requests

url = "https://nymbot.ai/api/v1/keys/4f0c9a1be27d3856"
body = json.dumps({"limit_sats": 50000, "expire_at": None}).encode()
res = requests.patch(
    url,
    data=body,
    headers={"Authorization": nostr_auth("PATCH", url, body), "Content-Type": "application/json"},
)
print(res.json()["data"])

JavaScript

const url = "https://nymbot.ai/api/v1/keys/4f0c9a1be27d3856";
const body = JSON.stringify({ limit_sats: 50000, expire_at: null });
const res = await fetch(url, {
  method: "PATCH",
  headers: { "Authorization": nostrAuth("PATCH", url, body), "Content-Type": "application/json" },
  body,
});
console.log((await res.json()).data);

की वापस लेना

DELETE https://nymbot.ai/api/v1/keys/{id} फर-हस्ताक्षरित।

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< revoked_at set, leh a hmuh theih bawk include_revoked=trueA hmanna hman tawh (revoked) key chu hmanna hman tawh (revoked) leh hman leh leh chhunzawm leh a lo hman tawh leh leh chhunzawm lehna hi a inang vek a ni. Hman tawh (revoked) key thar ber mi 50 chauh hian kan ngaihtuah reng a; key dang hman tawh (revoked) a lo awm leh chuan a hmaia awm te chu kan delete thin a ni.

Chhanna

{ "data": { "id": "4f0c9a1be27d3856", "revoked": true } }

cURL

URL=https://nymbot.ai/api/v1/keys/4f0c9a1be27d3856
curl -X DELETE "$URL" -H "Authorization: $(nostr_auth DELETE "$URL")"

Python

import requests

url = "https://nymbot.ai/api/v1/keys/4f0c9a1be27d3856"
print(requests.delete(url, headers={"Authorization": nostr_auth("DELETE", url)}).json())

JavaScript

const url = "https://nymbot.ai/api/v1/keys/4f0c9a1be27d3856";
const res = await fetch(url, { method: "DELETE", headers: { "Authorization": nostrAuth("DELETE", url) } });
console.log(await res.json());

एन. डब्ल्यू. सी. आटो-टॉप-अप

Lightning wallet chu Nostr Wallet Connect nen hmang la, API hman lutuk vangin balance a tlem chuan Nymbot chuan mahni ngeiin a thun leh thei ang. App API sheet-ah hian settings tha deuh an awm a; hei te hi a chanchin endpoint te an ni. An zawng zawng hian a mamawh a... thup chu thurawn duat tura duhna a awm viau.

A awmzia chu: API request i thawn hrang hrangte i thlang balance atanga hman a nih hnuah, chumi balance chu i threshold a hniam tawh chuan, Nymbot chuan i top-up amount zat tur invoice a siam anga, i wallet atanga hman tur a ngen a, chumi hnuah credit a thun leh ang. Minute 5 chhung hian nym leh balance tinah a top-up atlawm ber hian a hun khat chauh a nei a, chuvangin request tam tak an lo inrem leh leh chuan i wallet a chhunh thei lo vang. App-a hman te hi a ti thei lo vang. Top-up hmasa ber hun leh zat leh, error hmasa ber te chu settings-ah a awm a; payment a thawh leh hnuah error a awm a nih chuan, a invoice kha en leh dawn nia टॉप-अप स्थिति a hming/thil siamtu hming zat a ni.

Wallet i siiamchhuah hmaa

ए. एफ. ए. '.'............................................................................................................................................................................................... pay_invoice.

Wallet hmanrua thlunzawmna

POST https://nymbot.ai/api/v1/nwc-auto-topup/connect फर-हस्ताक्षरित।

Chhungkhar/Hmunए. डब्ल्यू. ए. प्रकारकियत् आवश्यकHrilhfiahna
nwc_urlthlawpAwleConnection string, tan atanga nostr+walletconnect://निम्बॉट बटुए के बारे में पूछता है get_info सेव् करने से पहले सावधानी बरतें, और इसे एन्क्रिप्टेड तरीके से स्टोर करें।
threshold_satsपूर्णांक संख्याAwleSats hian hetiang zat a hniam chuan top up rawh. At least 1,000.
topup_satsपूर्णांक संख्याAwle1,000,000 sats में 1,000 प्रत्येक बार कितना जोड़ना है।
tierthlawpAih lopro (a default) emaw standard:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -

Chhanna

{
  "data": {
    "connected": true,
    "threshold_sats": 5000,
    "topup_sats": 20000,
    "tier": "pro",
    "last_topup_at": null,
    "last_topup_sats": null,
    "last_error": null
  }
}
पी. टी. यू. स्थितिकद...
400कनेक्शन स्ट्रिंग नहीं (invalid_nwc_urlâ); बटुआ ने अपने रिले पर जवाब नहीं दिया (nwc_unreachableआर. एच. आर.) अथवा चेक नामंजूर (nwc_rejected); कनेक्शन चालान का भुगतान नहीं कर सकता (nwc_missing_permission); अथवा सीमासुलभ रकम।
501He server atan automatic top-up a awm lo (nwc_unavailable). Endpoint dang pahnihah pawh hei hi a lo kalpui ve ang.

cURL

URL=https://nymbot.ai/api/v1/nwc-auto-topup/connect
BODY='{"nwc_url":"nostr+walletconnect://...","threshold_sats":5000,"topup_sats":20000,"tier":"pro"}'
curl "$URL" \
  -H "Authorization: $(nostr_auth POST "$URL" "$BODY")" \
  -H "Content-Type: application/json" \
  -d "$BODY"

Python

import json, os
import requests

url = "https://nymbot.ai/api/v1/nwc-auto-topup/connect"
body = json.dumps({
    "nwc_url": os.environ["NWC_URL"],
    "threshold_sats": 5000,
    "topup_sats": 20000,
    "tier": "pro",
}).encode()
res = requests.post(
    url,
    data=body,
    headers={"Authorization": nostr_auth("POST", url, body), "Content-Type": "application/json"},
)
print(res.json())

JavaScript

const url = "https://nymbot.ai/api/v1/nwc-auto-topup/connect";
const body = JSON.stringify({
  nwc_url: process.env.NWC_URL,
  threshold_sats: 5000,
  topup_sats: 20000,
  tier: "pro",
});
const res = await fetch(url, {
  method: "POST",
  headers: { "Authorization": nostrAuth("POST", url, body), "Content-Type": "application/json" },
  body,
});
console.log(await res.json());

सेटिंग्स को पढ़ने के बाद

GET https://nymbot.ai/api/v1/nwc-auto-topup फर-हस्ताक्षरित।

के साथ, कनेक्ट करने के रूप में एक ही वस्तु लौटाता है connected: false और अन्य क्षेत्र null यदी कोई बटुआ न जुड़े। कनेक्शन स्ट्रिंग स्वयं कभी वापस नहीं आती।

cURL

URL=https://nymbot.ai/api/v1/nwc-auto-topup
curl "$URL" -H "Authorization: $(nostr_auth GET "$URL")"

Python

import requests

url = "https://nymbot.ai/api/v1/nwc-auto-topup"
print(requests.get(url, headers={"Authorization": nostr_auth("GET", url)}).json())

JavaScript

const url = "https://nymbot.ai/api/v1/nwc-auto-topup";
console.log(await (await fetch(url, { headers: { "Authorization": nostrAuth("GET", url) } })).json());

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

DELETE https://nymbot.ai/api/v1/nwc-auto-topup/connection फर-हस्ताक्षरित।

एफ़टी संग्रहीत कनेक्शन स्ट्रिंग को हटा देता है। कोई और टॉप-अप नहीं किए जाते हैं। यह सुनिश्चित करने के लिए, आप अपने बटुए में कनेक्शन को भी रद्द कर सकते हैं।

Chhanna

{ "data": { "connected": false, "threshold_sats": null, "topup_sats": null, "tier": null, "last_topup_at": null, "last_topup_sats": null, "last_error": null } }

cURL

URL=https://nymbot.ai/api/v1/nwc-auto-topup/connection
curl -X DELETE "$URL" -H "Authorization: $(nostr_auth DELETE "$URL")"

Python

import requests

url = "https://nymbot.ai/api/v1/nwc-auto-topup/connection"
print(requests.delete(url, headers={"Authorization": nostr_auth("DELETE", url)}).json())

JavaScript

const url = "https://nymbot.ai/api/v1/nwc-auto-topup/connection";
const res = await fetch(url, { method: "DELETE", headers: { "Authorization": nostrAuth("DELETE", url) } });
console.log(await res.json());

Key hman lova request tinah hlawh chhuahna

फिक्स्ड-प्राइस एंडप्वाइन्टस लाइटनिंग के माध्यम से एक बार में एक अनुरोध के लिए भुगतान किया जा सकता है, जिसमें कोई चाबी नहीं, कोई खाता नहीं और कोई शेष राशि नहीं हैः POST /images/generations, POST /images/edits, POST /videos, POST /audio/speech, POST /audio/transcriptions, POST /audio/translations leh POST /embeddings. Chat, Responses leh Messages kawngah hian key a ngai reng a. Key nei tawh request hi i balance atangin a hman ang zawngin a hman leh dawn a; key awm lo hian payment flow a tan chauh a ni.

निम्बॉट एक ही विचार के दो संस्करण बोलते हैं, एक बैकएंड सेः लाइटनिंग लैब्स ' L402 (a hming hlui hmang pawhin pawh a pawm a, LSAT) leh IETF draft Chawmna HTTP authentication scheme nena lightning पद्धति और charge intent. I client hriatthiam chin engpawh hmang rawh se.

I server mahni ngeiin hman tumna

बिना चाबी दे भुगतान तभी चालू रहता है जब API_L402_SECRET hex (character 64) emaw base64 (44) ang hian random bytes 32 emaw aia tam a nei, make pakhat i duh chuan openssl rand -hex 32A tawi deuh emaw, hriat awlsam deuh value hman chuan feature chu a tiṭhar thei a, a chhan leh a chhuak chhan (log) pawh a chhuak bawk. A thlak (rotate) nan chuan, a hmasa value chu... API_L402_SECRET_PREVIOUS ni khat chhungin: credentials, status URLs leh a hnuaia siam challenge-te chu an tawp hma chuan an thang reng ang.

Inṭlâwkna

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Authorization ईएफ हेडर। यदि यह वैध है, तो कुछ भी नहीं चलता है, और आप प्राप्त करते हैं 402 Payment Required उस अनुरोध की कीमत के लिए एक चालान के साथः एक कुंजी उसी कीमत का भुगतान करेगी, 10 सैट्स पर एक मानक क्रेडिट या 100 सैट्स पर एक प्रो क्रेडिट में परिवर्तित होगी और एक पूरे सैट्स तक पूर्ण होगी (कम से कम 1 सैट्स, और कम से कम 0.05 क्रेडिट न्यूनतम)। प्रतिक्रिया में तीन शामिल हैं। WWW-Authenticate invoice chu mah hian harsatna te:

HTTP/1.1 402 Payment Required
Content-Type: application/problem+json; charset=utf-8
Cache-Control: no-store
WWW-Authenticate: L402 macaroon="AgJC...", invoice="lnbc2370n1..."
WWW-Authenticate: LSAT macaroon="AgJC...", invoice="lnbc2370n1..."
WWW-Authenticate: Payment id="kM9x...", realm="nymbot", method="lightning", intent="charge",
    request="eyJhbW91bnQiOiIyMzciLC...", description="Nymbot API POST /images/generations (237 sats)",
    digest="sha-256=:X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=:", expires="2026-09-30T12:15:00.000Z",
    opaque="eyJlbmRwb2ludCI6IlBPU1QgL2ltYWdlcy9nZW5lcmF0aW9ucyJ9"

{
  "type": "https://paymentauth.org/problems/payment-required",
  "title": "Payment Required",
  "status": 402,
  "detail": "This request costs 237 sats. Pay the Lightning invoice, then send the identical request again ...",
  "challengeId": "kM9x...",
  "amount_sats": 237,
  "invoice": "lnbc2370n1...",
  "payment_hash": "9db1370f...",
  "expires_at": "2026-09-30T12:15:00.000Z",
  "error": { "message": "This request costs 237 sats. ...", "type": "payment_required", "code": "payment_required", "param": null }
}

Chawmna request टीएच पैरामीटर बेस64युआरएल जे. एस. ओ. एन.: {"amount":"237","currency":"sat","methodDetails":{"invoice":"lnbc...","network":"mainnet","paymentHash":"..."}}.

एक चुनौती अंतिम बिंदु से बंधी होती है, Content-Type (a media type leh, multipart atan chuan, a boundary) leh i thawn bytes exact body-a SHA-256 hman leh, minute 15 chang ngei ang a ni. Tan hman tawh hnuah, hei hi thawn rawh समान नहोस्। वोल्फ रिक्वैस्ट रीयूथः द सेम Content-Type समान जे. एस. ओ. एन. बाइट्स, या बहुभागीय समापन बिंदुओं के लिए (/images/edits, /audio/transcriptions, /audio/translationsवाय) समान सीमारेखा के साथ एक ही बहु-भाग निकाय। अधिकांश एच. टी. टी. पी. पुस्तकालय हर बार जब वे एक फॉर्म को कूटबद्ध करते हैं तो एक नई सीमा चुनते हैं, इसलिए इसे एक बार कूटबद्ध करें और उन बाइट्स को दो बार भेजें।

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 429 nenin Retry-After, a thil thu an chhiar hmaa rawn thawn. Key emaw credential emaw awm lova endpoint an chan pawh, address tinin minute khatah unauthenticated request 120 limit chungchangah chuan an lang vek ang. Credential chu a thil thu an chhiar hmaa an en thin a, a request chu... Content-Type ni lo application/json (अथवा multipart/form-data upload tan) chu heti hian a hnawl/a lo paih a ni 415 chutuk bill an dawng ngai suh.

एम्बेडिंग्स की कीमत इनपुट में टोकन के अनुमान से, 1.5&times; मार्जिन के साथ निर्धारित की जाती है, क्योंकि वास्तविक गिनती केवल बाद में ज्ञात होती है। आप वास्तव में उपयोग किए गए टोकन के लिए भुगतान करते हैं, और भुगतान का अप्रयुक्त हिस्सा एक के रूप में वापस आता है। रिफंड टोकन.

भुगतान भेजना

बिजली के किसी भी बटुए से चालान का भुगतान करें। बटुए में आपको 64 हेक्स वर्णों का पूर्वचित्र मिलता है। फिर इनमें से किसी एक के साथ वही अनुरोध भेजेंः

RuahmannaहेडरName
L402Authorization: L402 <macaroon>:<preimage> (LSAT a thawk bawk)
ChawmnaAuthorization: Payment <base64url JSON>, JSON kha awmna chu a ni {"challenge": {every parameter of the challenge, as sent}, "payload": {"preimage": "<hex>"}}

ए. एफ. ए. भुगतान अनुरोध का जवाब ठीक वैसा ही होता है जैसा एक चाबी के साथ दिया जाता है, सिवाय इसके कि nymbot ओबजेक्टकक कोनो संतुलनक फील्ड्स न्हयः {"payment": "l402", "tier": "pro", "paid_sats": 237, "charged_sats": 237}, leh a awm lo bawk X-Nymbot-Balance-Sats header. A Payment scheme hmanga hlawh tawh request pawh a hmu thei ang Payment-Receipt ईएफआर हेडर (बेस64यूआरएल जे. एस. ओ. एन. चैलेंज आई. डी. के साथ, भुगतान हैश के रूप में) reference, status leh timestamp). सशुल्क अनुरोध कोनो nym के साथ बंधे नहीं हैं, इसलिए वे क्वेरी इतिहास में दिखाई नहीं देते हैं।

पी. टी. यू. स्थितिकद...
402 payment_already_usedप्रत्येक भुगतान एक अनुरोध के लिए भुगतान करता है। प्रतिक्रिया इस अनुरोध के लिए एक नई चुनौती है, इसलिए एक ग्राहक जो अपनी अंतिम साख (के रूप में) कैश करता है। lnget a tawk chauh a hlawh leh thin.
402 payment_mismatchCredential hi endpoint dang atan siam a ni, Content-Type thawm mai nia, he thil dilna hi a hlawm zawk a nih chuan, i hman tawh kha i hlawhtlin loh chuan i hman leh thei ang. रिफंड टोकन (refund_token leh refund_sats thlarau hnuaia.
402 payment_expiredचैलेंज 15 मिनटों से अधिक बीत चुका है। एक नया चैलेंज इसके साथ आता है। अगर प्रीमेज दिखाता है कि आपने भुगतान किया है, तो आप जो भुगतान करते हैं वह भुगतान के रूप में वापस आ जाता है। रिफंड टोकन (refund_token leh refund_sats शरीर में), एक बार; फिर साख का उपयोग किया जाता है।
401 invalid_preimage<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
401 invalid_payment_credentialशंसापत्र विकृत है, निम्बॉट द्वारा जारी किए जाने के बाद इसे बदल दिया गया था, या किसी भुगतान हैश का नाम दिया गया था, निम्बॉट ने कभी इसके लिए चालान जारी नहीं किया था। निम्बॉट को पता नहीं है, या विरोधाभासी चेतावनी के साथ एक मैकरून को अस्वीकार कर दिया जाता है।
429 rate_limit_exceededCredential emaw key check fail zat 30 aia tam in minute khat chhungin he address atangin a lo chhuak a, emaw refund token minute khat chhungin 60 aia tam a lo thawn a ni. Dut hle rawh... Retry-After.

cURL

BODY='{"model":"nano-banana","prompt":"a lighthouse at dusk","response_format":"b64_json"}'
URL=https://nymbot.ai/api/v1/images/generations

# 1. Get the challenge
CH=$(curl -s -D - -o /dev/null "$URL" -H "Content-Type: application/json" -d "$BODY" | grep -i '^www-authenticate: L402')
MAC=$(echo "$CH" | sed -E 's/.*macaroon="([^"]+)".*/\1/')
INVOICE=$(echo "$CH" | sed -E 's/.*invoice="([^"]+)".*/\1/')

# 2. Pay $INVOICE with your wallet and copy the preimage
PREIMAGE=...

# 3. Send the identical request with the credential
curl "$URL" -H "Content-Type: application/json" -H "Authorization: L402 $MAC:$PREIMAGE" -d "$BODY"

lnget

# lnget (Lightning Labs) pays L402 challenges from your own lnd node and retries for you
lnget -X POST -H "Content-Type: application/json" \
  -d '{"model":"nano-banana","prompt":"a lighthouse at dusk","response_format":"b64_json"}' \
  https://nymbot.ai/api/v1/images/generations

Python

import base64, json, re
import requests

url = "https://nymbot.ai/api/v1/images/generations"
body = json.dumps({"model": "nano-banana", "prompt": "a lighthouse at dusk", "response_format": "b64_json"}).encode()
headers = {"Content-Type": "application/json"}

challenge = requests.post(url, data=body, headers=headers)
assert challenge.status_code == 402
info = challenge.json()
print("Pay", info["amount_sats"], "sats:", info["invoice"])

preimage = pay_with_your_wallet(info["invoice"])  # 64 hex characters

# L402
mac = re.search(r'L402 macaroon="([^"]+)"', challenge.headers["WWW-Authenticate"]).group(1)
res = requests.post(url, data=body, headers={**headers, "Authorization": f"L402 {mac}:{preimage}"})
print(res.json()["nymbot"])

JavaScript

const url = "https://nymbot.ai/api/v1/images/generations";
const body = JSON.stringify({ model: "nano-banana", prompt: "a lighthouse at dusk", response_format: "b64_json" });
const headers = { "Content-Type": "application/json" };

const challenge = await fetch(url, { method: "POST", headers, body });
const www = challenge.headers.get("www-authenticate");

// The Payment scheme: echo every challenge parameter back with the preimage
const start = www.indexOf("Payment ");
const params = Object.fromEntries([...www.slice(start + 8).matchAll(/(\w+)="((?:[^"\\]|\\.)*)"/g)].map((m) => [m[1], m[2]]));
const { invoice } = JSON.parse(Buffer.from(params.request, "base64url").toString()).methodDetails;
const preimage = await payWithYourWallet(invoice);

const credential = Buffer.from(JSON.stringify({ challenge: params, payload: { preimage } })).toString("base64url");
const res = await fetch(url, { method: "POST", headers: { ...headers, Authorization: `Payment ${credential}` }, body });
console.log((await res.json()).nymbot, res.headers.get("payment-receipt"));

Client-te hnahthan chu mppx Lightning method hmangin Payment challenge chu an mahni ngeiin an ti ang e; endpoint hnenah an thawn la, an chawih let dawn tih hre reng rawh se.

Video-te

ए. ए. ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए.-ए POST /videos chhanna 202 key nei ang, leh a status_url: GET जब तक काम रखा जाता है, तब तक इसे बिना किसी चाबी के डिस्कनेक्ट करें। यह हस्ताक्षरित होता है और 24 घंटे काम करता है।

{
  "id": "vid_...",
  "status": "in_progress",
  "status_url": "https://nymbot.ai/api/v1/videos/vid_...?exp=1790000000&sig=...",
  "nymbot": {
    "payment": "l402", "tier": "pro", "paid_sats": 4800, "charged_sats": 4800,
    "refund_token": "REFUND-5E0B..."
  }
}

जिंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंंं refund_token he chhanna atangin: heta chauh a lang. Video siam chhuah lai hian a ruak (GET /api/v1/l402/refunds chhanna "status": "pending"); if render a sual a, billing siam loh pawhin, payment chu chumiah chuan a tla ang. Status URL-in a lantir. refund_sats रिफंड नौकरी के लिए, लेकिन टोकन कभी नहीं, इसलिए स्थिति यू. आर. एल. साझा करने से रिफंड साझा नहीं होता है। टोकन की जाँच करने से एक असफल काम भी तय होता है जिसे किसी ने मतदान नहीं किया था।

धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापसी धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती धनवापत्ती

यदि कोई भुगतान अनुरोध विफल हो जाता है और प्रदाता प्रयास के लिए निम्बॉट को बिल देता है, तो भुगतान रखा जाता है और त्रुटि ऐसा कहती है, charged_sats<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< रिफंड टोकन आपने जितना भुगतान किया, उसके लायकः

{
  "error": {
    "message": "The image generator failed. Nothing was charged. Please try again. The 237 sats you paid are on refund token REFUND-...",
    "type": "api_error",
    "code": "upstream_error",
    "refund_token": "REFUND-0C15DBED145D59131BA70298A413ADEB3D9B9AB082C476EA70A5BD38FCA5DE6D",
    "refund_sats": 237,
    "refund_expires_at": "2026-10-30T12:00:00.000Z"
  }
}

अब्यबहृत पुर्जेज़ उसे तरीके से वापस आते हैंः यदि आपने दो चित्र मांगे और एक असफल रहा, तो सफलता की प्रतिक्रिया nymbot ईओएफ ऑब्जेक्ट लापता ऑब्जेक्ट के लिए रिफंड टोकन रखता है; एक प्रतिलेखन जिसकी लंबाई सामने पढ़ी नहीं जा सकी, फ़ाइल की कीमत सबसे लंबी हो सकती है (कभी भी 30 मिनट से अधिक नहीं), और वास्तविक लंबाई का अंतर रिफंड टोकन के रूप में वापस आता है; अगर यह 30 मिनट से अधिक लंबा हो जाता है, तो इसे अस्वीकार कर दिया जाता है। 413 payment zawng zawng kha a lo let leh mai. Embeddings chuan estimate-in a hnawhchhuah loh kha a lo thawn leh thin. Video sual kha a submission-in a thawn leh kha token-ah a lo let leh thin.

रिफंड टोकन एक यादृच्छिक 256-बिट कोड है। निम्बॉट केवल अपने हैश को संग्रहीत करता है, और यह 30 दिनों के बाद समाप्त हो जाता है। यह एक सैट शेष राशि रखता है, और आप कर सकते हैंः

  • मैं इसके साथ भुगतान करूँगा। Thawn rawh Authorization: Bearer REFUND-… उपरोक्त किसी भी अंतिम बिंदु पर (एक ओपनएआई एसडीके इसे अपनी एपीआई कुंजी के रूप में लेता है)। कीमत टोकन से निकलती है और जो बचा रहता है वह उस पर बना रहता है (refund_token_sats जिसमे nymbot ए. एफ. ओ. ऑब्जेक्ट). अनुरोध जवाबों से कम मूल्य का एक टोकन। 402 refund_insufficientपी. ए. आर. ए.; बिल न भरे जाने पर विफलता सैट्स को उसी टोकन पर वापस लाती है।
  • जरा चेक करिये. GET /api/v1/l402/refunds एक समान हेडर रिटर्न के साथ {"sats": 237, "status": "open", "expires_at": "..."}.
  • Token pakhat hi minute khatah a chang chuan vawi 60 chauh hmang theih a ni.
  • <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< इसमे चिपकाओ Pawnzawng thil lak (gift) rawn lak rawh निम्बॉट ऐप में फोन करो, या कॉल करो POST /api/v1/l402/refunds/redeem ए. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. के. thup chu thurawn duat tura duhna a awm viau leh {"refund_token": "REFUND-...", "balance": "standard"} (अथवा "pro"ए. पी. आई. अनुरोधों के लिए टोकन पर पूरे क्रेडिट नहीं रहने वाले पूरे क्रेडिट शेष राशि में जाते हैं (प्रत्येक मानक पर 10 सैट्स, प्रो पर 100 सैट्स)।

cURL

URL=https://nymbot.ai/api/v1/l402/refunds/redeem
BODY='{"refund_token":"REFUND-...","balance":"standard"}'
curl "$URL" \
  -H "Authorization: $(nostr_auth POST "$URL" "$BODY")" \
  -H "Content-Type: application/json" \
  -d "$BODY"

Chhanna

{ "data": { "credited": 23, "tier": "standard", "balance_credits": 123, "remaining_sats": 7 } }