💡 API란 무엇인가요? — 그리고 왜 필요할까요?
당신의 AI 에이전트를 행동하기 전에 생각해야 하는 직원들로 생각해보세요.
에이전트가 상황을 분석하거나, 보고서를 작성하거나, 의사결정을 할 때마다 그 생각을 처리하기 위해 AI 모델을 호출해야 합니다. API는 그 호출을 만드는 채널이자 이를 구동하는 연료입니다.
Chat AI vs API — 두 가지 다른 것:
| Chat AI (Claude / Gemini / ChatGPT) | API | |
|---|---|---|
| 무엇인가 | 당신의 개인 컨시어지 | 당신의 에이전트의 사고 엔진 |
| 누가 사용하는가 | 당신이 직접 | 당신의 에이전트가 자동으로 |
| 비용 모델 | 구독 (정액) | 사용량에 따른 결제 (input + output token) |
| 추천 | 유료 플랜 — 더 나은 추론 | $5 크레딧부터 시작 |
둘 다 운영하는 이유는? (하이브리드 설정)
API 청구는 input + output token을 기반으로 작동합니다 — 에이전트에게 보내는 모든 단어와 에이전트가 응답하는 모든 단어마다 소액의 비용이 발생합니다.
이는 당신이 에이전트에 지시하는 방식이 중요하다는 의미입니다.
Chat AI (Claude, Gemini, ChatGPT — 더 나은 추론을 위해 유료 플랜 권장)를 다음과 같이 사용하세요:
- 에이전트에 보내기 전에 명확하고 간결한 지시사항 작성
- 에이전트에 전달하기 전에 긴 문서 요약
- 에이전트가 당신의 의도를 파악하느라 token을 낭비하지 않도록 미리 작업 구조화
잘 구조화된 200-token 지시사항은 모호한 2,000-token 왕복의 일부만 비용이 듭니다. 당신의 Chat AI는 전략가입니다. 당신의 에이전트는 실행자입니다. 이 조합은 API 비용을 낮게 유지하면서 출력 품질을 높게 유지합니다.
시작 전에 — API 비용 안내
BALIA OS의 AI 에이전트를 실행하려면 AI API 키가 필요합니다. 이는 $48 가이드 비용과는 별도입니다.
필요한 것:
- Anthropic 계정 및 최소 $5의 선불 크레딧
- 이 가이드의 모든 에이전트는 Claude Sonnet 4.6을 사용합니다
$5로 충분한 이유: Claude Sonnet 4.6은 입력 100만 토큰당 $3, 출력 100만 토큰당 $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 — BALIA OS를 구동하는 AI 에이전트 프레임워크
- Anthropic API 키 — 에이전트가 사고하는 데 사용하는 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.