Skip to content

💡 एक API क्या है? — और आपको इसकी जरूरत क्यों है?

अपने AI agents को ऐसे कर्मचारियों के रूप में सोचें जिन्हें कार्य करने से पहले सोचना पड़ता है।

हर बार जब कोई agent किसी स्थिति का विश्लेषण करता है, एक रिपोर्ट लिखता है, या कोई निर्णय लेता है, तो उसे उस सोच-विचार के लिए एक AI model को कॉल करना पड़ता है। API वह चैनल है जो उस कॉल को संभव बनाता है — और उसे शक्ति प्रदान करता है।

Chat AI बनाम API — दो अलग-अलग चीजें:

Chat AI (Claude / Gemini / ChatGPT)API
यह क्या हैआपका व्यक्तिगत सहायकआपके agents का सोच-विचार इंजन
इसे कौन इस्तेमाल करता हैआप, सीधे तौर परआपके agents, स्वचालित रूप से
लागत मॉडलSubscription (निश्चित दर)Pay per use (input + output tokens)
अनुशंसितPaid plan — बेहतर reasoning$5 credit से शुरुआत करें

दोनों को क्यों चलाएं? (हाइब्रिड सेटअप)

API बिलिंग input + output tokens पर काम करती है — agent को भेजे गए हर शब्द और उसके द्वारा दिए गए हर जवाब के शब्द की एक छोटी राशि खर्च होती है।

इसका मतलब है कि आप अपने agents को कैसे निर्देश देते हैं, यह महत्वपूर्ण है।

अपने Chat AI (Claude, Gemini, ChatGPT — बेहतर reasoning के लिए paid plan अनुशंसित) का उपयोग करें:

  • agents को भेजने से पहले स्पष्ट, संक्षिप्त निर्देश तैयार करें
  • लंबे दस्तावेजों को agents को पास करने से पहले सारांशित करें
  • कार्यों को पूर्व-संरचित करें ताकि agents यह समझने में tokens बर्बाद न करें कि आप क्या चाहते हैं

एक अच्छी तरह से संरचित 200-token निर्देश एक अस्पष्ट 2,000-token आगे-पीछे की तुलना में बहुत कम खर्च आता है। आपका Chat AI रणनीतिकार है। आपके agents कार्यकर्ता हैं। यह संयोजन API लागत को कम रखता है जबकि आउटपुट की गुणवत्ता को उच्च रखता है।

शुरू करने से पहले — API लागत की पारदर्शिता

BALIA OS के एजेंट चलाने के लिए AI API कुंजी की आवश्यकता है। यह $48 गाइड लागत से अलग है।

आपको क्या चाहिए:

  • Anthropic अकाउंट और कम से कम $5 के प्रीपेड क्रेडिट
  • इस गाइड के सभी एजेंट Claude Sonnet 4.6 का उपयोग करते हैं

$5 क्यों काफी है: Claude Sonnet 4.6 की लागत प्रति मिलियन इनपुट टोकन $3 और आउटपुट टोकन $15 है। $5 से आप दर्जनों सेशन सीख और प्रयोग कर सकते हैं।

Anthropic API में कोई मुफ्त टियर नहीं है। क्रेडिट कार्ड आवश्यक है। क्रेडिट जोड़ें: console.anthropic.com → Billing → Add credits (न्यूनतम $5)

BALIA OS चलाने के लिए यही एकमात्र बाहरी लागत है। तुलना के लिए: एक मानव सहायक को नौकरी पर रखने में $2,000–$5,000 प्रति माह लगते हैं। आपकी AI टीम शुरू करने के लिए $5 के API क्रेडिट पर चलती है। एक ही काम। लागत का एक अंश।


आप क्या इंस्टॉल करने वाले हैं

इस सेक्शन के अंत तक आपके पास ये चार चीज़ें तैयार होंगी:

  • VS Code — एजेंट फ़ाइलें एडिट करने और कमांड चलाने के लिए आपका workspace
  • Node.js — OpenClaw चलाने के लिए ज़रूरी
  • OpenClaw — वह AI एजेंट फ्रेमवर्क जो BALIA OS को शक्ति देता है
  • Anthropic API key — वह AI इंजन जिसका उपयोग आपके एजेंट सोचने के लिए करते हैं

यह सेक्शन कैसे काम करता है: नीचे दिया गया प्रॉम्प्ट कॉपी करें और Claude, ChatGPT, या Gemini में पेस्ट करें। AI आपको पूरे इंस्टॉलेशन प्रक्रिया में मार्गदर्शन देगा — आपका ऑपरेटिंग सिस्टम पूछेगा, हर कदम पर साथ चलेगा, और जो भी गलत हो उसे ठीक करने में मदद करेगा। अगर किसी भी बिंदु पर आप अटक जाएं, तो बस AI को समस्या बताएं और वह आपकी मदद करेगा।


इस प्रॉम्प्ट को कॉपी करें और अपने AI में पेस्ट करें

You are helping me install and set up BALIA OS — a multi-agent AI 
operating system built on OpenClaw.

Your job is to guide me through the installation step by step. 
Ask me one question at a time. Wait for my answer before moving on.
If I hit an error, help me fix it before continuing.

Here is everything we need to install and set up, in order:

STEP 1 — Check my operating system
Ask me: "Are you on Windows or Mac?"
Then give me the correct instructions for my OS throughout all steps.

STEP 2 — Install VS Code
Guide me to install VS Code from code.visualstudio.com
- Windows: download and run the installer. Make sure "Add to PATH" is checked.
- Mac: download, unzip, drag to Applications, then run the shell command 
  to add "code" to PATH: Cmd+Shift+P → "Shell Command: Install 'code' command in PATH"
After install, ask me to open a terminal in VS Code and run:
  code --version
Ask me what it shows. If there's an error, help me fix it.

STEP 3 — Create the balia-os folder
Guide me to create the main BALIA OS folder using the VS Code terminal.
- Windows: mkdir C:\Users\%USERNAME%\balia-os
           code C:\Users\%USERNAME%\balia-os
- Mac:     mkdir ~/balia-os
           code ~/balia-os
Tell me: "This is where everything will live. 
Keep this path handy — you'll use it throughout the guide."
Confirm the folder opened in VS Code before moving on.

STEP 4 — Install Node.js
Guide me to install Node.js 22 or higher from nodejs.org (LTS version).
After install, ask me to run: node --version
Ask me what it shows.
- If v22 or higher: great, move on.
- If lower than v22: guide me to upgrade using nvm (Mac/Linux) 
  or nvm-windows (Windows).
- If error: help me troubleshoot.

STEP 5 — Install OpenClaw
Guide me to run in the VS Code terminal:
  npm install -g openclaw
Then verify:
  openclaw --version
Common errors to handle:
- EACCES on Mac: guide through npm global prefix fix
- "openclaw not found": ask me to close and reopen terminal, try again

STEP 6 — Get an Anthropic API key
Explain this first:
"BALIA OS uses Claude (Anthropic) as the default AI engine for your agents.
For now we set up Claude only. Other AI engines can be added later depending 
on what you want to build:
- When building your own cassette (Section 6), you'll choose the best AI 
  for that cassette — for example, Gemini for YouTube since it can analyze 
  video directly, or GPT-4o for sales copy.
- After the BALIA Skill Market opens, you can also install cassettes built 
  by other users, each with their own recommended AI engine.
There is no cassette included by default. You'll build the one that fits 
your business in Section 6."

Then guide me to:
1. Go to console.anthropic.com
2. Sign up or log in
3. Go to API Keys → Create Key
4. Name it "balia-os"
5. Copy the key (starts with sk-ant-)
Tell me: "Save this somewhere safe — you can only see it once."
Ask me to confirm I have the key before moving on.
Do NOT ask me to paste the key into the chat.

STEP 6b — Write the API key to the .env file
Guide me to:
1. Open the .env file in VS Code (it's in the balia-os folder)
2. Find the line: ANTHROPIC_API_KEY=sk-ant-paste-your-key-here
3. Replace "sk-ant-paste-your-key-here" with my actual key
4. Save the file (Ctrl+S on Windows / Cmd+S on Mac)
Confirm: "Your API key is now saved in your .env file.
Never share this file or commit it to GitHub."
Do NOT ask me to paste the key into the chat.

STEP 7 — Run OpenClaw setup
Guide me to run in the VS Code terminal:
  openclaw setup
Tell me what to expect:
- It will ask for my Anthropic API key — paste it there
- It will create ~/.openclaw/ folder structure
- It will start the OpenClaw gateway
After setup, ask me to confirm I see:
  "✓ Gateway running on port 18789"
Tell me to leave this terminal tab open and open a new tab for future commands.

STEP 8 — Create workspace folders for each agent
Tell me: "I'll read your Team Design Document from Section 2 to get 
your agent IDs automatically. Please attach it now."
Read the attached Team Design Document.
Extract all 6 agent names/IDs (convert to lowercase, no spaces).
Show me the list:
"I found these 6 agents: [id1], [id2], [id3], [id4], [id5], [id6]
Is this correct?"
Wait for my confirmation.
Then give me the exact commands to create all 6 workspace folders at once
with the actual IDs already filled in:
- Windows: cd C:\Users\%USERNAME%\.openclaw
           mkdir workspace-[id1] workspace-[id2] workspace-[id3] workspace-[id4] workspace-[id5] workspace-[id6]
- Mac:     cd ~/.openclaw
           mkdir workspace-[id1] workspace-[id2] workspace-[id3] workspace-[id4] workspace-[id5] workspace-[id6]

STEP 9 — Create the .env file
Guide me to create a .env file inside the balia-os folder.
In VS Code: right-click the balia-os folder in the left panel → 
New File → name it .env
Then paste this template:

# BALIA OS
BALIA_TOKEN=paste-your-token-here
AGENT_ID=paste-your-main-agent-id-here
BALIA_OS_PATH=~/balia-os

# Anthropic API
ANTHROPIC_API_KEY=sk-ant-paste-your-key-here

# Agent model
CLAUDE_MODEL=claude-sonnet-4-6

# Discord Webhooks — fill these in during Section 7
# Example: DISCORD_WEBHOOK_MAYA=https://discord.com/api/webhooks/123456789/xxxxxxxxxxxx
DISCORD_WEBHOOK_[AGENT1NAME]=
DISCORD_WEBHOOK_[AGENT2NAME]=
DISCORD_WEBHOOK_[AGENT3NAME]=
DISCORD_WEBHOOK_[AGENT4NAME]=
DISCORD_WEBHOOK_[AGENT5NAME]=
DISCORD_WEBHOOK_SECURITY=

Fill in BALIA_TOKEN:
"Check the email you received after purchase.
The subject line says 'Your BALIA OS Access Token'.
Copy the token (starts with BALIA-) and paste it after BALIA_TOKEN=
This is the only time you need to enter it —
the installer in Section 6 reads it automatically from this file.
Do NOT paste it into this chat."

Fill in AGENT_ID:
"This is the ID of your main agent — the one you'll talk to most.
You chose it in Section 2 (it's in your Team Design Document).
Type it in lowercase with no spaces. Example: maya, alex, ceo
This ID is used by install scripts so it must match exactly."

Fill in BALIA_OS_PATH:
"This is the folder you created in STEP 3.
- Windows: replace ~/balia-os with C:/Users/YourName/balia-os
- Mac: leave it as ~/balia-os
You'll use this path in Section 5 when launching your agents."

Tell me: "Leave these blank for now — you'll get the actual URLs in Section 7.
The URL format looks like: https://discord.com/api/webhooks/numbers/letters
Replace [AGENT1NAME] through [AGENT5NAME] with your agents' names in UPPERCASE.
DISCORD_WEBHOOK_SECURITY is always last — it's for the Security Guardian agent."

Security note — say this:
"If you're uncomfortable putting your token in a file:
You can skip BALIA_TOKEN for now and enter it manually
when prompted during Section 6 installation."

Tell me: "Never share this file. Never commit it to GitHub."

STEP 10 — Final check
Run through this checklist with me one item at a time:
□ code --version → shows a version number
□ node --version → shows v22 or higher
□ openclaw --version → shows a version number
□ Gateway terminal shows "✓ Gateway running"
□ balia-os folder is open in VS Code
□ .env file exists in the balia-os folder
□ BALIA_TOKEN is filled in (or noted to enter manually in Section 6)
□ AGENT_ID is filled in
□ BALIA_OS_PATH is filled in

When all boxes are checked, say:
"Installation complete. You're ready for Section 4 — 
Creating Your Agent Files."

Start now. Ask me the first question.