Tutorials
  • 3 mins read

Getting Moonshot Working in OpenClaw: The Practical Guide

whaledesk whaledesk
  • Feb 24, 2026

Comments views
magzin magzin

Getting Moonshot Working in OpenClaw: The Practical Guide

So you want to add Moonshot video and search to your OpenClaw setup? Good call. It’s powerful stuff. Here’s how to actually make it work without pulling your hair out.

Before You Start (What You’ll Need)

  • OpenClaw 2026.2.23 or newer
  • A Moonshot API key (takes 5 minutes to grab from platform.moonshot.cn)
  • Willingness to edit a JSON file

Step 1: Get Your API Key (Really Easy)

  1. Go to platform.moonshot.cn
  2. Sign up or log in
  3. Find API Keys in the dashboard
  4. Create one and copy it somewhere safe

That’s genuinely it. Moonshot doesn’t make this complicated.

Step 2: Add It To Your Config

Open ~/.openclaw/openclaw.json and add this:

{
  "providers": {
    "moonshot": {
      "apiKey": "sk-your-actual-key-here",
      "baseUrl": "https://api.moonshot.cn/v1"
    }
  },
  "agent": {
    "model": "moonshot/moonshot-v1-128k"
  }
}

Moonshot has three models you can pick from:

  • moonshot-v1-128k — Works for everything. 128K context is solid.
  • moonshot-v1-vision — Better at understanding videos and images
  • moonshot-v1-search — Optimized for web search

Start with the 128K unless you know you need something specific.

Step 3: Restart and Test

openclaw gateway --port 18789 --verbose

Or if you’re running as a daemon:

openclaw gateway --restart

Analyzing a Video (Actually Simple)

Now for the fun part. Analyze a video:

openclaw agent --message "What's happening in this video? Give me a summary." \
  --file "path/to/your/video.mp4" \
  --model moonshot/moonshot-v1-vision

OpenClaw figures out it’s Moonshot and handles the rest. You get back a summary. That’s it.

Using it from Telegram or Slack? Just send a video with a caption and the bot will analyze it.

Web Search (With Actual Citations)

This is where Moonshot shines. Search results come back with real source citations, not guesses:

openclaw agent --message "What's new in the OpenClaw ecosystem this week?" \
  --model moonshot/moonshot-v1-search --thinking high

The bot searches, finds sources, cites them. It’s weirdly satisfying.

Advanced: Different Agents, Different Models

Want your video analyzer agent to use vision-optimized models and your research agent to use search-optimized models? Easy:

{
  "agents": {
    "video-guy": {
      "model": "moonshot/moonshot-v1-vision",
      "workspace": "./workspaces/video"
    },
    "researcher": {
      "model": "moonshot/moonshot-v1-search",
      "workspace": "./workspaces/research"
    }
  }
}

Now run them independently:

openclaw agent --agent video-guy --message "Analyze this"
openclaw agent --agent researcher --message "Research that"

When Things Go Wrong (Troubleshooting)

Videos timing out? Large videos take time. Add this to your config:

{
  "providers": {
    "moonshot": {
      "timeoutMs": 60000
    }
  }
}

Missing citations in search results? Make sure your agent context is telling it to extract and show citations. Add a line to your SOUL.md or agent prompt.

Can I use it for images? Yes. moonshot-v1-vision handles images, videos, anything visual.

Pro Tips

  • Use prompt caching for repeated videos. If you analyze the same video multiple times, cache it. Saves money and time.
  • Batch your searches. Group related searches together. One API call instead of five.
  • Monitor your usage. Run openclaw status to see what you’re spending on Moonshot.

What’s Next?

  • Check out browser control to combine video analysis with web automation
  • Read about model failover to use Moonshot as a backup
  • Jump into the Discord and share what you build with it
Share:

Leave a comment

Your email address will not be published. Required fields are marked *