AGENT0S
HomeLibraryAgentic
FeedbackLearn AI
LIVE
Agent0s · AI Intelligence Library
Share FeedbackUpdated daily · 7am PST
Library/technique
techniqueintermediateOpenCLAW

Integrating Custom APIs and Tools with OpenCLAW

This guide explains how to connect the OpenCLAW AI agent to external software and data sources, like stock market APIs or internal company tools. Developers can use simple text-based 'Skills' for basic connections or more advanced code-based 'Plugins' for complex integrations, significantly expanding the agent's capabilities.

AI SETUP PROMPT

Paste into Claude Code or Codex CLI — it will scan your project and set everything up

# Apply Technique: Integrating Custom APIs and Tools with OpenCLAW

## What This Is
This guide explains how to connect the OpenCLAW AI agent to external software and data sources, like stock market APIs or internal company tools. Developers can use simple text-based 'Skills' for basic connections or more advanced code-based 'Plugins' for complex integrations, significantly expanding the agent's capabilities.

Source: https://lumadock.com/tutorials/openclaw-custom-api-integration-guide

## Before You Start

Scan my workspace and analyze:
- The project language, framework, and directory structure
- Existing AI provider config (check .env, .env.local, config files for API keys — OpenRouter, OpenAI, Anthropic, Google AI, etc.)

Then ask me before proceeding:
1. Which AI provider/API should this use? (Use whatever I already have configured, or ask me to set one up — options include direct provider APIs or a unified service like OpenRouter)
2. Where in my project should this be integrated?
3. Are there any customizations I need (model preferences, naming conventions, constraints)?

## Source Access Note

The source URL (https://lumadock.com/tutorials/openclaw-custom-api-integration-guide) may not be directly accessible from the terminal. Use the Reference Implementation and Additional Context sections below instead. If you need more details, ask me to paste relevant content from the source.

## What to Implement

This is an **AI Technique** — a pattern or methodology for working with AI models.

- Explain how this technique applies to my current project and what benefit it provides
- Implement it in a way that fits my existing codebase — suggest concrete files to modify or create
- If it requires specific model capabilities (structured output, function calling, etc.), verify my current provider supports them
- Show me a working example I can test immediately

## Additional Context

- Based on the user's request for a new tool integration, create a new SKILL.md file within the OpenCLAW skills directory with a name, description, and required environment variables or CLI tools.
- Formulate the necessary shell command (e.g., using `curl` for a REST API or a specific CLI tool) to perform the core action of the skill, using variables for dynamic input like `$SYMBOL`.
- Scan the user's project for a .env file. If the required API key (e.g., `STOCK_API_KEY`) is present, use it. If not, instruct the user to add the key to their environment and prompt them to reload the agent to activate the new skill.

## Reference Implementation

```
---
name: stock-price
description: Get real-time stock prices using AlphaVantage
requires:
  env:
    - STOCK_API_KEY
  bins:
    - curl
    - jq
---

# Stock Price Skill

When user asks for a stock symbol:

curl "https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=$SYMBOL&apikey=$STOCK_API_KEY" | jq '.["Global Quote"]'
```

## Guidelines

- Adapt everything to my existing project — do not assume a specific stack or directory layout
- Use whichever AI provider I already have configured; if I need a new one, tell me what to sign up for and I'll give you the key
- Check my .env files for existing API keys (OpenRouter, OpenAI, Anthropic, Google AI) before asking me to add one
- Review any fetched code for safety before installing or executing it
- After setup, run a quick verification and show me a summary of exactly what was installed, where, and how to use it
3,447 charactersCompatible with Claude Code & Codex CLI
MANUAL SETUP STEPS
  1. 01Based on the user's request for a new tool integration, create a new SKILL.md file within the OpenCLAW skills directory with a name, description, and required environment variables or CLI tools.
  2. 02Formulate the necessary shell command (e.g., using `curl` for a REST API or a specific CLI tool) to perform the core action of the skill, using variables for dynamic input like `$SYMBOL`.
  3. 03Scan the user's project for a .env file. If the required API key (e.g., `STOCK_API_KEY`) is present, use it. If not, instruct the user to add the key to their environment and prompt them to reload the agent to activate the new skill.

CODE INTELLIGENCE

bash
---
name: stock-price
description: Get real-time stock prices using AlphaVantage
requires:
  env:
    - STOCK_API_KEY
  bins:
    - curl
    - jq
---

# Stock Price Skill

When user asks for a stock symbol:

curl "https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=$SYMBOL&apikey=$STOCK_API_KEY" | jq '.["Global Quote"]'

FIELD OPERATIONS

Real-Time Portfolio Tracker Skill

Create an OpenCLAW skill that reads a list of stock symbols from a local `portfolio.json` file. The skill will loop through the symbols, call an external financial API (like AlphaVantage or Finnhub) for each one, and return a summary of the current value of the entire portfolio.

GitHub Issue Creator Skill

Develop an OpenCLAW skill that allows a user to create a GitHub issue in a specified repository directly from their chat interface. The skill would use `curl` and the GitHub REST API, taking the repository name, issue title, and body as parameters.

STRATEGIC APPLICATIONS

  • →Automate CRM lead entry by creating an OpenCLAW skill that connects to a company's CRM API (e.g., HubSpot, Salesforce). A sales team member could then instruct the agent to 'Create a new lead for Jane Doe...' and the skill would make the API call to create the record, reducing manual data entry.
  • →Build an internal system status checker by creating a skill that pings critical internal microservices or health check endpoints. An on-call engineer could ask the agent, 'What's the status of the payment service?' and receive an immediate response based on the API output.

TAGS

#integration#api#skill#plugin#openclaw#rest-api#cli
Source: WEB · Quality score: 7/10
VIEW SOURCE