OpenClaw: Gateway, API और सुरक्षित पहला launch

OpenClaw install करने, BetterToken provider जोड़ने, Gateway और model जाँचने तथा न्यूनतम permissions के साथ पहला local launch करने की विधि।

अपने API Key से OpenClaw को सुरक्षित तरीके से जाँचने के लिए BetterToken account और API Key बनाएँ, OpenClaw guide खोलें और provider को SecretRef से configure करें। Gateway को loopback पर foreground में चलाएँ और पहला test अलग workspace व नई session में करें — channels, community skills और dangerous tools के बिना।

त्वरित चरण-दर-चरण योजना

  1. BetterToken में API Key और working endpoint तैयार करें।
  2. Tool की config file या environment variables configure करें।
  3. Test request चलाकर response और token usage जाँचें।

OpenClaw वास्तव में क्या चलाता है

OpenClaw कई layers का बना है; एक layer की error दूसरी की समस्या जैसी लग सकती है।

Layerकामक्या जाँचें
Provider APISelected model को request भेजता हैBase URL, API Key, protocol, Model ID
GatewayLocal control plane और clients का connectionbind, auth, process, RPC status
Agent workspaceAgent की work directory सीमित करता हैpath, accessible files, tool permissions
SessionCurrent conversation context और state रखता हैmodel बदलने पर नई session
ChannelsTelegram, Discord और अन्य external inputsपहले launch में आवश्यक नहीं

इस setup में BetterToken केवल provider API है। वह OpenClaw website, installer, channels, community skills या third-party services की availability की guarantee नहीं देता। API endpoint की access और OpenClaw की downloads/integrations की access अलग-अलग जाँचें।

स्थायी Gateway के बिना OpenClaw install करें

पहली जाँच में official installer को --no-onboard के साथ लें; इससे setup wizard और provider check से पहले permanent service बनना रुकता है।

macOS, Linux या WSL2

curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard

Windows PowerShell

& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard

CLI जाँचें:

openclaw --version

Official installer supported Node.js version जाँचता और आवश्यकता पर install करता है। Third-party guide का पुराना Node pin न करें; current requirements OpenClaw install page पर हैं।

API Key उजागर किए बिना BetterToken provider configure करें

मुख्य OpenClaw file:

~/.openclaw/openclaw.json

पहले अलग workspace बनाएँ:

mkdir -p ~/openclaw-first-check

पहले run में BetterToken की GPT group से current Model ID लें। निम्न config openai-responses उपयोग करती है; model name से protocol न अनुमानें, openai-completions या अन्य mode को current BetterToken OpenClaw documentation से मिलाएँ।

{ "models": { "mode": "merge", "providers": { "bettertoken": { "baseUrl": "https://www.bettertoken.ai/v1", "apiKey": { "source": "env", "provider": "default", "id": "BETTERTOKEN_API_KEY" }, "api": "openai-responses", "models": [{"id": "YOUR_MODEL_ID", "name": "YOUR_MODEL_ID"}] } } }, "agents": {"defaults": { "workspace": "~/openclaw-first-check", "model": {"primary": "bettertoken/YOUR_MODEL_ID"} }}, "gateway": {"mode": "local", "bind": "loopback"}, "tools": {"profile": "minimal"} }

YOUR_MODEL_ID placeholder है; इसे model catalog या अपने Key के Setup window से मिले full ID से बदलें। Base URL में /responses या /chat/completions न जोड़ें। apiKey OpenClaw SecretRef उपयोग करता है: BETTERTOKEN_API_KEY Gateway process की protected environment में हो, पर key openclaw.json में न लिखी जाए।

Config और पुराने generated files में plaintext credential न बचा हो, जाँचें:

openclaw secrets audit --check

Audit plaintext पाए तो interactive migration करें:

openclaw secrets configure --apply

Key को prompt, log, commit या agent workspace में copy न करें।

Configuration, Gateway और model कैसे जाँचें

1. Launch से पहले JSON जाँचें

openclaw config validate

यह Gateway चलाए बिना active schema validate करता है। Error में बताया field, quotes या braces ठीक करके फिर चलाएँ।

2. Provider और selected model जाँचें

openclaw models list --provider bettertoken openclaw models status

List में bettertoken/YOUR_MODEL_ID होना चाहिए और status उसे resolved default दिखाए। models list read-only है, successful API call का प्रमाण नहीं; अलग short request आवश्यक है।

3. Gateway foreground में चलाएँ

दूसरे terminal में:

openclaw gateway --force

Process खुला रखें। पहले terminal में जाँचें:

openclaw gateway status --require-rpc openclaw status

Local test में Gateway loopback पर listen करे, auth माँगे और working RPC probe लौटाए। पहले launch के लिए bind को lan, tailnet या 0.0.0.0 न करें।

4. नई session खोलें

openclaw tui --session first-check

Files बदले बिना यह minimal prompt भेजें:

Ответь только JSON: {"agent":"openclaw","sum":4}. Не используй tools и не изменяй файлы.

पहला launch तब confirmed है जब TUI valid JSON लौटाए, openclaw models status में bettertoken/YOUR_MODEL_ID हो, Dashboard में expected model/status/token usage वाला request दिखे और workspace में unexpected changes न हों। Test के बाद foreground Gateway को Ctrl+C से रोकें; केवल उसके बाद permanent service का निर्णय लें।

5. परीक्षण के बाद ही service install करें

openclaw gateway install openclaw gateway restart openclaw gateway status --require-rpc

Restart के लिए openclaw gateway restart लें; official runbook stop और start की chain से बदलने की सलाह नहीं देता।

पहला launch न्यूनतम permissions में क्यों होना चाहिए

Gateway default रूप से एक trusted boundary के लिए है। Tool-enabled agent files पढ़/बदल सकता, commands चला सकता और network access कर सकता है। Prompt injection केवल public chat से नहीं: malicious instruction page, document, attachment या log से भी आ सकती है।

पहले test में tools.profile को minimal, Gateway को loopback और channels को unconfigured रखें। Source और permissions जाँचे बिना community skills या plugins न install करें। Access बढ़ाने से पहले चलाएँ:

openclaw security audit --deep

बाद में channel जोड़ें तो pairing या allowlist और अलग session scope से शुरू करें। Mutually untrusted users के लिए shared Gateway supported isolation boundary नहीं है।

पुरानी session पूर्व model क्यों उपयोग कर सकती है

agents.defaults.model.primary बदलने के बाद खुले conversation के लिए केवल JSON edit पर्याप्त नहीं। Config validate करें, Gateway restart करें और new session key बनाएँ:

openclaw config validate openclaw gateway restart openclaw tui --session after-model-change

यदि नई session फिर भी दूसरा provider ले, agents.defaults.model.primary, models.providers.bettertoken.models और openclaw models status मिलाएँ।

सामान्य errors

config validate fail होता है

JSON structure और supported api values जाँचें। जानबूझकर invalid config के साथ Gateway न चलाएँ; successful validation तक direct editor writes untrusted हैं।

Gateway शुरू नहीं होता या RPC probe fail है

पहले openclaw gateway status चलाएँ। EADDRINUSE port conflict या दूसरा Gateway process है; auth error Gateway credential और client mismatch है। Error हटाने के लिए auth बंद या bind external network पर न खोलें।

401, 404 या protocol error

401 में देखें SecretRef Gateway environment में resolve हो रहा है। GPT group के लिए openai-responses और https://www.bettertoken.ai/v1 लें। दूसरे provider में Docs का exact protocol लें; endpoint manually न जोड़ें।

Model JSON में है, पर दिखाई नहीं देती

models.providers.bettertoken.models के ID को agents.defaults.model.primary से मिलाएँ, फिर openclaw config validate, openclaw models list --provider bettertoken और openclaw models status चलाएँ।

OpenClaw या Hermes Agent

यह guide केवल installation question को संबोधित करती है। Architecture चुनना बाकी हो तो Hermes Agent या OpenClaw: कैसे चुनें अलग article में local agent runtime, Gateway approach और operational complexity की तुलना करता है।

FAQ

क्या Telegram या Discord तुरंत जोड़ना जरूरी है?

नहीं। पहले local provider, Gateway, model और new session confirm करें। Channels access surface बढ़ाते हैं और pairing/allowlist की अलग policy चाहिए।

API Key सीधे openclaw.json में लिख सकते हैं?

Technically plaintext supported हो सकता है, पर सुरक्षित launch के लिए SecretRef लें। Config में खुली key उसे पढ़ सकने वाले किसी भी process या agent tool को मिल सकती है।

Successful model request के बिना Gateway कैसे जाँचें?

openclaw gateway status --require-rpc RPC जाँचता है और openclaw models status model resolution तथा credential। Full end-to-end test केवल new session में short response और BetterToken Dashboard request दिखने पर पूरा है।

भुगतान और balance top-up

Balance top-up और API payment account dashboard में होते हैं। Available methods तथा current rates के लिए BetterToken pricing page देखें; dynamic rates को documentation में fixed fact न मानें।

लागत का उदाहरण और rates

Input, output और लागू cached tokens को अलग गिनें, उस समय की rates pricing page से लें और example को estimate रखें, current model price का दावा नहीं।

अपना LLM वर्कफ़्लो बेहतर बनाना चाहते हैं?

एक API से मॉडल जोड़ें, कुंजियाँ प्रबंधित करें और AI खर्च नियंत्रित करें।