OpenClaw — 에이전트 프레임워크 통합
OpenClaw는 도구 사용, 메모리 및 계획 기능이 내장된 인기 있는 오픈 소스 AI 에이전트 프레임워크입니다. 이 가이드에서는 Starsg를 OpenClaw용 통합 추론 백엔드로 설정하는 방법을 보여줍니다.
중요시작하기 전에 콘솔에서 만든 API 키를 준비하세요. 아직 없다면 링크를 열어 생성하세요.
1. 설치
pip install openclaw openai
2. 환경 변수 구성
export OPENCLAW_BASE_URL="https://api.starsg.ai/v1" export OPENCLAW_API_KEY="sk-abc...xyz" export OPENCLAW_MODEL="gpt-4o"
3. 에이전트 구축
from openclaw import Agent, tool
@tool
def search_web(query: str) -> str:
"""Search the web"""
return do_search(query)
agent = Agent(
name="researcher",
tools=[search_web],
backend="openai", # Starsg speaks the OpenAI protocol
)
result = agent.run("Research the most exciting open-source LLMs of 2026")
print(result.output)4. 다중 모델 대체
OpenClaw는 우선순위가 지정된 폴백 모델 목록을 지원합니다. Starsg' 통합 게이트웨이는 다음을 간단하게 만듭니다.
agent = Agent(
name="writer",
backend="openai",
fallback_models=[
"gpt-4o",
"claude-opus-4-7",
],
)5. 모니터링 및 청구
모든 상담원 호출이 수신됩니다. 콘솔 → 사용법, API 키, 모델 및 기간별로 분류됩니다. 각 에이전트에 자체 API 키를 발급하여 콘솔에서 직접 에이전트의 비용과 대기 시간을 확인하세요.