വിജ്ഞാന അടിത്തറ വികസനക്കാർ
ബാലൻസ്, Top-ups and Keys
നിങ്ങളുടെ പക്കലുള്ളത് പരിശോധിക്കുക, ലൈറ്റ്നിങ്ങിന് മുകളിൽ ടോപ്പ് അപ്പ് ചെയ്യുക, നിങ്ങളുടെ സ്വന്തം വാലറ്റിൽ നിന്ന് ഓട്ടോമാറ്റിക്കായി ടോപ്പ് അപ്പ് ചെയ്യുക, ഓരോ അഭ്യർത്ഥനയ്ക്കും എത്ര ചെലവാകുമെന്ന് കാണുക, കോഡിൽ നിന്നുള്ള കീകൾ കൈകാര്യം ചെയ്യുക.
ഈ പേജ് സൗകര്യാർത്ഥം മെഷീൻ വിവർത്തനം ചെയ്തതാണ്. ഇംഗ്ലീഷ് ഒറിജിനൽ ആണ് ബാധകമായ പതിപ്പ്.
ബാലൻസ് പരിശോധിക്കുന്നു
നിങ്ങളുടെ ബാലൻസ് രണ്ടും, ഈ താക്കോൽ കപ്പൽ എത്ര ഉപയോഗിക്കുന്നു.
GET https://nymbot.ai/api/v1/credits/balance - ഒരു API കീ ആവശ്യമാണ്. POST ഇത് പ്രതീക്ഷിക്കുന്ന ഉപഭോക്താക്കൾക്കും
balance നിലവിലെ ബിറ്റ്കോയിൻ വിലയിൽ ഡോളറിൽ രണ്ട് ബാലൻസുകളും ഒരുമിച്ച് ഉണ്ടോ, ഒരൊറ്റ നമ്പർ പ്രതീക്ഷിക്കുന്ന ഉപകരണങ്ങൾക്ക് (null വില വായിക്കാനാവില്ലെങ്കിൽ) ബാക്കിയുള്ളത് ക്രെഡിറ്റുകളും സെറ്റുകളും ആണ്, അതുകൊണ്ടാണ് ശമ്പളങ്ങൾ യഥാർത്ഥത്തിൽ നിലനിർത്തുന്നത്. key അതിനുശേഷം ഒരു കയ്യിലേക്കുള്ള കയ്യിലുണ്ടാക്കിയ കയ്യിലുണ്ടാക്കിയ കയ്യിലുണ്ടാക്കിയ കയ്യിലുണ്ടാക്കിയ കയ്യിലേക്കുള്ള കയ്യിലുണ്ടാകാം.
പ്രതികരണം
{
"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"
}
}
| സ്റ്റാറ്റസ് | എപ്പോൾ |
|---|---|
401 | താക്കോൽ കാണാനില്ല, അജ്ഞാതമാണ്, പിൻവലിക്കപ്പെട്ടതോ കാലഹരണപ്പെട്ടതോ ആണ്. |
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);
പണമടയ്ക്കൽ രീതികൾ
എങ്ങനെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊക്കെയൊ.
GET https://nymbot.ai/api/v1/topup/payment-methods താക്കോൽ ആവശ്യമില്ല
10 മുതൽ 1,000,000 മുതൽ ഒരു മുകളിൽ; ഒരു പ്രോ മുകളിൽ കുറഞ്ഞത് ഒരു പ്രോ ക്രെഡിറ്റ് വാങ്ങണം, അതിനാൽ ഇത് 100 മുതൽ ആരംഭിക്കുന്നു. bulk_bonus ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയർന്ന ഉയ
പ്രതികരണം
{
"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);
മിന്നലിന് മുകളിൽ ടോപ്പിംഗ്
ഒരു മിന്നൽ ഇൻവോയ്സ് ഉണ്ടാക്കുന്നു, അത് താക്കോൽ ഉൾക്കൊള്ളുന്ന നെയിമിലേക്ക് ക്രെഡിറ്റ് ചേർക്കുന്നു. ഏതെങ്കിലും മിന്നൽ വാലറ്റിൽ നിന്ന് അത് അടയ്ക്കുക, തുടർന്ന് പരിശോധിക്കുക ക്രെഡിറ്റ് നല് കുന്നതിന്
POST https://nymbot.ai/api/v1/topup/create/btc-lightning - ഒരു API കീ ആവശ്യമാണ്.
| ഫീൽഡ് | തരം | ആവശ്യം | വിശദീകരണം |
|---|---|---|---|
amount | നമ്പർ | അതെ | എത്ര, ഇൻ currency. സാറ്റുകൾക്ക് ഒരു മുഴുവൻ സംഖ്യ. |
currency | സ്ട്രിംഗ് | ഇല്ല. | SATS (എന്നാല് അക്രമം USD അല്ലെങ്കിൽ BTCനിലവിലെ ബിറ്റ്കോയിൻ വിലയിലാണ് ഡോളറുകൾ പരിവർത്തനം ചെയ്യപ്പെടുന്നത്. |
tier | സ്ട്രിംഗ് | ഇല്ല. | pro (സ്ഥിരസ്ഥിതി) അല്ലെങ്കിൽ standard: ഏത് ബില്യണ് ക്രെഡിറ്റ് പോകുന്നു. |
ഒരു സ്റ്റാൻഡേർഡ് ക്രെഡിറ്റ് 10 സാറ്റുകളും ഒരു പ്രോ ക്രെഡിറ്റ് 100 സാറ്റുകളും കൂടാതെ ഏതെങ്കിലും ബൾക്ക് ബോണസും ആണ്.
credits ഈ ഇൻവോയ്സ് എന്താണ് ചേർക്കുന്നതെന്ന് പറയുന്നു.
പ്രതികരണം
{
"invoice_id": "b7d41e0c95a2f38e6c1d0e9a4b7f2c61d3e8a05f9b2c4d7e1a6f3b8c0d5e2a9f4",
"payment_request": "lnbc100u1p5...",
"amount_sats": 10000,
"credits": 115,
"tier": "pro",
"expires_at": "2026-09-30T09:27:00Z",
"status": "pending"
}
| സ്റ്റാറ്റസ് | എപ്പോൾ |
|---|---|
400 | പാതയിലെ മറ്റൊരു രീതി (unsupported_method), ഒരു അജ്ഞാത കറൻസി (unsupported_currency) അല്ലെങ്കിൽ ശ്രേണി, നഷ്ടപ്പെട്ട തുക, അല്ലെങ്കിൽ ഏറ്റവും കുറഞ്ഞ തുകയ്ക്ക് താഴെയുള്ള തുക (amount_too_small), മുകളിൽ 1,000,000 സാറ്റുകൾ (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);
ടോപ്പ്-അപ്പ് പരിശോധിക്കുന്നു
അക്കൗണ്ടിൽ പണം ചെലവഴിച്ചിട്ടുണ്ടോ എന്ന് ചോദിക്കുന്നു, അത് ഉണ്ടെങ്കിൽ, ക്രെഡിറ്റ് ചേർക്കുന്നു. creditedപിന്നീട് വീണ്ടും പരിശോധിക്കുക സുരക്ഷിതമാണ്: ക്രെഡിറ്റ് ഒരു തവണ, എത്ര തവണ ചോദിച്ചാലും.
GET https://nymbot.ai/api/v1/topup/status/{invoice_id} - ഇൻവോയ്സ് നിർമ്മിച്ച നിമിൽ നിന്ന് ഒരു താക്കോൽ ആവശ്യമാണ്.
status ആണ് pending (എന്നാല് ഇതുവരെ പണം നല് കിയിട്ടില്ല) paid (എന്നാൽ ഇതുവരെ വിലയിരുത്തിയിട്ടില്ല; വീണ്ടും പരിശോധിക്കുക) credited (നിങ്ങളുടെ ബാലൻസിൽ) അല്ലെങ്കിൽ expired (കൃത്യസമയത്ത് അടച്ചിട്ടില്ല). ബാലൻസ് ഫീൽഡുകൾ ഇൻവോയ്സ് ടോപ്പ് അപ്പ് ചെയ്യുന്ന നിരയ്ക്കാണ്.
പ്രതികരണം
{
"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);
ചരിത്രം വേണം
ഓരോ അഭ്യർത്ഥനയ്ക്കും ഒരു വരിഃ അത് എന്തായിരുന്നു, ഏത് മോഡൽ, എത്ര ടോക്കണുകൾ, അതിന്റെ വില. പ്രോംപ്റ്റുകളോ ഉത്തരങ്ങളോ സൂക്ഷിക്കുന്നില്ല, അതിനാൽ ഒന്നും തിരികെ നൽകുന്നില്ല. വരികൾ 90 ദിവസത്തേക്ക് സൂക്ഷിക്കുന്നു, ഏറ്റവും പുതിയത് ആദ്യം. അതിന്റെ തൊപ്പിയിലെത്തിയ ഒരു കീയ്ക്ക് ഇപ്പോഴും അതിന്റെ ചരിത്രം വായിക്കാൻ കഴിയും.
GET https://nymbot.ai/api/v1/queries/history - സ്വന്തം അഭ്യർത്ഥനകൾ കാണുന്ന ഒരു API കീ ആവശ്യമാണ്, അല്ലെങ്കിൽ Signed അപേക്ഷ ഓരോ കവികളും കാണുന്ന നിന്റെ നൈം.
| ഫീൽഡ് | തരം | ആവശ്യം | വിശദീകരണം |
|---|---|---|---|
page | ഏകദേശം (query) | ഇല്ല. | ഡിഫൈറ്റ് 1, ഏറ്റവും കൂടുതൽ 1,000; ഒരു ഉയർന്ന പേജ് 400 invalid_value. |
page_count | ഏകദേശം (query) | ഇല്ല. | ഓരോ പേജിലും വരികൾ. സ്ഥിരസ്ഥിതി 20, പരമാവധി 100. |
start_dateend_date | സ്ട്രിംഗ് (അന്വേഷണം) | ഇല്ല. | ഐഎസ്ഒ 8601 തീയതികളും സമയങ്ങളും. |
model | സ്ട്രിംഗ് (അന്വേഷണം) | ഇല്ല. | ഈ മോഡൽ മാത്രം |
type | സ്ട്രിംഗ് (അന്വേഷണം) | ഇല്ല. | chat, responses, messages, image, video, speech, transcription അല്ലെങ്കിൽ embedding. |
all_keys | ബൂലിയൻ (ചോദ്യം) | ഇല്ല. | ഒരു താക്കോൽ : true ഒരേ നാമത്തിൻറെ എല്ലാ താക്കോലുകളും ഉൾപ്പെടുന്നു. സ്ഥിരസ്ഥിതിയായി false. |
key_id | സ്ട്രിംഗ് (അന്വേഷണം) | ഇല്ല. | പ്രതിവാരാസൂത്രണ രേഖ ( all_keys=true: ഈ താക്കോൽ മാത്രം. |
പ്രതികരണം
{
"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);
അക്കൌണ്ട് അഭ്യർത്ഥനകൾ ഒപ്പിടുന്നു
അക്കൗണ്ട് സജ്ജീകരണവും ഓട്ടോമാറ്റിക് ടോപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്-ഉപ്പ്
ആപ്ലിക്കേഷൻ നിങ്ങൾക്കായി ഇത് ചെയ്യുന്നുഃ അതിൽ ഉള്ളതെല്ലാം എ. പി. ഐ. ഈ ഭാഗം നിങ്ങൾക്ക് നിങ്ങളുടെ സ്വന്തം കോഡ് നിന്ന് താക്കോലുകൾ മാനേജ്മെന്റ് ചെയ്യാൻ മാത്രം വേണം.
Signature is a Nostr event of kind 27235 (NIP-98), sent base64-coded in the
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അപേക്ഷയുടെ full URL, query string included, precisely as sent.methodഇത് HTTP Method ആണ്.payloadSHA-256 എന്ന താളിൽ നിന്നും തിരിച്ചുവിട്ടതു പ്രകാരം, It is required onPOSTഒപ്പംPATCH, നിങ്ങൾ അയയ്ക്കുന്ന ശരീരം നിങ്ങൾ ഹാഷ് ചെയ്ത ബൈറ്റിന് ബൈറ്റ് ആയിരിക്കണം.created_atസെർവറിന്റെ സമയം കഴിഞ്ഞ് 60 സെക്കൻഡിനുള്ളിൽ ആയിരിക്കണം.- ഓരോ സംഭവവും ഒരിക്കൽ പ്രവർത്തിക്കുന്നു.
GETഅതിനുശേഷമാണ്, അതിനുശേഷമാണ്, അതിനുശേഷമാണ്, അതിനുശേഷമാണ്, അതിനുശേഷമാണ്, അതിനുശേഷമാണ്, അതിനുശേഷമാണ്, അതിനുശേഷമാണ്, അതിനുശേഷമാണ്, അതിനുശേഷമാണ്.nonceഒരേ സെക്കന്റിൽ രണ്ടാമത്തെ അപേക്ഷകൾ ഒരേ സെക്കന്റിൽ രണ്ടാമത്തെ അപേക്ഷകൾ ഇപ്പോഴും വ്യത്യസ്തമാകുന്നു. - രജിസ്റ്റർ ചെയ്ത അപേക്ഷയുടെ ശരീരം ഏറ്റവും കൂടുതൽ 64 KB ആകാം, ഒരു ശരീരം ആവശ്യമാണ്.
Content-Type: application/json.
കാണാതായ ഒരു സംഭവം മടങ്ങിവരുന്നു 401 missing_nostr_authമോശമായി രൂപകൽപ്പന, മോശമായി അടക്കപ്പെട്ട, വളരെ പഴയ, അല്ലെങ്കിൽ വ്യത്യസ്ത URL, രീതി അല്ലെങ്കിൽ ശരീരം തിരികെ
invalid_nostr_auth, സന്ദേശത്തിലെ കാരണത്തോടൊപ്പം; വീണ്ടും ഉപയോഗിച്ച ഒന്ന് തിരികെ നൽകുന്നു
nostr_auth_replayedഈ അഡ്മിനിറ്റുകളിലേക്ക് അയച്ച ഒരു API താക്കോൽ നിഷേധിക്കപ്പെടുന്നു.ആർട്ടിംഗ് വായിക്കുന്നതിന് മുമ്പ് അഡ്മിനിറ്റ് പരിശോധിക്കപ്പെടുന്നു, ഓരോ അഡ്മിനിറ്റും മിനിറ്റിൽ 30 പ്രാവശ്യം അത് പരാജയപ്പെടാം (ഒരു IPv6 അഡ്മിനിറ്റും മുഴുവൻ /64); പിന്നീട് അത് ലഭിക്കും. 429 കൂടെ
Retry-After.
ഈ പ്രോഗ്രാമിന് റെ ഫീച്ചറുകളെ കുറിച്ചുള്ള അളവുകളാണ് ഇസ് ലാമിന്റെ പ്രോഗ്രാമിന്റെ (https://nymbot.ai,
https://nymchat.app ഏതെങ്കിലും മറ്റൊരു സൈറ്റിലെ ഒരു പേജിൽ CORS തലമുറകൾ തിരികെ ലഭിക്കുന്നില്ല, അതിനാൽ അവർ തിരികെ നൽകിയത് വായിക്കാനാവില്ല.
Origin, ബാധിക്കപ്പെടുന്നില്ല.
ഒപ്പിടുന്നതിന് നിങ്ങളുടെ എൻ. ഐ. എമ്മിൻറെ രഹസ്യ താക്കോൽ ആവശ്യമാണ്. nsec), ഇത് എല്ലാം നിയന്ത്രിക്കുന്നുഃ നിങ്ങളുടെ വ്യക്തിത്വം, നിങ്ങളുടെ ചരിത്രം, നിങ്ങളുടെ ബാലൻസ്. നിങ്ങൾ വിശ്വസിക്കുന്ന ഒരു മെഷീനിൽ ഒരു സ്ക്രിപ്റ്റിൽ മാത്രം ഇടുക, ഫയലിൽ എഴുതുന്നതിനേക്കാൾ പരിസ്ഥിതിയിൽ നിന്ന് വായിക്കുക, നിങ്ങൾക്ക് കഴിയുമ്പോൾ ആപ്ലിക്കേഷൻ തിരഞ്ഞെടുക്കുക.
ഈ ഉപയോക്താക്കൾ ഹെഡർ നിർമ്മിക്കുന്നു. ഈ പേജിലെ പിന്നീട് ഉദാഹരണങ്ങൾ ഉപയോഗിക്കുന്നു. NOSTR_SECRET_HEX; CURL one ഉപയോഗിക്കുന്നു
നാക്. ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺലൈൻ ഓൺ sha256sum (മാക്ഒഎസിൽ, 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");
}
അക്കൌണ്ട് സംഗ്രഹം
ആപ്ലിക്കേഷന്റെ എപിഐ ഷീറ്റ് മുകളിൽ എന്താണ് കാണിക്കുന്നത്ഃ നിങ്ങളുടെ പൊതു കീ, രണ്ട് ബാലൻസുകളും, എത്ര കീകൾ സജീവമാണ് (പിൻവലിക്കുകയോ കാലഹരണപ്പെടുകയോ ചെയ്തിട്ടില്ല), ഓട്ടോമാറ്റിംഗ് Top-Up നിരീക്ഷണങ്ങൾ, അല്ലെങ്കിൽ
null സേവനം നല് കുന്നില്ലെങ്കില്
GET https://nymbot.ai/api/v1/account - ആവശ്യമുണ്ട്. Signed അപേക്ഷ.
പ്രതികരണം
{
"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());
താക്കോലുകൾ മാനേജർ
ആപ്ലിക്കേഷന്റെ പ്രധാന പട്ടികയ്ക്ക് പിന്നിലെ അവസാന പോയിന്റുകൾ. അവയ്ക്കെല്ലാം ഒരു ആവശ്യമുണ്ട് ഒപ്പിട്ട അപേക്ഷഓരോ കീയും ഈ രൂപത്തിൽ തിരികെ നൽകുന്നു, ഐഎസ്ഒ 8601 ലെ സമയവും സാറ്റുകളിലെ അളവുംഃ
പ്രധാന വസ്തുത
{
"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 ഒരു താക്കോൽ തിരിച്ചറിയാൻ ഇത് മതിയാകും, പക്ഷേ അത് ഉപയോഗിക്കരുത്. താക്കോൽ നിർമ്മിക്കുമ്പോൾ ഒരു തവണ മാത്രമേ അത് തിരികെ നൽകൂ.
കീകൾ പട്ടികപ്പെടുത്തുന്നു
GET https://nymbot.ai/api/v1/keys - ഒപ്പുവച്ചു.
| ഫീൽഡ് | തരം | ആവശ്യം | വിശദീകരണം |
|---|---|---|---|
include_revoked | ബൂലിയൻ (ചോദ്യം) | ഇല്ല. | അഡ്മിനിസ്ട്രേഷൻ ഫീച്ചറുകൾ - Default false. |
പ്രതികരണം
{ "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 തിരിച്ചുപോകുന്നു - Return 201.
| ഫീൽഡ് | തരം | ആവശ്യം | വിശദീകരണം |
|---|---|---|---|
name | സ്ട്രിംഗ് | അതെ | 1 മുതൽ 40 വരെ അക്ഷരങ്ങൾ, നിങ്ങളുടെ മറ്റ് സജീവ കീകളിൽ നിന്ന് വ്യത്യസ്തമാണ് (കേസ് അവഗണിക്കുന്നു). |
limit_sats | പൂർണ്ണസംഖ്യ | ഇല്ല. | ചെലവുകൾക്കുള്ള പരിധി കുറഞ്ഞത് 1. ഒരു പരിധിയുമില്ലാതെ അത് ഒഴിവാക്കുക. |
reset_period | സ്ട്രിംഗ് | ഇല്ല. | daily, weekly അല്ലെങ്കിൽ monthly. ആവശ്യങ്ങളുണ്ട്. limit_satsഒരിക്കലും തിരിച്ചുവരുത്തുന്ന ഒരു കപ്പലിനു വേണ്ടി അത് പുറത്തു വിടുക. |
expire_at | സ്ട്രിംഗ് അല്ലെങ്കിൽ പൂർണ്ണസംഖ്യ | ഇല്ല. | കീ പ്രവർത്തനം നിർത്തുമ്പോൾഃ ഒരു ഐഎസ്ഒ 8601 സമയം, അല്ലെങ്കിൽ 1970 മുതൽ മില്ലിസെക്കൻഡുകൾ. |
പ്രതികരണം (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); അല്ലെങ്കിൽ 25 ഇപ്പോൾ പ്രവർത്തിക്കുന്ന ക്ലിക്ക് (too_many_keys). |
429 | ഇതിന്റെ എണ്ണം എണ്ണം എണ്ണം എണ്ണം എണ്ണം എണ്ണം എണ്ണം (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);
ഒരു താക്കോൽ വായിക്കുക
GET https://nymbot.ai/api/v1/keys/{id} - ഒപ്പുവച്ചു.
തിരിച്ചുവരവുകൾ {"data": {…}} പ്രധാന വസ്തുവുമായി, അല്ലെങ്കിൽ 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 ഒപ്പം
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 കാണാം, കാണാം, കാണാം include_revoked=trueഇതിനകം പിൻവലിച്ച ഒരു കീ പിൻവലിക്കുന്നത് അതേ രീതിയിൽ ഉത്തരം നൽകുന്നു. പിൻവലിച്ച ഏറ്റവും പുതിയ 50 കീകൾ മാത്രമേ സൂക്ഷിക്കുകയുള്ളൂ; മറ്റൊരു കീ പിൻവലിക്കുമ്പോൾ പഴയവ ഇല്ലാതാക്കപ്പെടും.
പ്രതികരണം
{ "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());
NWC AUTO-TOP-UP ഇൻസ്റ്റാൾ
ഒരു ലൈറ്റ്നിങ് വാലറ്റിനെ നോസ്റ്റർ വാലറ്റ് കണക്റ്റുമായി ബന്ധിപ്പിക്കുക, എ. പി. ഐ ചെലവ് കുറയുമ്പോൾ നിംബോട്ട് സ്വയം ഒരു ബാലൻസ് ടോപ്പ് അപ്പ് ചെയ്യുന്നു. ആപ്ലിക്കേഷന്റെ എ. പി. ഐ ഷീറ്റിന് ഒരേ ക്രമീകരണങ്ങളുണ്ട്; ഇവയാണ് ഇതിന് പിന്നിലെ എൻഡ് പോയിന്റുകൾ. അവയ്ക്കെല്ലാം ഒരു ബാലൻസ് ആവശ്യമാണ്. Signed അപേക്ഷ.
ഇത് എങ്ങനെ പ്രവർത്തിക്കുന്നു: ഒരു API അപേക്ഷ നിങ്ങൾ കാണാൻ തിരഞ്ഞെടുത്ത ബാധ്യതയിൽ ക്ലിക്ക് ചെയ്താൽ, ആ ബാധ്യത നിങ്ങളുടെ പകുതിയിൽ താഴെ വീഴുകയാണെങ്കിൽ, Nymbot നിങ്ങളുടെ ഉയർന്ന സമ്പാദ്യത്തിന് ഒരു ഫീസ് ചെയ്യുന്നു, നിങ്ങളുടെ ബാഗിൽ അത് ചെലവഴിക്കാൻ ചോദിക്കുന്നു, ക്രെഡിറ്റ് ചേർക്കുന്നു. ഇത് ഓരോ 5 മിനിറ്റിലും ഓരോ നൈമും ബാധ്യതയിൽ ഒരു തവണയും ഉയർക്കുന്നു, അതിനാൽ അപേക്ഷകൾ തകർന്നുപോകാൻ കഴിയില്ല. ആപ്ലിക്കേഷനുകൾയിൽ ചെലവഴിക്കുന്നതിൽ അത് പ്രവർത്തിപ്പിക്കുന്നില്ല. അവസാനത്തെ ഉയർന്ന സമ്പാദ്യത്തിന്റെ സമയവും വലുപ്പം, അവസാനത്തെ തെറ്റും, നിരീക്ഷണങ്ങളിൽ ഉണ്ട്; ഒരു ഫീസ് തെറ്റു കഴിഞ്ഞാൽ, അതിന്റെ ഫീസ് പരിശോധിക്കുക ടോപ്പ്-അപ്പ് സ്റ്റാറ്റസ് അവരെ വിശ്വസിച്ചു
ഒരു കണക്ഷൻ സ്ട്രിംഗ് നിങ്ങളുടെ വാലറ്റ് കൈവശമുള്ളവർക്ക് പണം നൽകാൻ ആവശ്യപ്പെടുന്നു. നിംബോട്ട് അത് എൻക്രിപ്റ്റ് ചെയ്ത് സൂക്ഷിക്കുന്നു, എല്ലായ്പ്പോഴും സ്വന്തം ടോപ്പ്-അപ്പ് ഇൻവോയ്സുകൾ അടയ്ക്കാൻ മാത്രമേ ഇത് ഉപയോഗിക്കുന്നുള്ളൂ, എന്നാൽ ഇതിനായി നിങ്ങളുടെ വാലറ്റിൽ ഒരു ചെലവ് ബജറ്റ് ഉപയോഗിച്ച് ഒരു കണക്ഷൻ ഉണ്ടാക്കുക, അതിനാൽ നിങ്ങൾ തിരഞ്ഞെടുത്ത ഒരു നമ്പറാണ് അതിന് ഏറ്റവും കൂടുതൽ പണം നൽകാൻ കഴിയുക. വാലറ്റ് പിന്തുണയ്ക്കേണ്ടതുണ്ട് pay_invoice.
ഒരു വാലറ്റ് ബന്ധിപ്പിക്കുന്നു
POST https://nymbot.ai/api/v1/nwc-auto-topup/connect - ഒപ്പുവച്ചു.
| ഫീൽഡ് | തരം | ആവശ്യം | വിശദീകരണം |
|---|---|---|---|
nwc_url | സ്ട്രിംഗ് | അതെ | ലൈംഗിക ബന്ധം, തുടക്കം nostr+walletconnect://. നിംബോട്ട് പേഴ്സിനോട് ചോദിക്കുന്നു get_info അതിനുമുമ്പ് അവയെ സംരക്ഷിക്കുകയും അതിനെ സംരക്ഷിക്കുകയും ചെയ്യുന്നു. |
threshold_sats | പൂർണ്ണസംഖ്യ | അതെ | ബാലൻസ് ഇത്രയും സാറ്റുകൾക്ക് താഴെയാകുമ്പോൾ ടോപ്പ് അപ്പ് ചെയ്യുക. കുറഞ്ഞത് 1,000. |
topup_sats | പൂർണ്ണസംഖ്യ | അതെ | ഓരോ തവണയും എത്ര പൈസ കൊടുക്കണം.1,000 മുതൽ 1,000,000 മുതൽ. |
tier | സ്ട്രിംഗ് | ഇല്ല. | pro (സ്ഥിരസ്ഥിതി) അല്ലെങ്കിൽ standard: കാണാനും ടോപ്പ് അപ്പ് ചെയ്യാനുമുള്ള ബാലൻസ്. |
പ്രതികരണം
{
"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(അല്ലെങ്കിൽ അതിനു പുറത്തുള്ള ഒരു വസ്തുത. |
501 | ഈ സെർവറിലെ ഓട്ടോമാറ്റിക് ടോപ്പുകൾ ഇൻസ്റ്റാൾ ചെയ്യുന്നില്ല (nwc_unavailable). മറ്റ് രണ്ട് എൻഡ് പോയിന്റുകൾക്കും ഇത് ബാധകമാണ്. |
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 - ഒപ്പുവച്ചു.
സംഭരിച്ച കണക്ഷൻ സ്ട്രിംഗ് ഇല്ലാതാക്കുന്നു. കൂടുതൽ ടോപ്പ്-അപ്പുകൾ ഇല്ല. ഉറപ്പാക്കാൻ, നിങ്ങളുടെ വാലറ്റിലെ കണക്ഷൻ പിൻവലിക്കാനും കഴിയും.
പ്രതികരണം
{ "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());
താക്കോൽ ഇല്ലാതെ ഓരോ അഭ്യർത്ഥനയ്ക്കും പണം നൽകുന്നു
താക്കോൽ, അക്കൌണ്ട്, ബാലൻസ് എന്നിവ ഇല്ലാതെ ലൈറ്റ്നിങ്ങിലൂടെ ഒരു സമയത്ത് ഒരു അഭ്യർത്ഥനയ്ക്ക് നിശ്ചിത വില എൻഡ് പോയിന്റുകൾ നൽകാംഃ POST /images/generations, POST /images/edits,
POST /videos, POST /audio/speech, POST /audio/transcriptions,
POST /audio/translations ഒപ്പം POST /embeddingsഒരു താക്കോൽ ഉൾപ്പെടെ ഒരു അപേക്ഷ സാധാരണ പോലെ ബാധകതയിൽ ചെലവഴിക്കപ്പെടുന്നു; ഒരു താക്കോൽ അയച്ചില്ലെങ്കിൽ മാത്രമേ പണം ഫ്ലോഡ് ആരംഭിക്കുകയുള്ളൂ.
ഒരേ ആശയത്തിന്റെ രണ്ട് പതിപ്പുകൾ നിംബോട്ട് സംസാരിക്കുന്നു, ഒരു ബാക്കെൻഡിൽ നിന്ന്ഃ ലൈറ്റ്നിങ് ലാബ്സ് '
L402 (അവന്റെ പഴയ പേരിലൂടെ വിളിച്ചാല് , LSATIETF ഡിസൈൻ
പണമടയ്ക്കൽ HTTP authentication എന്ന താളിൽ നിന്നും തിരിച്ചുവിട്ടതു പ്രകാരം lightning രീതിയും
charge നിങ്ങളുടെ ഉപഭോക്താക്കൾക്ക് അറിയാവുന്നതെല്ലാം ഉപയോഗിക്കുക.
താക്കോൽ ഇല്ലാതെ പണമടയ്ക്കുന്നത് അപ്പോൾ മാത്രമേ ഓൺ ആകൂ. API_L402_SECRET ആക്സസ് (64 പേജുകൾ) അല്ലെങ്കിൽ base64 (44) എന്ന നിലയിൽ കുറഞ്ഞത് 32 ബൈറ്റുകൾ ഉണ്ട്. openssl rand -hex 32ചെറുതോ ഊഹിക്കാവുന്നതോ ആയ ഒരു മൂല്യം സവിശേഷത ഓഫാക്കുകയും എന്തുകൊണ്ടെന്ന് രേഖപ്പെടുത്തുകയും ചെയ്യുന്നു. അത് തിരിക്കാൻ, പഴയ മൂല്യം നീക്കുക API_L402_SECRET_PREVIOUS ഒരു ദിവസം: അഡ്മിൻഡേഷനുകൾ, സ്റ്റേഷൻ URLs, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ, അഡ്മിൻഡേഷനുകൾ എന്നിവ തുടരുകയാണ്.
Challenges
അപേക്ഷ അയയ്ക്കുക No Authorization header. if it is valid, nothing runs, and you get 402 Payment Required ആ അഭ്യർത്ഥനയ്ക്ക് എത്ര ചെലവാകുമെന്നതിനുള്ള ഒരു ഇൻവോയ്സിനൊപ്പംഃ ഒരു കീ നൽകുന്ന അതേ വില, 10 സാറ്റ്സ് സ്റ്റാൻഡേർഡ് ക്രെഡിറ്റ് അല്ലെങ്കിൽ 100 സാറ്റ്സ് പ്രോ ക്രെഡിറ്റ് ആയി പരിവർത്തനം ചെയ്ത് ഒരു മുഴുവൻ സാറ്റ് ആയി (കുറഞ്ഞത് 1 സാറ്റ്, കുറഞ്ഞത് 0.05 ക്രെഡിറ്റ് മിനിമം). പ്രതികരണം മൂന്ന് വഹിക്കുന്നു WWW-Authenticate ഒരേ ഇൻവോയ്സിനുള്ള വെല്ലുവിളികൾഃ
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 }
}
പ്രതിഫലം request പാരാമീറ്റർ ബേസ്64യുആർഎൽ ജെഎസ്ഒഎൻ ആണ്ഃ
{"amount":"237","currency":"sat","methodDetails":{"invoice":"lnbc...","network":"mainnet","paymentHash":"..."}}.
ഒടുവിൽ ഒരു പ്രശ്നം, ഒടുവിൽ ഒരു പ്രശ്നം Content-Type (അവന്റെ മെഡിക്കൽ തരം, പല ഭാഗങ്ങൾക്ക്, അതിന്റെ പരിമിതി) നിങ്ങളുടെ അയച്ച കൃത്യമായ ശരീര ബൈറ്റുകളുടെ SHA-256 ലേക്ക്, 15 മിനിറ്റുകൾ നീണ്ടുനിൽക്കുന്നു. ഒരേതരം വീണ്ടും ചോദ്യം: അതേ
Content-Type അതിനുശേഷമാണ് ഇലക്ട്രോണിക് സ്ട്രേലിയം (/images/edits, /audio/transcriptions, /audio/translations) ഒരേ അതിർത്തിയുള്ള ഒരേ മൾട്ടി പാർട്ട് ബോഡി. മിക്ക HTTP ലൈബ്രറികളും ഓരോ തവണയും ഒരു ഫോം എൻകോഡ് ചെയ്യുമ്പോൾ ഒരു പുതിയ അതിർത്തി തിരഞ്ഞെടുക്കുന്നു, അതിനാൽ അത് ഒരിക്കൽ എൻകോഡ് ചെയ്യുകയും ആ ബൈറ്റുകൾ രണ്ടുതവണ അയയ്ക്കുകയും ചെയ്യുന്നു.
ഓരോ അഡ്രസ് ഒരു മിനിറ്റിനുള്ളിൽ 30 പ്രഭാവങ്ങൾ ചോദിക്കാൻ കഴിയും (ഒരു IPv6 അഡ്രസ് അതിന്റെ മുഴുവൻ /64 ആകുന്നു). അഡ്രസ് അറിയപ്പെടാത്ത പ്രഭാവങ്ങൾ മിനിറ്റിനുള്ളിൽ കൂടുതൽ ശക്തമായ 10 പങ്കിടുന്നു, എല്ലാ അഡ്രസ്സുകളിലും Nymbot പ്രഭാവങ്ങൾക്ക് ഒരു മൊത്തം കപ്പൽ ഉണ്ട്; ഒരു പ്രഭാവം ചെയ്യാൻ മുമ്പ് നിഷേധിക്കപ്പെട്ട പ്രഭാവം (ഉദാഹരണത്തിന്, യഥാർത്ഥ JSON അല്ലെങ്കിൽ ഒരു ശരീരത്തിൽ) അതിനെക്കുറിച്ച് കണക്കാക്കില്ല. 429 കൂടെ Retry-Afterക്രീമിലയര് കേസ് ഒരു പ്രതീക്ഷ തന്നെ ആയിരുന്നു.നിയമ പോരാട്ടം ജയിച്ചാല് ഒരു പക്ഷെ എന്റെ ഭാവി തലമുറയ്ക്ക് നേട്ടം ആകാമായിരുന്ന ഒരു പ്രതീക്ഷ.നിയമ പോരാട്ടം ജയിച്ചാല് ഒരു പക്ഷെ എന്റെ ഭാവി തലമുറയ്ക്ക് നേട്ടം ആകാമായിരുന്ന ഒരു പ്രതീക്ഷ.നിയമ പോരാട്ടം ജയിച്ചാല് ഒരു പക്ഷെ എന്റെ ഭാവി തലമുറയ്ക്ക് നേട്ടം ആകാമായിരുന്ന ഒരു പ്രതീക്ഷ. Content-Type അല്ല application/json (അല്ലെങ്കിൽ
multipart/form-data അപ്ലോഡ് ചെയ്യുന്നതിന്) നിരസിക്കപ്പെടുന്നു 415 ഒരിക്കലും ഒരു ഇൻവോയ്സ് ലഭിക്കുന്നില്ല.
ഉൾച്ചേർക്കലുകളുടെ വില ഇൻപുട്ടിലെ ടോക്കണുകളുടെ ഒരു എസ്റ്റിമേറ്റിൽ നിന്നാണ്, ഒരു 1.5× മാർജിൻ ഉപയോഗിച്ച്, കാരണം യഥാർത്ഥ എണ്ണം പിന്നീട് മാത്രമേ അറിയൂ. യഥാർത്ഥത്തിൽ ഉപയോഗിച്ച ടോക്കണുകൾക്ക് നിങ്ങൾ പണം നൽകുന്നു, കൂടാതെ പേയ്മെന്റിന്റെ ഉപയോഗിക്കാത്ത ഭാഗം തിരിച്ചുവരും. ടോക്ക് തിരികെ.
പ്രതിഫലം അയയ്ക്കുക
ഏതെങ്കിലും വെളിച്ചം പോക്കറ്റ് ഉപയോഗിച്ച് ഫീച്ചർ പണം. പോക്കറ്റ് നിങ്ങൾക്ക് preimage, 64 hex characters നൽകുന്നു.
| പദ്ധതി | ഹെഡർ |
|---|---|
| L402 | Authorization: L402 <macaroon>:<preimage> (LSAT അതും പ്രവർത്തിക്കുന്നു) |
| പണമടയ്ക്കൽ | Authorization: Payment <base64url JSON>JSON എവിടെയാണ് {"challenge": {every parameter of the challenge, as sent}, "payload": {"preimage": "<hex>"}} |
ഒരു പ്രതിവാരാസൂത്രണ രേഖ (Statement of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the Assembly of the nymbot
വസ്തുവിന് ബാലൻസ് ഫീൽഡുകൾ ഇല്ലഃ {"payment": "l402", "tier": "pro", "paid_sats": 237,
"charged_sats": 237}, അല്ലാതെ ഇല്ല X-Nymbot-Balance-Sats പ്രതിവാരാസൂത്രണ രേഖ ( Payment-Receipt header (base64url JSON with the challenge id, payment hash as എന്ന താളിൽ നിന്നും തിരിച്ചുവിട്ടതു പ്രകാരം) reference, status ഒപ്പം
timestampPayment requests are not bound to any nym, so they do not appear in the query history.
| സ്റ്റാറ്റസ് | എപ്പോൾ |
|---|---|
402 payment_already_used | പ്രതിവാരാസൂത്രണ രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) ) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) രേഖ (സി) lnget (ഇനിയൊരു പുനരുത്ഥാന മാത്രമാണ്. |
402 payment_mismatch | വേറൊരു ഫീൽഡ് ഫീൽഡ് എടുത്തു, Content-Type അല്ലെങ്കിൽ ശരീരം, അല്ലെങ്കിൽ ഈ അപേക്ഷ ഇപ്പോൾ ചെലവഴിക്കുന്നതിനേക്കാൾ കുറവ് ചെലവഴിക്കുക. ഈ അപേക്ഷക്ക് പുതിയ ഒരു പ്രയാസവും അതിലേക്കു വരുന്നു; നിങ്ങൾ ചെലവഴിച്ചിട്ടുള്ളത് വളരെ ചെറുതാണെങ്കിൽ, നിങ്ങൾ ചെലവഴിച്ചത് ഒരു പ്രതിഫലമായി തിരികെ വരും. ടോക്ക് തിരികെ (refund_token ഒപ്പം refund_sats ശരീരത്തില് ) |
402 payment_expired | 15 മിനിറ്റോളം കഴിഞ്ഞിട്ടുണ്ട്.ഇത് കൊണ്ട് പുതിയൊരു പരിഹാരം വരും. നിങ്ങൾ പണം നൽകിയിട്ടുണ്ടെങ്കിൽ, നിങ്ങൾ പണം നൽകിയിട്ടുള്ളത് ഒരു പ്രതിഫലമായി തിരികെ വരും. ടോക്ക് തിരികെ (refund_token ഒപ്പം refund_sats ശരീരത്തിൽ), ഒരിക്കൽ; ക്രെഡൻഷ്യൽ പിന്നീട് ഉപയോഗിക്കുന്നു. |
401 invalid_preimage | ഇൻവോയിസിന്റെ പേയ്മെന്റ് ഹാഷിൽ പ്രീമേജ് ഹാഷ് ചെയ്യുന്നില്ല. പേയ്മെന്റ് ഉപയോഗിച്ചിട്ടില്ല. |
401 invalid_payment_credential | ക്രെഡൻഷ്യൽ തെറ്റായതാണ്, നിംബോട്ട് നൽകിയതിന് ശേഷം മാറ്റിയിട്ടുണ്ട്, അല്ലെങ്കിൽ ഒരു പേയ്മെന്റ് ഹാഷിന് നിംബോട്ട് ഒരിക്കലും ഒരു ഇൻവോയ്സ് നൽകിയിട്ടില്ല. നിംബോട്ടിന് അറിയാത്ത ഒരു മുന്നറിയിപ്പ് ഉള്ള ഒരു മാകറൂൺ അല്ലെങ്കിൽ പരസ്പരവിരുദ്ധമായ മുന്നറിയിപ്പുകളോടെ നിരസിക്കപ്പെടുന്നു. |
429 rate_limit_exceeded | ഒരു മിനിറ്റിനുള്ളിൽ ഈ അഡ്രസ് നിന്നുള്ള 30 ൽ കൂടുതൽ അഡ്രസ് അല്ലെങ്കിൽ ഒരു മിനിറ്റിനുള്ളിൽ 60 ൽ കൂടുതൽ തവണ ഒരു തിരികെ ടോക്ക് അയച്ചു. 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"));
ഉപഭോക്താക്കൾ നിർമ്മിച്ചത് mppx ഒരു മിന്നൽ രീതി ഉപയോഗിച്ച് പേയ്മെന്റ് ചലഞ്ച് സ്വയം കൈകാര്യം ചെയ്യുക; അവസാന പോയിന്റിൽ അവരെ ചൂണ്ടിക്കാണിച്ച് പണം നൽകാൻ അനുവദിക്കുക.
വീഡിയോ
ഒരു പ്രതിഫലം POST /videos ഉത്തരങ്ങൾ 202 ഒരു കീ പോലെ, പ്ലസ് എ
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..."
}
}
Keep the refund_token ഈ ചോദ്യത്തിന് റെ ഉത്തരം: ഇത് ഇവിടെ മാത്രമേ കാണപ്പെടുകയുള്ളൂ.ഇത് ശൂന്യമാണ്; വീഡിയോ റേഡിയോ ചെയ്യുമ്പോൾ (GET /api/v1/l402/refunds ഉത്തരങ്ങൾ "status": "pending"); ഡെലിവറേഷൻ ഫലപ്രദമാകുന്നില്ലെങ്കിൽ, ഫലപ്രദമാകുന്നതിനാൽ ഫലപ്രദമാകും.
refund_sats പണം തിരികെ നല് കിയ ജോലിക്ക്, എന്നാൽ ടോക്കൺ ഒരിക്കലും, അതിനാൽ നില URL പങ്കിടുന്നത് പണം തിരികെ പങ്കിടുന്നില്ല.
പ്രതിഫലം
ഒരു പണം ആവശ്യം പരാജയപ്പെട്ടാൽ, വിതരണക്കാരൻ ശ്രമം Nymbot ലേക്ക് ചെലവഴിച്ചിട്ടുണ്ടെങ്കിൽ, ചെലവുകൾ നിലനിൽക്കുന്നു, തെറ്റുകൾ അങ്ങനെ പറയുന്നു, 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
അപ്പോൾ മുഴുവൻ പണമടവും തിരികെ വരും. ഉൾച്ചേർക്കലുകൾ എസ്റ്റിമേറ്റ് തടഞ്ഞുവെച്ചത് തിരികെ നൽകുന്നു. പരാജയപ്പെട്ട വീഡിയോ ടോക്കണിലേക്ക് പണം തിരികെ നൽകുന്നു.
റീഫണ്ട് ടോക്കൺ ഒരു ക്രമരഹിതമായ 256-ബിറ്റ് കോഡാണ്. നിംബോട്ട് അതിന്റെ ഹാഷ് മാത്രം സംഭരിക്കുന്നു, അത് 30 ദിവസത്തിന് ശേഷം കാലഹരണപ്പെടും. ഇത് ഒരു സാറ്റ് ബാലൻസ് കൈവശം വയ്ക്കുന്നു, നിങ്ങൾക്ക് കഴിയുംഃ
- അതിലൂടെ പണം അയയ്ക്കുക.
Authorization: Bearer REFUND-…മുകളിലുള്ള ഏതെങ്കിലും എൻഡ് പോയിന്റുകളിൽ (ഒരു ഓപ്പൺഎഐ എസ്ഡികെ അതിനെ അതിന്റെ എപിഐ കീ ആയി എടുക്കുന്നു). ടോക്കണിൽ നിന്ന് വരുന്ന വില അതിൽ അവശേഷിക്കുന്നു (refund_token_satsഇതിൽnymbotഒബ്ജക്റ്റ്). അഭ്യർത്ഥനയുടെ ഉത്തരങ്ങളേക്കാൾ കുറഞ്ഞ മൂല്യമുള്ള ഒരു ടോക്കൺ402refund_insufficientഅപ്രതീക്ഷിതമായ ഒരു പരാജയവും ഒരേ ടോക്കന്റിൽ നിക്ഷേപം തിരിച്ചുവരുത്തുന്നു. - അത് പരിശോധിക്കുക
GET /api/v1/l402/refundsഅതേ തലക്കെട്ട് തിരികെ നൽകുന്നു{"sats": 237, "status": "open", "expires_at": "..."}. - ഒരു ടോക്കൺ മിനിറ്റിൽ പരമാവധി 60 തവണ ഉപയോഗിക്കാം.
- ഇത് ഒരു NIM ൽ മാറുക. അതിൽ ഒട്ടിക്കുക സമ്മാനം വാങ്ങുക Nymbot App ൽ, അല്ലെങ്കിൽ Call
POST /api/v1/l402/refunds/redeemA Signed അപേക്ഷ ഒപ്പം{"refund_token": "REFUND-...", "balance": "standard"}(അല്ലെങ്കിൽ"pro"Total credits go to the balance (10 sats each on standard, 100 on Pro); API requests for the token for the token for the token for the token for the token for the token.
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"
പ്രതികരണം
{ "data": { "credited": 23, "tier": "standard", "balance_credits": 123, "remaining_sats": 7 } }