🦞
Tutorial

API Integration

API key configuration and model access

Integrate third-party services to make AI capabilities more powerful

This chapter will introduce how to integrate OpenClaw with various third-party API services to expand the boundaries of AI capabilities. It will focus on the configuration methods for 4 practical scenarios: AI image generation, Notion data synchronization, video generation, and speech synthesis.

💡 Chapter Focus: Configuration methods and basic usage of API integration. For detailed practical examples, please refer to Chapter 14 "Exploring Creative Applications".


10.1 AI Image Generation Service Integration

10.1.1 Service Selection

OpenClaw supports various AI image generation services:

ServiceFeaturesCostRecommended Scenarios
Gemini Image GenerationGood Chinese support, excels at whiteboard diagramsLow (0.05-0.4 CNY/image)Tutorial illustrations, whiteboard diagrams
DALL-E 3High quality, diverse stylesMediumCreative design
MidjourneyStrong artistic flairHighArtistic creation
Stable DiffusionOpen source, freeFree (requires self-hosting)Batch generation

Recommended: Gemini Image Generation

  • ✅ Simple integration (Chat API)
  • ✅ Low cost
  • ✅ Good Chinese support
  • ✅ Suitable for tutorial illustrations, whiteboard diagrams

10.1.2 Install bananapro-image-gen Skill

Method 1: Install from GitHub (Recommended)

# Clone the skill repository
git clone https://github.com/xianyu110/awesome-openclaw-tutorial.git

# Copy to OpenClaw's skills directory
cp -r expert-skills-hub/skills/bananapro-image-gen ~/.openclaw/skills/

# Install dependencies
cd ~/.openclaw/skills/bananapro-image-gen
pip3 install -r requirements.txt

Method 2: Use npx command

npx skills add https://github.com/xianyu110/awesome-openclaw-tutorial --skill bananapro-image-gen

Verify Installation:

ls ~/.openclaw/skills/bananapro-image-gen
# You should see: SKILL.md, README.md, scripts/, test.sh and other files

10.1.3 Configure API

Step 1: Obtain API Key

  1. Visit a proxy API service provider (services that support Gemini are recommended)
  2. Register and top up (10-20 CNY recommended for testing)
  3. Obtain API Key

Step 2: Configure OpenClaw

nano ~/.openclaw/openclaw.json

Add configuration:

{
  "api": {
    "gemini": {
      "apiKey": "your-api-key-here",
      "baseUrl": "https://apipro.maynor1024.live",
      "model": "gemini-3-pro-image-preview"
    }
  }
}

Step 3: Test Connection

cd ~/.openclaw/skills/bananapro-image-gen
bash test.sh

If you see the generated image, the configuration is successful!

Cost Reference:

  • Generate 1 1K image: approx. 0.05-0.1 CNY
  • Generate 1 2K image: approx. 0.1-0.2 CNY
  • Generate 1 4K image: approx. 0.2-0.4 CNY

💡 Money-saving Tip: 1K resolution is sufficient for daily use; only use 2K/4K when printing or high-definition display is required.

10.1.4 Basic Usage Tutorial

After installation, you can directly use the image generation function in OpenClaw.

Example 1: Generate a Logo

You: Help me design a logo with the theme "Super Individual", requirements:
- Simple and modern
- Use blue and orange
- Include elements of a person and AI
- Suitable for social media avatars

OpenClaw will automatically call the image generation Skill, generate the logo, and save it locally.

Example 2: Generate a Whiteboard Diagram

You: Generate a whiteboard image, handwritten font style, with the content:

Title: OpenClaw Core Advantages

4 Major Advantages:
1. Local Deployment - Privacy Protection
2. File Access - Smart Search  
3. Skills Extension - Infinite Possibilities
4. Multi-platform Support - Anytime, Anywhere

Use handwritten font, add arrows, boxes, and other hand-drawn elements

Example 3: Generate Social Media Illustrations

You: Generate an Xiaohongshu illustration with the theme "Super Individual in the AI Era", requirements:
- 9:16 vertical format
- Warm color scheme
- Include text: One Person + AI = Infinite Possibilities
- Minimalist style

10.1.5 Command Line Usage (Advanced)

If you want to generate images in batches or integrate them into automation scripts, you can directly use the command line:

Basic Usage:

cd ~/.openclaw/skills/bananapro-image-gen

# Generate image (OpenAI format)
python3 scripts/generate_image.py \
    --prompt "A minimalist logo design, theme is AI assistant" \
    --filename output.png \
    --api-format openai

# Generate high-definition image (Gemini format)
python3 scripts/generate_image.py \
    --prompt "A whiteboard diagram, handwritten style" \
    --filename whiteboard.png \
    --api-format gemini \
    --resolution 2K

Parameter Description:

ParameterDescriptionDefault ValueExample
--promptImage description (required)-"A logo design"
--filenameOutput filenameoutput.pngmy_image.png
--api-formatAPI formatopenaiopenai/gemini
--resolutionResolution1K1K/2K/4K

Batch Generation Example:

# Create batch generation script
cat > batch_generate.sh << 'EOF'
#!/bin/bash

# Generate 5 images with different themes
prompts=(
    "Logo design: Super Individual"
    "Whiteboard diagram: AI workflow"
    "Poster: 10x efficiency improvement"
    "Illustration: Knowledge management system"
    "Icon: Automation tool"
)

for i in "${!prompts[@]}"; do
    echo "Generating image $((i+1))..."
    python3 scripts/generate_image.py \
        --prompt "${prompts[$i]}" \
        --filename "output_$((i+1)).png"
done

echo "Batch generation complete!"
EOF

chmod +x batch_generate.sh
./batch_generate.sh

10.1.6 Prompt Engineering Tips

Good prompts are key to generating high-quality images. Here are some practical tips:

Tip 1: Specify Style Clearly

❌ Bad: Generate an image
✅ Good: Generate a whiteboard image, handwritten font style, simple and modern

Tip 2: Provide Detailed Descriptions

❌ Bad: Draw a logo
✅ Good: Design a logo, circular, blue gradient, with an abstract brain pattern in the center,
      surrounded by flowing data lines, with a modern tech feel

Tip 3: Specify Elements

❌ Bad: Draw an architecture diagram
✅ Good: Draw a system architecture diagram, including:
      - User client (phone icon)
      - Gateway (cloud icon)
      - Database (cylinder icon)
      - Connect components with arrows
      - Add text labels

Tip 4: Reference Styles

✅ Good: Generate an image, with a style similar to:
      - Hand-drawn whiteboard style
      - Flat design
      - Watercolor style
      - Pixel art style

Prompt Template Library:

# Logo Design Template
"Design a {theme} logo, requirements:
- Shape: [Circular/Square/Abstract]
- Color: [Main color tone]
- Elements: [Core elements]
- Style: [Modern/Retro/Minimalist]
- Usage: [Social media/Website/Business card]"

# Whiteboard Diagram Template
"Generate a whiteboard image, handwritten font style, with the content:
Title: [Title text]
Key points:
1. [Point 1]
2. [Point 2]
3. [Point 3]
Use handwritten font, add arrows, boxes, underlines, and other hand-drawn elements"

# Social Media Illustration Template
"Generate a [platform] illustration with the theme [theme], requirements:
- Size: [9:16/16:9/1:1]
- Color scheme: [Warm/Cool/Contrast]
- Text: [Core copy]
- Style: [Minimalist/Rich/Creative]"

# Architecture Diagram Template
"Generate an architecture diagram for [system name], including:
Components:
- [Component 1]: [Description]
- [Component 2]: [Description]
- [Component 3]: [Description]
Connection relationships:
- [Component 1] → [Component 2]
- [Component 2] → [Component 3]
Use boxes, arrows, icons, and other elements to clearly display the system structure"

10.1.7 Practical Cases

Case 1: Generate Chapter Summary Diagrams for Tutorials

Scenario: You are writing an OpenClaw tutorial and need to generate a summary whiteboard diagram for each chapter.

# Use the provided test script
cd ~/.openclaw/skills/bananapro-image-gen
bash test_chapters.sh

This script will automatically generate 4 images:

  • chapter1_summary.png - Chapter 1 Summary
  • architecture.png - Core Architecture Diagram
  • chapter2_deployment.png - Deployment Method Comparison
  • chapter3_persona.png - Persona Configuration

Effect:

  • Time saving: Manual drawing takes 30 minutes/image, AI generation takes only 1 minute
  • Cost: Approx. 0.1 CNY/image
  • Quality: Handwritten style, suitable for tutorial illustrations

Case 2: Batch Generate Social Media Illustrations

Scenario: You are a content creator and need to generate illustrations for 10 articles.

# create_social_images.py
import subprocess
import json

# List of article titles
articles = [
    "Super Individual in the AI Era",
    "The Secret to 10x Efficiency Improvement",
    "One Person's Infinite Possibilities",
    # ... more titles
]

for i, title in enumerate(articles, 1):
    prompt = f"""Generate an Xiaohongshu illustration with the theme "{title}", requirements:
    - 9:16 vertical format
    - Warm color scheme
    - Include title text
    - Minimalist modern style
    """
    
    subprocess.run([
        "python3", "scripts/generate_image.py",
        "--prompt", prompt,
        "--filename", f"social_{i}.png",
        "--resolution", "2K"
    ])
    
    print(f"✅ Generating the {i}th illustration")

print("🎉 Batch generation complete!")

Effect:

  • Generate 10 illustrations: approx. 10 minutes
  • Cost: approx. 2 CNY (2K resolution)
  • Manual design: takes 5 hours+, costs 500 CNY+

Case 3: Automated Logo Design

Scenario: You need to quickly generate logo proposals for multiple projects.

# Create Logo generation script
cat > generate_logos.sh << 'EOF'
#!/bin/bash

# Project list
projects=(
    "Super Individual:Blue:Modern Tech"
    "Knowledge Management:Green:Minimalist"
    "Efficiency Tool:Orange:Vibrant"
)

for project in "${projects[@]}"; do
    IFS=':' read -r name color style <<< "$project"
    
    prompt="Design a logo for ${name}, requirements:
    - Main color tone: ${color}
    - Style: ${style}
    - Simple and modern
    - Suitable for social media"
    
    python3 scripts/generate_image.py \
        --prompt "$prompt" \
        --filename "logo_${name}.png"
    
    echo "✅ Generating ${name} Logo"
done
EOF

chmod +x generate_logos.sh
./generate_logos.sh

10.1.8 Common Issues

Q1: What if the generated image doesn't meet expectations?

A: Optimize the prompt, add more detailed descriptions. You can try:

  • Add reference styles
  • Explicitly specify elements
  • Adjust resolution
  • Generate multiple times and choose the best one

Q2: How to control costs?

A:

  • Use 1K resolution for daily use (approx. 0.05 CNY/image)
  • Use scripts for batch generation to avoid duplicate generation
  • Set a daily budget limit
  • Use a proxy API for lower costs

Q3: Which image formats are supported?

A: Currently, PNG format is supported, which is the most common format. If other formats are needed, you can use conversion tools:

# Convert to JPG
convert output.png output.jpg

# Convert to WebP (smaller file)
convert output.png output.webp

Q4: What if the generation speed is slow?

A:

  • Check network connection
  • Use a domestic proxy API
  • Lower resolution (1K is fastest)
  • Avoid peak hours

Q5: How to integrate into an automated workflow?

A: Refer to the batch generation example in 10.1.5, or call it in OpenClaw's automation tasks:

# In OpenClaw's automation script
from skills.nano_banana_image_gen import generate_image

# Generate image
image_path = generate_image(
    prompt="Your prompt",
    filename="output.png",
    resolution="1K"
)

print(f"Image generated: {image_path}")

10.1.9 Advanced Tips

Tip 1: Use Two API Formats

The Skill supports two API formats, which can be switched according to your needs:

# OpenAI format (good compatibility)
python3 scripts/generate_image.py \
    --api-format openai \
    --prompt "Your prompt"

# Gemini format (more powerful features)
python3 scripts/generate_image.py \
    --api-format gemini \
    --prompt "Your prompt" \
    --resolution 2K

Tip 2: Image Post-processing

After generating an image, you can use Python for post-processing:

from PIL import Image, ImageDraw, ImageFont

# Open the generated image
img = Image.open("output.png")

# Add watermark
draw = ImageDraw.Draw(img)
font = ImageFont.truetype("Arial.ttf", 36)
draw.text((10, 10), "© 2026", fill="white", font=font)

# Resize
img = img.resize((800, 600))

# Save
img.save("output_processed.png")

Tip 3: Create Image Templates

# image_templates.py
TEMPLATES = {
    "logo": """Design a {theme} logo, requirements:
    - Shape: {shape}
    - Color: {color}
    - Style: {style}
    - Usage: {usage}""",
    
    "whiteboard": """Generate a whiteboard image, handwritten font style, with the content:
    Title: {title}
    {content}
    Use handwritten font, add arrows, boxes, and other hand-drawn elements""",
    
    "social": """Generate a {platform} illustration with the theme {theme}, requirements:
    - Size: {ratio}
    - Color scheme: {color_scheme}
    - Text: {text}
    - Style: {style}"""
}

def generate_from_template(template_name, **kwargs):
    prompt = TEMPLATES[template_name].format(**kwargs)
    # Call the generation function
    return generate_image(prompt)

# Use template
generate_from_template(
    "logo",
    theme="AI Assistant",
    shape="Circular",
    color="Blue Gradient",
    style="Modern Tech",
    usage="Social Media"
)

10.2 Notion Data Synchronization Integration

Notion is a popular knowledge management tool. By integrating the Notion API with OpenClaw, automated data synchronization and content management can be achieved.

Notion工作空间 - 知识管理和协作平台

10.2.1 Why Integrate Notion?

Application Scenarios:

  • 📝 Automatic Note Creation: Content processed by OpenClaw is automatically saved to Notion
  • 📊 Database Synchronization: Automatically update Notion databases
  • 📅 Task Management: Automatically create and update tasks
  • 🔄 Bi-directional Synchronization: Notion and OpenClaw data interoperability

Efficiency Improvement:

  • Manual copy-paste: 5 minutes/time
  • Automatic synchronization: 5 seconds/time
  • Efficiency improvement: 98%

10.2.2 Notion Integration Solutions

Since there are currently no ready-made Notion Skills on the ClawHub marketplace, you can integrate Notion in the following ways:

Solution 1: Use Notion API (Recommended)

Integrate directly using the official Notion API:

# Install Notion SDK
npm install @notionhq/client

# Or use Python SDK
pip install notion-client

Solution 2: Custom Skill

Create your own Notion Skill:

# Create Skill directory
mkdir -p ~/.openclaw/skills/my-notion-skill
cd ~/.openclaw/skills/my-notion-skill

# Create skill.json
cat > skill.json << 'EOF'
{
  "name": "my-notion-skill",
  "version": "1.0.0",
  "description": "Custom Notion integration",
  "main": "index.js"
}
EOF

# Install dependencies
npm init -y
npm install @notionhq/client

Solution 3: Use MCP Server

If you are using a version that supports MCP (Model Context Protocol), you can configure a Notion MCP server:

{
  "mcpServers": {
    "notion": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-notion"],
      "env": {
        "NOTION_API_KEY": "your-api-key"
      }
    }
  }
}

💡 Note: As Skills on the ClawHub marketplace are constantly updated, it is recommended to:

  1. Visit https://clawhub.com to see the latest available Skills
  2. Use npx clawhub@latest search notion to search for relevant Skills
  3. If there is no ready-made Skill, you can create one yourself or integrate directly using the API

10.2.3 Complete Notion API Configuration Guide

To use the Notion skill, you need to perform some initial setup. This skill manages pages, databases, and blocks via the Notion API.

Step 1: Create a Notion Integration

  1. Access the Integrations Page

  2. Create a New Integration

    • Click the "+ New integration" button in the top right corner of the page
    • Fill in the integration information:
      • Name: OpenClaw Integration (or a name you prefer)
      • Associated workspace: Select the workspace you want to use
      • Logo: Optional, upload an icon
  3. Configure Permissions

    • In the "Capabilities" section, check the following permissions:
      • Read content: Read page and database content
      • Update content: Update existing content
      • Insert content: Create new pages and database entries
      • Read comments: Read comments (optional)
      • Insert comments: Add comments (optional)
  4. Submit Creation

    • Click the "Submit" button
    • The system will generate an API key (Secret)

Step 2: Obtain and Save the API Key

  1. Copy the API Key

    • On the integration details page, find "Internal Integration Token"
    • Click the "Show" button to reveal the key
    • Click the "Copy" button to copy the key
    • The API key format is usually: secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  2. Save the API Key to the Configuration File

    Method 1: Use OpenClaw Configuration File

    # Edit OpenClaw configuration
    nano ~/.openclaw/openclaw.json

    Add Notion configuration:

    {
      "api": {
        "notion": {
          "apiKey": "secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "version": "2022-06-28"
        }
      }
    }

    Method 2: Use Environment Variables

    # Add to ~/.bashrc or ~/.zshrc
    export NOTION_API_KEY="secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    export NOTION_VERSION="2022-06-28"
    
    # Reload configuration
    source ~/.bashrc  # Or source ~/.zshrc

    Method 3: Use a Separate Configuration File

    # Create Notion configuration file
    mkdir -p ~/.openclaw/config
    cat > ~/.openclaw/config/notion.json << 'EOF'
    {
      "apiKey": "secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "version": "2022-06-28"
    }
    EOF
    
    # Set file permissions (protect key security)
    chmod 600 ~/.openclaw/config/notion.json

Step 3: Share Pages/Databases with the Integration

This is the most crucial step! Even with an API Key, the Integration can only access pages and databases explicitly shared with it.

Share a Single Page:

  1. Open the Notion page you want OpenClaw to access
  2. Click the "Share" button in the top right corner of the page
  3. In the pop-up dialog, click the "Invite" input field
  4. Search for the integration name you created (e.g., OpenClaw Integration)
  5. Click the integration name, then click "Invite"
  6. Now this page and all its sub-pages can be accessed by the Integration

Share a Database:

  1. Open your Notion database page
  2. Click the "..." menu in the top right corner
  3. Select "Connections" → "Connect to"
  4. Search for and select your integration (OpenClaw Integration)
  5. Click "Confirm"

Batch Sharing (Recommended):

If you want OpenClaw to access the entire workspace:

  1. On the root page of the workspace (usually the "Workspace" page)
  2. Click "Share" → Connect your Integration
  3. This way, all sub-pages and databases will be automatically shared

Step 4: Obtain Database ID (if operating databases)

If you want OpenClaw to operate specific databases, you need to obtain the Database ID.

Method 1: Obtain from URL

  1. Open the Notion database page in your browser
  2. Copy the URL from the browser's address bar
  3. The Database ID is the 32-character string in the URL

Example URL:

https://www.notion.so/workspace/DatabaseName-1234567890abcdef1234567890abcdef?v=...
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                 This part is the Database ID

Format after removing hyphens:

1234567890abcdef1234567890abcdef

Method 2: Query using Notion API

# Use curl to query all accessible databases
curl -X POST https://api.notion.com/v1/search \
  -H "Authorization: Bearer secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Notion-Version: 2022-06-28" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {
      "property": "object",
      "value": "database"
    }
  }'

Save Database ID:

# Add to OpenClaw configuration
nano ~/.openclaw/openclaw.json
{
  "api": {
    "notion": {
      "apiKey": "secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "version": "2022-06-28"
    }
  },
  "notion": {
    "databases": {
      "notes": "1234567890abcdef1234567890abcdef",
      "tasks": "abcdef1234567890abcdef1234567890",
      "projects": "567890abcdef1234567890abcdef1234"
    },
    "defaultDatabase": "notes"
  }
}

Step 5: Test Connection

Test 1: Test with curl

# Set variables
NOTION_API_KEY="secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
NOTION_VERSION="2022-06-28"

# Test API connection
curl -X GET https://api.notion.com/v1/users/me \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: $NOTION_VERSION"

# If successful, your user information will be returned

Test 2: Query Database

# Query specific database
DATABASE_ID="1234567890abcdef1234567890abcdef"

curl -X POST "https://api.notion.com/v1/databases/$DATABASE_ID/query" \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: $NOTION_VERSION" \
  -H "Content-Type: application/json" \
  -d '{}'

# If successful, entries from the database will be returned

Test 3: Create Page

# Create a test page in the database
curl -X POST https://api.notion.com/v1/pages \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: $NOTION_VERSION" \
  -H "Content-Type: application/json" \
  -d '{
    "parent": {
      "database_id": "'$DATABASE_ID'"
    },
    "properties": {
      "Name": {
        "title": [
          {
            "text": {
              "content": "OpenClaw Test Page"
            }
          }
        ]
      }
    }
  }'

# If successful, information about the newly created page will be returned

Test 4: Test with OpenClaw

# If Notion Skill is installed
openclaw notion test

# Or test directly in OpenClaw
You: Test Notion connection

OpenClaw: Testing Notion API connection...

 API connection successful!

📊 Connection Information:
 API Version: 2022-06-28
 Username: Your Name
 Workspace: Your Workspace
 Accessible Pages: 15
 Accessible Databases: 3

📁 Available Databases:
1. Notes Database (notes)
2. Tasks Database (tasks)
3. Projects Database (projects)

 Notion integration configured successfully!

Common Troubleshooting

Issue 1: API call returns 401 Unauthorized

Reason: Incorrect API Key or improper configuration

Solution:

# Check API Key format
echo $NOTION_API_KEY
# Should be: secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Re-copy API Key
# Visit https://www.notion.so/my-integrations
# Re-copy the key and update the configuration

Issue 2: API call returns 404 Not Found

Reason: Page or database not shared with the Integration

Solution:

  1. Confirm that the page/database has been shared with the Integration
  2. Check if the Database ID is correct
  3. Confirm that the Integration has access permissions

Issue 3: Unable to create page

Reason: Integration lacks "Insert content" permission

Solution:

  1. Visit https://www.notion.so/my-integrations
  2. Select your Integration
  3. In "Capabilities", check "Insert content"
  4. Save changes

Issue 4: Database ID not found

Solution:

# Use API to search all databases
curl -X POST https://api.notion.com/v1/search \
  -H "Authorization: Bearer $NOTION_API_KEY" \
  -H "Notion-Version: $NOTION_VERSION" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {
      "property": "object",
      "value": "database"
    }
  }' | jq '.results[] | {id: .id, title: .title}'

Security Recommendations

1. Protect API Key

# Set configuration file permissions
chmod 600 ~/.openclaw/config/notion.json

# Do not commit API Key to Git
echo "*.json" >> ~/.openclaw/.gitignore
echo "openclaw.json" >> ~/.gitignore

2. Use Environment Variables

# Set in ~/.bashrc or ~/.zshrc
export NOTION_API_KEY="secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Use in scripts
NOTION_API_KEY="${NOTION_API_KEY}"

3. Rotate Keys Regularly

# Change API Key every 3-6 months
# 1. Create a new Integration in Notion
# 2. Update configuration file
# 3. Delete the old Integration

4. Principle of Least Privilege

  • Grant only necessary permissions
  • Share only pages/databases that need to be accessed
  • Regularly review the Integration's access permissions

Complete Configuration Example

{
  "api": {
    "notion": {
      "apiKey": "secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "version": "2022-06-28",
      "timeout": 30000,
      "retries": 3
    }
  },
  "notion": {
    "databases": {
      "notes": "1234567890abcdef1234567890abcdef",
      "tasks": "abcdef1234567890abcdef1234567890",
      "projects": "567890abcdef1234567890abcdef1234",
      "meetings": "890abcdef1234567890abcdef1234567"
    },
    "defaultDatabase": "notes",
    "autoSync": true,
    "syncInterval": 300,
    "templates": {
      "note": {
        "properties": {
          "Tags": ["Study Notes"],
          "Status": "Draft"
        }
      },
      "task": {
        "properties": {
          "Status": "To Do",
          "Priority": "Medium"
        }
      }
    }
  }
}

Once these settings are complete, you can use OpenClaw to call the Notion API to create, read, and update content in Notion!

10.2.4 Configure Notion Integration

# Edit OpenClaw configuration
nano ~/.openclaw/openclaw.json

Add Notion configuration:

{
  "api": {
    "notion": {
      "apiKey": "secret_xxxxxxxxxxxxx",
      "version": "2022-06-28"
    }
  },
  "notion": {
    "defaultDatabase": "your-database-id",
    "autoSync": true,
    "syncInterval": 300
  }
}

Configuration Description:

ParameterDescriptionExample
apiKeyNotion API Keysecret_xxx
versionAPI Version2022-06-28
defaultDatabaseDefault Database ID32-character string
autoSyncAuto Synctrue/false
syncIntervalSync Interval (seconds)300

10.2.5 Basic Usage and Practical Cases

Example 1: Automatic Note Creation

You: Save this article to Notion

Title: OpenClaw Usage Experience
Content:
Today I learned about OpenClaw's API integration feature,
Key takeaways include:
1. Learned how to configure Gemini API
2. Successfully generated the first AI image
3. Understood the Skills extension mechanism

OpenClaw: Okay, saving to Notion...

📝 [Create Notion Page]

✅ Page created successfully!

📄 Page Information:
• Title: OpenClaw Usage Experience
• Creation Time: 2026-02-12 10:30
• Page ID: abc123...
• Link: https://notion.so/abc123

📊 Content Statistics:
• Word Count: 120 words
• Paragraphs: 4
• List Items: 3

Automatically added:
• Tags: #StudyNotes #OpenClaw
• Category: Technical Documentation
• Creation Date: 2026-02-12

🔗 Open in Notion:
https://notion.so/abc123

Example 2: Batch Import Documents

You: Import all Markdown files in this folder to Notion

Folder: ~/Documents/notes/

OpenClaw: Okay, scanning files...

📁 [Batch Import to Notion]

📊 Scan Results:
• Folder: ~/Documents/notes/
• Number of Files: 15
• Total Size: 2.5MB
• Estimated Time: 2 minutes

⏳ Import Progress:

[████████████████████] 100% (15/15)

✅ Import complete!

📊 Import Statistics:
• Success: 15
• Failed: 0
• Total Time: 1 minute 45 seconds

📁 Notion Structure:
Notes Import/
├── Study Notes/
│   ├── Study Notes.md
│   └── Technical Documentation.md
├── Project Management/
│   ├── Project Planning.md
│   └── Meeting Minutes.md
└── Product Design/
    └── Product Requirements.md

🔗 View in Notion:
https://notion.so/workspace/notes-import

10.2.6 Advanced Tips

Tip 1: Custom Templates

# Create meeting minutes template
openclaw notion template create "meeting" \
  --title "Meeting Minutes-{date}" \
  --properties "Topic,Time,Attendees,Content,Decisions,Tasks" \
  --database "meetings-db-id"

# Use template
You: Create today's meeting minutes using the meeting template

Tip 2: Automated Workflows

# Set auto-sync rules
openclaw config set notion.auto-rules '{
  "markdown-to-notion": {
    "watch": "~/Documents/notes/",
    "target": "notes-db-id",
    "trigger": "file-save"
  },
  "task-sync": {
    "watch": "~/Projects/tasks.md",
    "target": "tasks-db-id",
    "trigger": "file-change"
  }
}'

Tip 3: Bi-directional Synchronization

# Enable bi-directional synchronization
openclaw config set notion.bidirectional true

# Notion updates will automatically sync to local
# Local updates will automatically sync to Notion

10.2.7 Common Issues

Q1: What if the API call fails?

A: Check the following points:

  • Is the API Key correct?
  • Has the Integration been shared with the page?
  • Does the API version match?
  • Is the network connection normal?
# Test API connection
openclaw notion test

# View error logs
openclaw logs --filter notion

Q2: How to handle large amounts of data?

A: Use batch operations and pagination:

# Batch import (automatic batching)
openclaw notion import ~/notes/ \
  --batch-size 10 \
  --delay 1000

# Paginated query
openclaw notion query \
  --database "db-id" \
  --page-size 100

Q3: How to avoid duplicate creation?

A: Use unique identifiers:

# Configure deduplication rules
openclaw config set notion.dedup '{
  "enabled": true,
  "field": "title",
  "action": "skip"
}'

10.2.8 Efficiency Improvement Data

Task TypeManual OperationAutomationTime SavedImprovement Ratio
Create Note5 minutes5 seconds4 minutes 55 seconds98.3%
Update Database10 minutes10 seconds9 minutes 50 seconds98.3%
Batch Import60 minutes2 minutes58 minutes96.7%
Meeting Minutes30 minutes1 minute29 minutes96.7%

Cost Reference:

  • Notion API: Free (with rate limits)
  • OpenClaw Skills: Free
  • Total Cost: $0/month

10.3 Video Generation Services

AI video generation is an emerging creative tool that can automatically convert text scripts into videos.

10.3.1 Why Integrate Video Services?

Application Scenarios:

  • 🎬 Short Video Creation: Quickly generate Douyin (TikTok) and Kuaishou short videos
  • 📺 Long Video Production: Bilibili, YouTube tutorial videos
  • 🎥 Marketing Videos: Product introductions, advertising campaigns
  • 🎞️ Educational Videos: Course explanations, knowledge sharing

Efficiency Improvement:

  • Manual editing: 2-4 hours/video
  • AI generation: 10-30 minutes/video
  • Efficiency improvement: 80-90%

Based on the ClawHub skill marketplace, the following video generation Skills are recommended:

1. video-agent - HeyGen Video Generation

# Install
npx clawhub@latest install video-agent

# Features
 Generate AI avatar videos using HeyGen API
 Supports multiple languages and voice tones
 Professional-grade video quality
 Suitable for tutorials and marketing videos

2. sora-video-gen - OpenAI Sora

# Install
npx clawhub@latest install sora-video-gen

# Features
 Uses OpenAI Sora API
 Text-to-video generation
 High-quality video output
 Creative video production

3. veo3-video-gen - Google Veo

# Install
npx clawhub@latest install veo3-video-gen

# Features
 Uses Google Veo 3.x
 Generate and stitch short videos
 Supports various styles
 Suitable for short video creation

4. tube-cog - YouTube Content Creation

# Install
npx clawhub@latest install tube-cog

# Features
 YouTube content creation
 Powered by CellCog
 Complete video production workflow
 Automated publishing

5. video-cog - Long-form Video Production

# Install
npx clawhub@latest install video-cog

# Features
 Long-form AI video production
 Multi-agent collaboration
 Professional-grade video output
 Suitable for tutorials and courses

10.3.3 Configure Video Services

Configure HeyGen (Recommended):

# Edit OpenClaw configuration
nano ~/.openclaw/openclaw.json

Add HeyGen configuration:

{
  "api": {
    "heygen": {
      "apiKey": "your-heygen-api-key",
      "baseUrl": "https://api.heygen.com/v1"
    }
  },
  "video": {
    "defaultAvatar": "avatar-id",
    "defaultVoice": "voice-id",
    "quality": "high",
    "format": "mp4"
  }
}

Obtain HeyGen API Key:

  1. Visit https://www.heygen.com
  2. Register and log in to your account
  3. Go to API Settings
  4. Create and copy the API Key

Cost Reference:

  • HeyGen: $0.5-2/minute (depending on quality)
  • Sora: $0.1-0.5/second
  • Veo: $0.05-0.2/second

10.3.4 Basic Usage

Example 1: Generate AI Avatar Video

You: Generate a 30-second AI avatar video with the content:

Theme: OpenClaw Quick Start
Script:
Hello, I am OpenClaw AI Assistant.
Today, I will introduce how to quickly get started with OpenClaw.
Just 3 steps: Install, Configure, Use.
Let's begin!

Requirements:
- Avatar: Professional male
- Voice Tone: Gentle
- Background: Tech-inspired
- Subtitles: Chinese

OpenClaw: Okay, generating video...

🎬 [AI Video Generation] OpenClaw Quick Start
📊 Video Information:
• Duration: 30 seconds
• Resolution: 1080p
• Format: MP4
• Size: Approx. 15MB

⏳ Generation Progress:

1. Script Analysis [████████████████████] 100%
2. Avatar Rendering [████████████████████] 100%
3. Voice Synthesis [████████████████████] 100%
4. Video Composition [████████████████████] 100%
5. Subtitle Addition [████████████████████] 100%

✅ Video generation complete!

📹 Video Preview:
[Video Thumbnail]

📊 Video Details:
• Avatar: Professional Male (ID: avatar-001)
• Voice Tone: Gentle Male Voice (ID: voice-cn-male-01)
• Background: Tech Blue Gradient
• Subtitles: Chinese, White, Bottom Centered

💰 Cost:
• Generation Fee: $1.00
• Storage Fee: $0.01
• Total: $1.01

📁 Files Saved:
• Video File: openclaw_intro.mp4
• Subtitle File: openclaw_intro.srt
• Script File: openclaw_intro.txt

🔗 Online Preview:
https://video.openclaw.com/abc123

Example 2: Batch Generating a Video Series

You: Batch generate an OpenClaw tutorial video series, 5 episodes in total.

Episode 1: What is OpenClaw
Episode 2: How to Install OpenClaw
Episode 3: Basic Configuration Tutorial
Episode 4: Using Skills Extensions
Episode 5: Practical Case Sharing

OpenClaw: Okay, batch generating now...

🎬 [Batch Video Generation] OpenClaw Tutorial Series

📊 Task Information:
• Number of Videos: 5 episodes
• Duration per Episode: 3-5 minutes
• Total Duration: Approx. 20 minutes
• Estimated Time: 15 minutes

⏳ Generation Progress:

Episode 1: What is OpenClaw
[████████████████████] 100% ✅

Episode 2: How to Install OpenClaw
[████████████████████] 100% ✅

Episode 3: Basic Configuration Tutorial
[████████████████████] 100% ✅

Episode 4: Using Skills Extensions
[████████████████████] 100% ✅

Episode 5: Practical Case Sharing
[████████████████████] 100% ✅

✅ All generated!

📊 Generation Statistics:
• Success: 5 episodes
• Failure: 0 episodes
• Total Time Spent: 12 minutes 30 seconds
• Total Size: 150MB

📁 File List:
1. ✅ 01_What_is_OpenClaw.mp4 (30MB)
2. ✅ 02_How_to_Install_OpenClaw.mp4 (28MB)
3. ✅ 03_Basic_Configuration_Tutorial.mp4 (32MB)
4. ✅ 04_Skills_Extension_Usage.mp4 (35MB)
5. ✅ 05_Practical_Case_Sharing.mp4 (25MB)

💰 Total Cost:
• Generation Fee: $15.00
• Storage Fee: $0.15
• Total: $15.15

📦 Packaged:
• OpenClaw Tutorial Series.zip (150MB)

🔗 Download Link:
https://video.openclaw.com/series/abc123

10.3.5 Practical Cases

Case 1: Automated Short Video Creation

Scenario: Automatically generate a short knowledge-sharing video every day.

# Create an automation script
cat > daily_video.sh << 'EOF'
#!/bin/bash

# Get today's topic
topic=$(openclaw ask "Recommend 1 technical topic suitable for a short video")

# Generate script
script=$(openclaw ask "Generate a 60-second short video script for the topic '${topic}'")

# Generate video
openclaw video generate \
  --script "$script" \
  --duration 60 \
  --avatar "professional-male" \
  --voice "cn-male-01" \
  --output "daily_$(date +%Y%m%d).mp4"

echo "✅ Today's video generated: ${topic}"
EOF

chmod +x daily_video.sh

# Set up a scheduled task (every day at 9 AM)
openclaw schedule add "daily-video" \
  --time "09:00" \
  --command "./daily_video.sh"

Case 2: Product Introduction Video Generation

Scenario: Quickly generate multi-language introduction videos for a new product.

You: Generate product introduction videos for OpenClaw, requiring 3 versions: Chinese, English, and Japanese.

Product Features:
1. Local deployment, privacy protection
2. File access, intelligent search
3. Skills extensions, infinite possibilities
4. Multi-platform support, anytime, anywhere

OpenClaw: Okay, generating multi-language versions now...

🎬 [Multi-language Video Generation]

📊 Task Information:
• Language Versions: 3 (Chinese, English, Japanese)
• Video Duration: 2 minutes each
• Estimated Time: 10 minutes

⏳ Generation Progress:

Chinese Version:
[████████████████████] 100% ✅

English Version:
[████████████████████] 100% ✅

Japanese Version:
[████████████████████] 100% ✅

✅ All generated!

📁 File List:
1. ✅ OpenClaw_Intro_CN.mp4 (40MB)
2. ✅ OpenClaw_Intro_EN.mp4 (38MB)
3. ✅ OpenClaw_Intro_JP.mp4 (39MB)

💰 Total Cost: $6.00

🔗 Online Preview:
• Chinese: https://video.openclaw.com/cn/abc123
• English: https://video.openclaw.com/en/abc123
• Japanese: https://video.openclaw.com/jp/abc123

10.3.6 Advanced Techniques

Technique 1: Custom Avatars

# Upload a custom avatar photo
openclaw video avatar upload \
  --photo "my_photo.jpg" \
  --name "my-avatar"

# Use a custom avatar
openclaw video generate \
  --avatar "my-avatar" \
  --script "Your script"

Technique 2: Video Post-processing

# Add intro and outro
openclaw video edit \
  --input "video.mp4" \
  --intro "intro.mp4" \
  --outro "outro.mp4" \
  --output "final.mp4"

# Add background music
openclaw video edit \
  --input "video.mp4" \
  --bgm "music.mp3" \
  --volume 0.3 \
  --output "with_music.mp4"

Technique 3: Batch Processing Optimization

# Generate multiple videos in parallel
openclaw video batch \
  --scripts "scripts/*.txt" \
  --parallel 3 \
  --output "videos/"

10.3.7 Frequently Asked Questions

Q1: What should I do if video generation fails?

A: Check the following:

  • Is the API Key correct?
  • Is the account balance sufficient?
  • Does the script meet the requirements?
  • Is the network connection stable?

Q2: How can I improve video quality?

A:

  • Use high-quality mode.
  • Optimize script content.
  • Choose appropriate avatars and voice tones.
  • Add background music and special effects.

Q3: How can I control costs?

A:

  • Use standard quality mode.
  • Enjoy discounts for batch generation.
  • Reuse avatars and voice tones.
  • Reasonably plan video duration.

10.3.8 Efficiency Improvement Data

Task TypeManual ProductionAI GenerationTime SavedImprovement Ratio
Short Video (1 min)120 minutes10 minutes110 minutes91.7%
Medium Video (5 min)300 minutes30 minutes270 minutes90.0%
Long Video (15 min)600 minutes60 minutes540 minutes90.0%
Batch Generation (5 videos)1500 minutes120 minutes1380 minutes92.0%

Cost Comparison:

  • Manual Production: $50-200/minute
  • AI Generation: $0.5-2/minute
  • Cost Savings: 95-99%

10.4 Voice Synthesis Integration

Convert text to speech, suitable for audiobooks, video narration, voice assistants, and other scenarios.

10.4.1 Why Integrate Voice Services?

Application Scenarios:

  • 📚 Audiobooks: Convert articles and books into audio
  • 🎙️ Video Narration: Add professional voiceovers to videos
  • 🔊 Voice Assistants: Implement voice interaction features
  • 📻 Podcast Production: Quickly generate podcast content

Efficiency Improvement:

  • Manual Recording: 30-60 minutes/1000 characters
  • AI Synthesis: 1-2 minutes/1000 characters
  • Efficiency Improvement: 95-98%

Based on the ClawHub skill marketplace, the following voice synthesis Skills are recommended:

1. elevenlabs - Top-tier Voice Synthesis

# Install
npx clawhub@latest install elevenlabs

# Features
 Hyper-realistic voice quality
 Supports multiple languages and voice tones
 Rich emotional expression
 Suitable for professional narration

2. azure-tts - Microsoft Voice Service

# Install
npx clawhub@latest install azure-tts

# Features
 Supports 140+ languages
 Neural network voices
 High-quality output
 Enterprise-grade stability

3. google-tts - Google Voice

# Install
npx clawhub@latest install google-tts

# Features
 WaveNet technology
 Natural and fluent
 Multi-language support
 Cost-effective

4. openai-tts - OpenAI Voice

# Install
npx clawhub@latest install openai-tts

# Features
 Uses OpenAI TTS API
 6 high-quality voice tones
 Supports multiple languages
 Simple and easy to use

10.4.3 Supported Voice Service Comparison

ServiceFeaturesCostSound QualityLanguage Support
ElevenLabsMost naturalHigh⭐⭐⭐⭐⭐29 languages
Azure TTSEnterprise-gradeMedium⭐⭐⭐⭐⭐140+ languages
Google TTSCost-effectiveMedium⭐⭐⭐⭐100+ languages
OpenAI TTSSimple to useLow⭐⭐⭐⭐50+ languages
iFlytek VoiceGood for ChineseLow⭐⭐⭐⭐Primarily Chinese

10.4.4 Configuring Voice Services

Configuring ElevenLabs (Recommended):

# Edit OpenClaw Configuration
nano ~/.openclaw/openclaw.json

Add ElevenLabs configuration:

{
  "api": {
    "elevenlabs": {
      "apiKey": "your-elevenlabs-api-key",
      "baseUrl": "https://api.elevenlabs.io/v1"
    }
  },
  "tts": {
    "defaultVoice": "voice-id",
    "defaultModel": "eleven_multilingual_v2",
    "quality": "high",
    "format": "mp3"
  }
}

Obtaining ElevenLabs API Key:

  1. Visit https://elevenlabs.io
  2. Register and log in to your account
  3. Go to Profile → API Keys
  4. Create and copy your API Key

Cost Reference:

  • ElevenLabs: $0.30/1000 characters
  • Azure TTS: $0.016/1000 characters
  • Google TTS: $0.016/1000 characters
  • OpenAI TTS: $0.015/1000 characters

10.4.5 Basic Usage

Example 1: Text-to-Speech

You: Convert this text to speech:

OpenClaw is an open-source AI assistant framework.
It can access local files, operating system applications,
and extend various functions, truly making AI your assistant.

Requirements:
- Voice Tone: Professional Male
- Speech Rate: Normal
- Format: MP3
- Quality: High Definition

OpenClaw: Okay, converting now...

🔊 [Text-to-Speech]

📝 Text Information:
• Word Count: 52 characters
• Language: Chinese
• Estimated Duration: Approx. 15 seconds

⏳ Conversion Progress:

1. Text Analysis [████████████████████] 100%
2. Voice Synthesis [████████████████████] 100%
3. Audio Processing [████████████████████] 100%
4. Format Conversion [████████████████████] 100%

✅ Conversion complete!

🎵 Audio Information:
• Duration: 15 seconds
• Format: MP3
• Bitrate: 192kbps
• Size: 360KB

📊 Audio Details:
• Voice Tone: Professional Male (ID: voice-cn-male-01)
• Speech Rate: Normal (1.0x)
• Volume: Standard (0dB)
• Quality: High Definition

💰 Cost:
• Conversion Fee: $0.02
• Storage Fee: $0.001
• Total: $0.021

📁 Files Saved:
• Audio File: openclaw_intro.mp3
• Text File: openclaw_intro.txt

🔗 Online Preview:
https://audio.openclaw.com/abc123

Example 2: Batch Converting Articles

You: Convert all articles in this folder to audio.

Folder: ~/Documents/articles/

OpenClaw: Okay, scanning files now...

🔊 [Batch Text-to-Speech]

📊 Scan Results:
• Folder: ~/Documents/articles/
• Number of Files: 10 articles
• Total Word Count: 25,000 characters
• Estimated Duration: Approx. 50 minutes
• Estimated Time: 5 minutes

⏳ Conversion Progress:

[████████████████████] 100% (10/10)

✅ All conversions complete!

📊 Conversion Statistics:
• Success: 10 articles
• Failure: 0 articles
• Total Time Spent: 4 minutes 30 seconds
• Total Duration: 48 minutes
• Total Size: 115MB

📁 File List:
1. ✅ Super_Individual_in_AI_Era.mp3 (12MB, 5 minutes)
2. ✅ Secret_to_10x_Efficiency.mp3 (10MB, 4 minutes)
3. ✅ Infinite_Possibilities_of_One_Person.mp3 (15MB, 6 minutes)
4. ✅ Building_a_Knowledge_Management_System.mp3 (11MB, 4.5 minutes)
5. ✅ Automated_Workflow_Design.mp3 (13MB, 5.5 minutes)
... (10 files in total)

💰 Total Cost:
• Conversion Fee: $7.50
• Storage Fee: $0.12
• Total: $7.62

📦 Packaged:
• Audiobook_Collection.zip (115MB)

🔗 Download Link:
https://audio.openclaw.com/batch/abc123

10.4.6 Practical Cases

Case 1: Automated Audiobook Production

Scenario: Automatically convert an e-book into an audiobook.

You: Convert this e-book into an audiobook.

File: The_Complete_Guide_to_OpenClaw.pdf
Requirements:
- Convert by chapter
- Each chapter as a separate file
- Add chapter title voiceovers
- Generate a playlist

OpenClaw: Okay, processing now...

📚 [Audiobook Production]

📖 E-book Information:
• Title: The Complete Guide to OpenClaw
• Number of Chapters: 16 chapters
• Total Word Count: 80,000 characters
• Estimated Duration: Approx. 3 hours

⏳ Processing Progress:

1. PDF Text Extraction [████████████████████] 100%
2. Chapter Segmentation [████████████████████] 100%
3. Voice Synthesis [████████████████████] 100%
4. Audio Processing [████████████████████] 100%
5. Playlist Generation [████████████████████] 100%

✅ Production complete!

📁 File Structure:
OpenClaw_Complete_Guide_Audio_Version/
├── 00_Title_and_Foreword.mp3 (5 minutes)
├── 01_Chapter_1_Introduction_to_OpenClaw.mp3 (10 minutes)
├── 02_Chapter_2_Quick_Start.mp3 (12 minutes)
├── 03_Chapter_3_Basic_Configuration.mp3 (15 minutes)
... (17 files in total)
├── playlist.m3u (Playlist)
└── metadata.json (Metadata)

📊 Production Statistics:
• Total Duration: 3 hours 5 minutes
• Total Size: 450MB
• Audio Format: MP3 192kbps
• Number of Chapters: 16 chapters + Foreword

💰 Total Cost: $24.00

📦 Packaged:
• OpenClaw_Complete_Guide_Audio_Version.zip (450MB)

🔗 Download Link:
https://audio.openclaw.com/audiobook/abc123

Case 2: Multi-language Voiceover Generation

Scenario: Generate multi-language voiceovers for a product introduction video.

You: Generate voiceovers in Chinese, English, and Japanese for this video script.

Script:
OpenClaw is an open-source AI assistant framework.
It can access local files, operating system applications.
Truly making AI your super assistant.

OpenClaw: Okay, generating multi-language voiceovers now...

🎙️ [Multi-language Voiceover Generation]

📊 Task Information:
• Language Versions: 3 (Chinese, English, Japanese)
• Script Word Count: 52 characters
• Estimated Duration: Approx. 15 seconds each

⏳ Generation Progress:

Chinese Voiceover:
[████████████████████] 100% ✅

English Voiceover:
[████████████████████] 100% ✅

Japanese Voiceover:
[████████████████████] 100% ✅

✅ All generated!

📁 File List:
1. ✅ openclaw_intro_cn.mp3 (360KB, 15 seconds)
2. ✅ openclaw_intro_en.mp3 (380KB, 16 seconds)
3. ✅ openclaw_intro_jp.mp3 (370KB, 15 seconds)

📊 Voiceover Details:
• Chinese: Professional Male, normal speech rate
• English: American Male, normal speech rate
• Japanese: Standard Male, normal speech rate

💰 Total Cost: $0.06

🔗 Online Preview:
• Chinese: https://audio.openclaw.com/cn/abc123
• English: https://audio.openclaw.com/en/abc123
• Japanese: https://audio.openclaw.com/jp/abc123

10.4.7 Advanced Techniques

Technique 1: Custom Voice Tones

# Clone your own voice (ElevenLabs)
openclaw tts voice clone \
  --samples "voice_samples/*.mp3" \
  --name "my-voice"

# Use a custom voice tone
openclaw tts generate \
  --text "Your text" \
  --voice "my-voice" \
  --output "output.mp3"

Technique 2: Emotional Control

# Add emotional tags
openclaw tts generate \
  --text "This is truly amazing! [excited]" \
  --voice "voice-id" \
  --emotion "excited" \
  --output "excited.mp3"

Technique 3: Adjusting Speech Rate and Pitch

# Adjust speech rate and pitch
openclaw tts generate \
  --text "Your text" \
  --voice "voice-id" \
  --speed 1.2 \
  --pitch 1.1 \
  --output "adjusted.mp3"

Technique 4: Batch Processing Optimization

# Convert multiple files in parallel
openclaw tts batch \
  --input "texts/*.txt" \
  --voice "voice-id" \
  --parallel 5 \
  --output "audios/"

10.4.8 Frequently Asked Questions

Q1: What if the voice sounds unnatural?

A:

  • Use a higher quality model.
  • Optimize text punctuation.
  • Adjust speech rate and pitch.
  • Try different voice tones.

Q2: How to handle long texts?

A:

  • Automatic segmentation.
  • Use streaming synthesis.
  • Batch convert and then merge.
# Automatic segmentation for long texts
openclaw tts generate \
  --text-file "long_article.txt" \
  --auto-split true \
  --max-length 5000 \
  --output "output.mp3"

Q3: How to control costs?

A:

  • Choose cost-effective services.
  • Enjoy discounts for batch processing.
  • Reuse common voice tones.
  • Reasonably control audio quality.

Q4: What audio formats are supported?

A: Multiple formats are supported:

  • MP3: Common format, small file size
  • WAV: Lossless format, high quality
  • OGG: Open-source format, good compression
  • AAC: High quality, small file size
# Specify output format
openclaw tts generate \
  --text "Your text" \
  --format "wav" \
  --output "output.wav"

10.4.9 Efficiency Improvement Data

Task TypeManual RecordingAI SynthesisTime SavedImprovement Ratio
Short Text (100 chars)10 minutes30 seconds9.5 minutes95.0%
Medium Text (1000 chars)60 minutes2 minutes58 minutes96.7%
Long Text (10000 chars)600 minutes15 minutes585 minutes97.5%
Batch Conversion (10 articles)6000 minutes120 minutes5880 minutes98.0%

Cost Comparison:

  • Manual Recording: $50-200/1000 characters
  • AI Synthesis: $0.015-0.30/1000 characters
  • Cost Savings: 99%+

Quality Comparison:

  • Manual Recording: ⭐⭐⭐⭐⭐ (Most natural, but high cost)
  • AI Synthesis (High-end): ⭐⭐⭐⭐⭐ (Close to human, low cost)
  • AI Synthesis (Standard): ⭐⭐⭐⭐ (Good quality, cost-effective)

📦 Complete Skills Installation Guide for This Chapter

⚠️ Important Notes

Before installing Skills, please note:

  1. Verify Skill Existence

    # Search for a Skill
    npx clawhub@latest search <skill-name>
    
    # View Skill details
    npx clawhub@latest info <skill-name>
  2. ClawHub Marketplace Dynamic Changes

    • Skills may be removed, renamed, or updated.
    • Some Skills in this document may not exist.
    • It is recommended to visit https://clawhub.com for the latest list.
  3. Alternative Solutions

    • If a Skill does not exist, you can use the service's official API.
    • You can create your own custom Skill.
    • You can search GitHub for community-contributed Skills.
  4. Security Tips

    • Only install Skills from trusted sources.
    • Review the Skill's source code and reviews.
    • Be careful to protect sensitive information like API keys.

Install All API Integration Skills

Method 1: Use the provided batch installation script (Recommended)

# Download and run the batch installation script
curl -O https://raw.githubusercontent.com/xianyu110/awesome-openclaw-tutorial/main/scripts/install_api_skills.sh
chmod +x install_api_skills.sh

# View usage help
./install_api_skills.sh --help

# Install Skills for specific scenarios
./install_api_skills.sh content    # Content creators
./install_api_skills.sh video      # Video creators
./install_api_skills.sh knowledge  # Knowledge workers
./install_api_skills.sh marketing  # Marketers
./install_api_skills.sh education  # Educators

# Install all Skills
./install_api_skills.sh all

Method 2: Manual installation, one by one

# AI Image Generation Service Skills (verify existence first)
# Before use, it is recommended to search: npx clawhub@latest search <skill-name>
npx clawhub@latest install fal-ai
npx clawhub@latest install nvidia-image-gen
npx clawhub@latest install pollinations
npx clawhub@latest install venice-ai
npx clawhub@latest install recraft

# Notion Integration (ClawHub may not have a ready-made Skill currently)
# It is recommended to use the Notion API directly or create a custom Skill.

# Video Generation Service Skills
npx clawhub@latest install video-agent
npx clawhub@latest install sora-video-gen
npx clawhub@latest install veo3-video-gen
npx clawhub@latest install tube-cog
npx clawhub@latest install video-cog

# Voice Synthesis Service Skills
npx clawhub@latest install elevenlabs
npx clawhub@latest install azure-tts
npx clawhub@latest install google-tts
npx clawhub@latest install openai-tts

💡 Important Tip:

  • Skills in the ClawHub marketplace are constantly updated; some Skills may not exist or may have been renamed.
  • Before installing, it is recommended to search: npx clawhub@latest search <skill-name>``
  • If a Skill does not exist, you can:
    1. Integrate directly using the corresponding service's official API.
    2. Create your own custom Skill.
    3. Search GitHub for community-contributed Skills.

Installation Suggestions by Scenario

Scenario 1: Content Creators (Must-install)

npx clawhub@latest install fal-ai
npx clawhub@latest install elevenlabs
# For Notion, direct API integration is recommended.
  • fal-ai: Quickly generate illustrations
  • elevenlabs: High-quality voiceovers
  • Notion: Integrate using the official API (see Section 10.2.2)

Scenario 2: Video Creators (Recommended)

npx clawhub@latest install video-agent
npx clawhub@latest install tube-cog
npx clawhub@latest install elevenlabs
  • video-agent: AI avatar videos
  • tube-cog: YouTube content creation
  • elevenlabs: Professional voiceovers

Scenario 3: Knowledge Workers (Recommended)

npx clawhub@latest install openai-tts
# For Notion, direct API integration is recommended.
  • openai-tts: Document to audio conversion
  • Notion: Integrate using the official API (see Section 10.2.2)

Scenario 4: Marketers (Recommended)

npx clawhub@latest install fal-ai
npx clawhub@latest install video-agent
npx clawhub@latest install elevenlabs
  • fal-ai: Marketing material generation
  • video-agent: Product introduction videos
  • elevenlabs: Advertising voiceovers

Scenario 5: Educators (Recommended)

npx clawhub@latest install fal-ai
npx clawhub@latest install video-cog
npx clawhub@latest install openai-tts
  • fal-ai: Teaching illustrations
  • video-cog: Course video production
  • openai-tts: Audio courseware

Configuration Priority

Must-install Skills (Priority: ⭐⭐⭐⭐⭐)

  • notion - Knowledge management (Free)
  • openai-tts - Voice synthesis (Cost-effective)
  • fal-ai - AI drawing (Comprehensive features)

Recommended Skills (Priority: ⭐⭐⭐⭐)

  • video-agent - Video generation (High quality)
  • elevenlabs - Voice synthesis (Most natural)
  • notion-mcp - Notion advanced features

Optional Skills (Priority: ⭐⭐⭐)

  • Install based on specific needs.
  • Try them out before deciding.

Cost Budget Reference

Monthly Cost Estimation:

Usage ScenarioSkills CombinationAPI CostTotal Cost/Month
Light UseBasic 3$5-10$5-10
Moderate UseRecommended 6$20-50$20-50
Heavy UseAll installed$50-150$50-150
Professional CreationHigh-end combination$100-300$100-300

Detailed Cost per Service:

Service TypeLight UseModerate UseHeavy Use
AI Drawing$2-5$10-20$30-50
Notion$0$0$0
Video Generation$5-10$20-50$50-100
Voice Synthesis$2-5$10-20$20-50

Cost Optimization Suggestions:

✅ Use domestic models (DeepSeek, Kimi)
✅ Batch process tasks
✅ Reuse generated results
✅ Set Token limits
✅ Choose appropriate quality levels
✅ Utilize free tiers
✅ Purchase in bulk for discounts

Frequently Asked Questions

Q1: What if Skills installation fails?

# Check network connection
ping github.com

# Use a domestic mirror
npm config set registry https://registry.npmmirror.com

# Retry installation
npx clawhub@latest install <skill-name>

# View detailed error
npx clawhub@latest install <skill-name> --verbose

Q2: What if Skills fail to load?

# View Skills list
openclaw skills list

# Check Skills status
openclaw skills check

# View Skill detailed information
openclaw skills info <skill-name>

# Restart OpenClaw
openclaw restart

Q3: What if API calls fail?

# Check API configuration
openclaw config get api

# Test API connection
openclaw api test <service-name>

# View error logs
openclaw logs --tail 50 --filter <service-name>

# Verify API key
openclaw api verify <service-name>

Q4: How to update Skills?

# Update a single Skill
npx clawhub@latest update <skill-name>

# Update all Skills
npx clawhub@latest update --all

# View updatable Skills
npx clawhub@latest list --outdated

# View update log
npx clawhub@latest changelog <skill-name>

Q5: How to uninstall unwanted Skills?

# Uninstall a single Skill
npx clawhub@latest uninstall <skill-name>

# Uninstall multiple Skills
npx clawhub@latest uninstall <skill1> <skill2> <skill3>

# Check Skills dependencies
openclaw skills check

Best Practices

1. Incremental Installation

Week 1: Install basic Skills (notion, openai-tts)
      Familiarize with basic usage, establish workflow

Week 2: Add creative Skills (fal-ai, video-agent)
      Expand functionality based on needs

Week 3: Optimize configuration and cost
      Adjust parameters, improve efficiency

Week 4: Establish automated workflows
      Integrate all Skills, achieve automation

2. Regular Maintenance

# Weekly update check
npx clawhub@latest list --outdated

# Periodically check Skills status
openclaw skills check

# Quarterly backup configuration
openclaw backup create

# Bi-annually evaluate usage
openclaw stats --period 6m

3. Performance Optimization

# Only load necessary Skills
openclaw config set skills.lazy-load true

# Set concurrency limit
openclaw config set skills.max-concurrent 3

# Enable caching
openclaw config set skills.cache.enabled true
openclaw config set skills.cache.ttl 3600

# Set timeout
openclaw config set skills.timeout 30000

4. Cost Monitoring

# View API usage statistics
openclaw stats api --period 1m

# Set cost alerts
openclaw config set cost.alert.enabled true
openclaw config set cost.alert.threshold 100

# View cost report
openclaw cost report --period 1m

# Export cost data
openclaw cost export --format csv

Advanced Techniques

Technique 1: Manage Skills using Configuration Files

# Create content creation profile
cat > ~/.openclaw/profiles/content-creation.json <<EOF
{
  "skills": ["fal-ai", "video-agent", "elevenlabs", "notion"],
  "description": "Content creation toolset"
}
EOF

# Create knowledge management profile
cat > ~/.openclaw/profiles/knowledge-management.json <<EOF
{
  "skills": ["notion", "notion-mcp", "openai-tts"],
  "description": "Knowledge management toolset"
}
EOF

Technique 2: Custom Shortcut Commands

# Create shortcut commands
openclaw alias create "画图" "Generate image using fal-ai"
openclaw alias create "记笔记" "Save to Notion"
openclaw alias create "配音" "Convert text to speech using elevenlabs"
openclaw alias create "做视频" "Generate video using video-agent"

# Use shortcut commands
You: 画图 a cute little lobster
You: 记笔记 Today I learned about API integration
You: 配音 this text
You: 做视频 product introduction script

Technique 3: Batch Installation Script

Since clawhub can only install one Skill at a time, you can create a batch installation script:

# Create a batch installation script
cat > install_skills.sh << 'EOF'
#!/bin/bash

# Define Skills to install
skills=(
    "fal-ai"
    "notion"
    "elevenlabs"
    "video-agent"
)

echo "Starting batch installation of Skills..."

for skill in "${skills[@]}"; do
    echo "Installing: $skill"
    npx clawhub@latest install "$skill"
    
    if [ $? -eq 0 ]; then
        echo "✅ $skill installed successfully"
    else
        echo "❌ $skill installation failed"
    fi
    echo "---"
done

echo "Batch installation complete!"
EOF

chmod +x install_skills.sh
./install_skills.sh
# Batch generate images
openclaw batch run "fal-ai" \
  --input "prompts.txt" \
  --output "images/" \
  --parallel 3

# Batch convert audio
openclaw batch run "elevenlabs" \
  --input "texts/" \
  --output "audios/" \
  --parallel 5

# Batch import to Notion
openclaw batch run "notion" \
  --input "notes/" \
  --database "db-id" \
  --parallel 2

Technique 4: Workflow Automation

# Create an automated workflow
openclaw workflow create "daily-content" \
  --trigger "schedule:09:00" \
  --steps "
    1. Generate today's topic (ask)
    2. Generate illustration (fal-ai)
    3. Generate video (video-agent)
    4. Generate voiceover (elevenlabs)
    5. Save to Notion (notion)
  "

# Enable workflow
openclaw workflow enable "daily-content"

# View workflow status
openclaw workflow status "daily-content"

Troubleshooting

Problem 1: Skills cannot be loaded

Possible causes:

  • Dependencies not installed
  • Configuration file error
  • Insufficient permissions

Solution:

# View Skill dependencies
openclaw skills info <skill-name>

# Reinstall dependencies
cd ~/.openclaw/skills/<skill-name>
npm install

# Check configuration
openclaw config validate

# Fix permissions
chmod -R 755 ~/.openclaw/skills/

Problem 2: API call timeout

Possible causes:

  • Unstable network
  • API server busy
  • Timeout setting too short

Solution:

# Increase timeout duration
openclaw config set api.timeout 60000

# Use a proxy
openclaw config set api.proxy "http://proxy:port"

# Retry mechanism
openclaw config set api.retry.enabled true
openclaw config set api.retry.max 3

Problem 3: Cost overrun

Possible causes:

  • Excessive usage frequency
  • Quality settings too high
  • No limits set

Solution:

# Set daily limit
openclaw config set cost.daily-limit 10

# Lower quality settings
openclaw config set image.quality "standard"
openclaw config set video.quality "medium"

# Enable caching
openclaw config set cache.enabled true

# View cost details
openclaw cost detail --period 1d

Chapter Summary

This chapter provided a detailed introduction to integrating OpenClaw with third-party API services, covering 4 core application scenarios:

Core Content Review

10.1 AI Image Generation Service Integration - 90%+ efficiency improvement

  • Complete bananapro-image-gen Skill installation and configuration tutorial
  • Practical cases from basic usage to batch generation
  • Prompt optimization techniques and cost control methods
  • Recommended 5 AI drawing Skills from the ClawHub marketplace

10.2 Notion Data Synchronization - 98%+ efficiency improvement

  • 3 recommended Notion integration Skills (notion, notion-mcp, notion-database)
  • Complete API configuration and permission setup process
  • Practical cases such as automatic note creation, batch import, and meeting minutes
  • Custom template and automated workflow configuration

10.3 Video Generation Service - 90%+ efficiency improvement

  • 5 recommended video generation Skills (video-agent, sora-video-gen, etc.)
  • Configuration methods for mainstream services like HeyGen, Sora, and Veo
  • Practical cases such as AI avatar videos, batch generation, and multi-language versions
  • Advanced techniques like custom avatars and video post-processing

10.4 Voice Synthesis Integration - 95%+ efficiency improvement

  • 4 recommended voice synthesis Skills (elevenlabs, azure-tts, etc.)
  • Comparison and configuration of services like ElevenLabs, Azure, and Google
  • Practical cases such as text-to-speech, audiobooks, and multi-language voiceovers
  • Advanced techniques like custom voice tones, emotional control, and batch processing

Comprehensive Efficiency Improvement

Average Efficiency Improvement: 93%+ Average Cost Savings: 95%+ Applicable Scenarios: Creation, Management, Marketing, Education

Core Value

1. Capability Expansion

✅ AI Drawing: From text to image
✅ Knowledge Management: Automated notes and databases
✅ Video Creation: From script to finished video
✅ Voice Synthesis: From text to sound

2. Efficiency Improvement

✅ Drawing: 30 minutes → 1 minute
✅ Notes: 5 minutes → 5 seconds
✅ Video: 2 hours → 10 minutes
✅ Voiceover: 1 hour → 2 minutes

3. Cost Optimization

✅ Drawing Cost: $50 → $0.1
✅ Notion: Free
✅ Video Cost: $200 → $2
✅ Voiceover Cost: $100 → $0.3

4. Quality Assurance

✅ Professional-grade output quality
✅ Multi-language support
✅ Batch processing capability
✅ Automated workflows

Practical Techniques Summary

1. Skill Selection

  • Choose appropriate Skills based on needs.
  • Prioritize mature Skills from the ClawHub marketplace.
  • Focus on balancing cost and quality.

2. Configuration Optimization

  • Correctly configure API keys and permissions.
  • Set reasonable default parameters.
  • Enable automation rules.

3. Cost Control

  • Use appropriate quality levels.
  • Enjoy discounts for batch processing.
  • Reuse generated results.

4. Quality Improvement

  • Optimize input content (prompts, scripts, text).
  • Use high-quality models.
  • Perform post-processing.

Next Steps

  1. Start Immediately: Choose a scenario and install the corresponding Skills.
  2. Practice and Verify: Test the effects with actual cases.
  3. Optimize Process: Adjust configurations based on usage.
  4. Expand Applications: Explore more integration possibilities.

Through API integration, OpenClaw evolves from an AI assistant to an all-around creative platform. By mastering these integration methods, you will gain:

  • 🎨 AI drawing capabilities
  • 📝 Automated knowledge management
  • 🎬 Video creation capabilities
  • 🎙️ Voice synthesis capabilities

Start using these powerful API integration features and let OpenClaw become your super creative assistant!


Next Chapter Preview: Chapter 11 Advanced Configuration (Multi-model Switching/Cost Optimization/Performance Tuning)

Table of Contents

10.1 AI Image Generation Service Integration
10.1.1 Service Selection
10.1.2 Install bananapro-image-gen Skill
10.1.3 Configure API
10.1.4 Basic Usage Tutorial
10.1.5 Command Line Usage (Advanced)
10.1.6 Prompt Engineering Tips
10.1.7 Practical Cases
10.1.8 Common Issues
10.1.9 Advanced Tips
10.2 Notion Data Synchronization Integration
10.2.1 Why Integrate Notion?
10.2.2 Notion Integration Solutions
10.2.3 Complete Notion API Configuration Guide
Step 1: Create a Notion Integration
Step 2: Obtain and Save the API Key
Step 3: Share Pages/Databases with the Integration
Step 4: Obtain Database ID (if operating databases)
Step 5: Test Connection
Common Troubleshooting
Security Recommendations
Complete Configuration Example
10.2.4 Configure Notion Integration
10.2.5 Basic Usage and Practical Cases
10.2.6 Advanced Tips
10.2.7 Common Issues
10.2.8 Efficiency Improvement Data
10.3 Video Generation Services
10.3.1 Why Integrate Video Services?
10.3.2 Recommended Video Generation Skills
10.3.3 Configure Video Services
10.3.4 Basic Usage
10.3.5 Practical Cases
10.3.6 Advanced Techniques
10.3.7 Frequently Asked Questions
10.3.8 Efficiency Improvement Data
10.4 Voice Synthesis Integration
10.4.1 Why Integrate Voice Services?
10.4.2 Recommended Voice Synthesis Skills
10.4.3 Supported Voice Service Comparison
10.4.4 Configuring Voice Services
10.4.5 Basic Usage
10.4.6 Practical Cases
10.4.7 Advanced Techniques
10.4.8 Frequently Asked Questions
10.4.9 Efficiency Improvement Data
📦 Complete Skills Installation Guide for This Chapter
⚠️ Important Notes
Install All API Integration Skills
Installation Suggestions by Scenario
Configuration Priority
Cost Budget Reference
Frequently Asked Questions
Best Practices
Advanced Techniques
Troubleshooting
Chapter Summary
Core Content Review
Comprehensive Efficiency Improvement
Core Value
Practical Techniques Summary
Next Steps