Loading...
Loading...
Delegate complex autonomous tasks to Manus AI - an AI agent for deep research, web browsing, code execution, report generation, and multi-step workflows.
npx skill4agent add hqman/my-skills manus# Create a task
curl -X POST "https://api.manus.ai/v1/tasks" \
-H "API_KEY: $MANUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Your task description",
"agentProfile": "manus-1.6"
}'
# Poll for results (repeat until status != "running")
curl -s "https://api.manus.ai/v1/tasks/{task_id}" \
-H "API_KEY: $MANUS_API_KEY"Create Task → Get task_id → Poll Status → Extract Results → Donetask_idstatus"running"output[].content[].texthttps://api.manus.ai/v1API_KEY: $MANUS_API_KEY (header)POST /v1/tasks
Content-Type: application/json
API_KEY: $MANUS_API_KEY
{
"prompt": "Your task description",
"agentProfile": "manus-1.6", # manus-1.6-lite | manus-1.6 | manus-1.6-max
"taskMode": "agent", # agent | chat | adaptive (optional)
"projectId": "proj_xxx", # optional - use project context
"connectors": ["uuid1"], # optional - gmail, calendar, notion
"attachments": [], # optional - files, URLs, file_ids
"hideInTaskList": false, # optional - hide from task list
"createShareableLink": false, # optional - public accessibility
"taskId": "existing_task_id", # optional - continue multi-turn conversation
"locale": "en-US", # optional - user locale (e.g. "en-US", "zh-CN")
"interactiveMode": false # optional - enable follow-up questions
}{
"task_id": "TeBim6FDQf9peS52xHtAyh",
"task_title": "Generated Title",
"task_url": "https://manus.im/app/TeBim6FDQf9peS52xHtAyh",
"share_url": "https://manus.im/share/xxx"
}GET /v1/tasks/{task_id}
API_KEY: $MANUS_API_KEY{
"id": "task_id",
"status": "running", # running | completed | failed | stopped
"model": "manus-1.6-adaptive",
"metadata": {
"task_title": "Task Title",
"task_url": "https://manus.im/app/xxx"
},
"output": [
{
"role": "assistant",
"status": "completed",
"content": [
{"type": "output_text", "text": "The result text..."}
]
}
],
"credit_usage": 42
}GET /v1/tasks
API_KEY: $MANUS_API_KEYDELETE /v1/tasks/{task_id}
API_KEY: $MANUS_API_KEYPOST /v1/projects
API_KEY: $MANUS_API_KEY
{
"name": "Project Name",
"instruction": "Default instruction for all tasks in this project"
}GET /v1/projects
API_KEY: $MANUS_API_KEYPOST /v1/files/upload
API_KEY: $MANUS_API_KEY
Content-Type: multipart/form-data
file: <binary file data>file_idPOST /v1/webhooks
API_KEY: $MANUS_API_KEY
{
"url": "https://your-server.com/webhook"
}task_createdtask_progresstask_stoppedstop_reason| Profile | Best For | Speed |
|---|---|---|
| Quick lookups, fact checks | Fast |
| Most research tasks (balanced) | Medium |
| Complex analysis, multi-source deep dives | Slow (~complex) |
curl -X POST "https://api.manus.ai/v1/tasks" \
-H "API_KEY: $MANUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Analyze Bitcoin price trends this week",
"agentProfile": "manus-1.6"
}'curl -X POST "https://api.manus.ai/v1/tasks" \
-H "API_KEY: $MANUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Deep analysis of AI market 2024-2026: market size, top 10 players, M&A trends, funding landscape",
"agentProfile": "manus-1.6-max",
"locale": "en-US"
}'curl -X POST "https://api.manus.ai/v1/tasks" \
-H "API_KEY: $MANUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Analyze this financial report and create a summary",
"attachments": [
{"type": "url", "url": "https://example.com/report.pdf"},
{"type": "file_id", "file_id": "file_xxx"},
{"type": "base64", "data": "base64....", "mimeType": "text/csv", "fileName": "data.csv"}
],
"agentProfile": "manus-1.6"
}'curl -X POST "https://api.manus.ai/v1/tasks" \
-H "API_KEY: $MANUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Based on your previous analysis, what are the investment implications?",
"taskId": "abc123",
"interactiveMode": true
}'curl -X POST "https://api.manus.ai/v1/tasks" \
-H "API_KEY: $MANUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Analyze our Q1 competitor landscape",
"projectId": "proj_xxx",
"agentProfile": "manus-1.6"
}'curl -X POST "https://api.manus.ai/v1/tasks" \
-H "API_KEY: $MANUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Check my calendar for the next 3 months and suggest the best time for a team offsite",
"connectors": ["google-calendar-uuid"],
"agentProfile": "manus-1.6"
}'| Template | Description |
|---|---|
| Competitive analysis, market sizing |
| Professional presentations (PPT/PDF) |
| AI-generated videos |
| Full website generation |
| Professional resumes |
| Business SWOT analysis |
| Browser extension development |
| Travel itineraries |
| YouTube creator discovery |
| Claim verification |
| Document translation |
| Room/space design |
| Custom workout plans |
| Proof of concept prototypes |
| Research profiles on people/companies |
| Reddit sentiment analysis |
| YouTube viral content analysis |
| Business model canvas |
Task: [Clear objective]
Scope: [Research scope/timeframe]
Sources: [Prefer specific sources if known]
Output Format: [Structured report, bullet points, CSV, etc.]{
"prompt": "Analyze competitors to ChatGPT in the enterprise AI space (2024-2026).
Scope: Market share, pricing, key features, customer segments.
Sources: G2, Gartner, official docs, recent news.
Output: Structured comparison table + strategic positioning analysis.",
"agentProfile": "manus-1.6-max",
"locale": "en-US"
}locale: "zh-CN""en-US"credit_usageimport requests
import time
import json
API_KEY = "your-manus-api-key"
BASE_URL = "https://api.manus.ai/v1"
# 1. Create task
response = requests.post(
f"{BASE_URL}/tasks",
headers={"API_KEY": API_KEY, "Content-Type": "application/json"},
json={
"prompt": "Your task description",
"agentProfile": "manus-1.6"
}
)
task_id = response.json()["task_id"]
print(f"Task created: {task_id}")
# 2. Poll for completion
max_retries = 120 # 10 minutes with 5s interval
retry = 0
while retry < max_retries:
result = requests.get(
f"{BASE_URL}/tasks/{task_id}",
headers={"API_KEY": API_KEY}
).json()
status = result.get("status")
print(f"Status: {status}")
if status == "completed":
# 3. Extract results
outputs = result.get("output", [])
for output in outputs:
if output.get("role") == "assistant":
for content in output.get("content", []):
if content.get("type") == "output_text":
print("\n=== RESULT ===")
print(content["text"])
break
elif status in ["failed", "stopped"]:
print(f"Task {status}")
break
time.sleep(5)
retry += 1
if retry == max_retries:
print("Timeout: Task took too long")from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def handle_webhook():
event = request.json
event_type = event.get('event_type')
if event_type == 'task_created':
print(f"✅ Task started: {event['task_detail']['task_id']}")
elif event_type == 'task_progress':
print(f"⏳ Progress: {event['progress_detail']['message']}")
elif event_type == 'task_stopped':
detail = event['task_detail']
if detail['stop_reason'] == 'finish':
print(f"✓ Completed: {detail['message']}")
for att in detail.get('attachments', []):
print(f" 📎 {att['file_name']} ({att['size_bytes']} bytes)")
print(f" URL: {att['url']}")
else:
print(f"❓ Needs input: {detail['message']}")
return jsonify({"status": "ok"})
if __name__ == '__main__':
app.run(port=8080)curl -X POST "https://api.manus.ai/v1/webhooks" \
-H "API_KEY: $MANUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-server.com/webhook"
}'| Code | Message | Fix |
|---|---|---|
| 8 | Credit limit exceeded | Add credits at manus.im |
| 401 | Unauthorized | Check API_KEY in header |
| 400 | Bad request | Validate JSON payload, check agentProfile |
| 404 | Task not found | Verify task_id is correct |
| 429 | Rate limited | Wait before retrying |
| 500 | Server error | Retry after a few seconds |