How to Post to TikTok with an AI Agent
By the end of this guide, you'll have an AI agent posting videos to TikTok on your behalf. No manual uploads, no copy-pasting captions, no opening the TikTok app. Just tell your agent what to post, and it handles the rest.
Whether you're building a content automation pipeline, integrating TikTok into a larger workflow, or simply want your AI assistant to handle social media, this tutorial covers everything you need. For a deeper MCP setup walkthrough, see our MCP TikTok AI agent guide.
What You'll Need
Before we start, make sure you have:
- A Postqued account — Sign up at postqued.com (free tier available)
- API key — Generate this from your Postqued dashboard
- An MCP-compatible AI agent — Claude Desktop, Cursor, or any agent supporting the Model Context Protocol
- A TikTok video — Have a video file ready for your first post
Optional but helpful:
- Your TikTok account connected to Postqued (required for actual posting)
- Basic familiarity with API concepts (we'll explain as we go)
Step 1: Get Your Postqued API Key
Your API key is how your AI agent authenticates with Postqued. It's a simple static key — no OAuth flows, no token refreshes.
- Log into your Postqued dashboard
- Navigate to Settings → API Keys
- Click Generate New Key
- Copy the key and save it somewhere secure
That's it. This single key lets your agent post to any TikTok account you've connected to your Postqued workspace.
Important: Treat this key like a password. Anyone with your API key can post to your TikTok account. Don't commit it to public repos or share it in chat logs.
Step 2: Set Up the MCP/OpenClaw Skill
Postqued provides an OpenClaw/MCP skill that lets your AI agent discover and use TikTok posting tools automatically. No custom integration code required.
For Claude Desktop
- Open Claude Desktop settings
- Add a new MCP server with this configuration:
{
"mcpServers": {
"postqued": {
"command": "npx",
"args": ["-y", "@openclaw/postqued-mcp"],
"env": {
"POSTQUED_API_KEY": "your-api-key-here"
}
}
}
}
- Restart Claude Desktop
- Ask Claude: "What tools do you have available?" — it should list Postqued functions
For Cursor
- Open Cursor settings → MCP
- Add a new server with the same configuration as above
- Cursor will automatically detect and enable the tools
For Other MCP Clients
Most MCP-compatible agents work similarly:
- Install the Postqued MCP package:
npm install -g @openclaw/postqued-mcp - Set the
POSTQUED_API_KEYenvironment variable - Configure your agent to load the MCP server
- The agent discovers available tools automatically
Step 3: Configure Your AI Agent
Once the MCP skill is connected, your agent can see the available Postqued tools. You don't need to write prompts telling it how to post — the tool descriptions handle that.
Here's what your agent now knows how to do:
- List connected accounts — See which TikTok accounts are available
- Upload videos — Post video content with captions, hashtags, and settings
- Upload photos/carousels — Post image content to TikTok
- Check post status — Verify if a post succeeded or failed
You can test this with a simple prompt:
What TikTok accounts do I have connected to Postqued?
Your agent should respond with a list of accounts and their posting permissions.
Step 4: Post Your First TikTok via AI Agent
Now for the fun part. Here's how a typical conversation with your agent looks:
You:
Post this video to my TikTok: /path/to/video.mp4
Caption: "Just automated my first TikTok post with an AI agent 🤖 #automation #ai #tiktokapi"
Make it public and allow duets and stitches.
Agent:
I'll post that video to your TikTok now.
✓ Video uploaded: video.mp4
✓ Account: @yourusername
✓ Caption: "Just automated my first TikTok post with an AI agent 🤖 #automation #ai #tiktokapi"
✓ Visibility: Public
✓ Duet: Enabled
✓ Stitch: Enabled
Post ID: ttk_1234567890
Status: Processing (usually takes 30-60 seconds)
I'll check the status in a minute to confirm it went live.
Agent (60 seconds later):
✓ Your TikTok is now live!
View it here: https://tiktok.com/@yourusername/video/1234567890
That's it. You described what you wanted, and the agent handled the API calls, file uploads, and confirmation.
Using the API Directly (Optional)
If you prefer to make API calls yourself or integrate into a backend service, here's the equivalent HTTP request:
curl -X POST https://api.postqued.com/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "video=@/path/to/video.mp4" \
-F "caption=Just automated my first TikTok post with an AI agent 🤖" \
-F "privacy_level=public" \
-F "allow_duet=true" \
-F "allow_stitch=true"
Response:
{
"success": true,
"post_id": "ttk_1234567890",
"status": "processing",
"tiktok_url": "https://tiktok.com/@username/video/1234567890"
}
The MCP skill essentially wraps these API calls into natural language interactions. Use whichever approach fits your workflow.
Common Errors & Troubleshooting
"No TikTok accounts found"
Fix: Connect your TikTok account in the Postqued dashboard first. Go to Accounts → Add Account → TikTok and complete the OAuth flow.
"API key invalid"
Fix: Double-check your API key in the environment variable. Regenerate it from the dashboard if needed.
"Video upload failed"
Common causes:
- File too large (max 1GB)
- Unsupported format (use MP4 or MOV)
- Video shorter than 3 seconds or longer than 10 minutes
- Poor internet connection during upload
"Post stuck in processing"
What's happening: TikTok is reviewing the video. This is normal for new accounts or certain content types. Fix: Wait 5-10 minutes. The agent can check status automatically. If still stuck, verify the video meets TikTok's community guidelines.
Agent can't see Postqued tools
Fix: Restart your MCP client. Verify the API key is set correctly in the environment. Check that the package installed: npx @openclaw/postqued-mcp --help
Next Steps
Now that your AI agent can post to TikTok, here are some ways to extend this:
Automated Content Pipelines
- Generate videos with AI, then auto-post them
- Pull content from RSS feeds or APIs and queue for TikTok
- Schedule posts based on optimal engagement times
Multi-Agent Workflows
- One agent creates content, another posts it
- Review agents that check posts before publishing
- Analytics agents that report on post performance
Integration Ideas
- Post to TikTok when you publish a new blog post
- Cross-post from other platforms automatically
- Build a content calendar that your agent manages
Read More
- Postqued API Documentation
- OpenClaw/MCP Integration Guide
- Schedule TikTok Posts via API
- 10 AI Agent TikTok Use Cases
- Best Social Media APIs for AI Agents
Ready to automate your TikTok workflow? Get your API key and start building.