Skip to content

Repository files navigation

🤖 manusIM-proxy

A lightweight OpenAI-compatible bridge for the Manus IM agent.

License: MIT Python 3.11+ FastAPI Docker GitHub stars

English中文日本語EspañolFrançais


Manus IM Proxy Demo

manusIM-proxy is a high-performance HTTP bridge that translates OpenAI-style chat completion requests into Manus v2 API operations. It seamlessly converts Manus task events into standard OpenAI JSON or Server-Sent Events (SSE), enabling you to use Manus with your favorite AI tools like 9router, OpenCode, Claude Code, or any OpenAI-compatible SDK.

Important

This project uses the official Manus API. Keep your API keys secure, follow Manus usage terms, and never expose this service to the public internet without proper authentication.


✨ Features

  • OpenAI Compatibility: Drop-in replacement for OpenAI endpoints (/v1/chat/completions, /v1/models).
  • Streaming Support: Real-time task event streaming via SSE.
  • Token Pooling: Intelligent round-robin token leasing with failover and cooldown mechanisms.
  • Agent Registry: Automatically discovers and maps Manus agents to OpenAI models.
  • Container Ready: Optimized Docker and Docker Compose support for easy deployment.

📸 Preview

Terminal Screenshot

🚀 Quick Start

Local Installation

  1. Clone and Setup

    git clone https://github.com/0xgetz/manusIM-proxy.git
    cd manusIM-proxy
    python3 -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
  2. Configure Environment

    cp .env.example .env
    # Add your Manus API keys to AUTH_TOKENS in .env
  3. Launch

    python -m app.main

Using Docker

docker compose up -d --build

⚙️ Configuration

Variable Description Default
AUTH_TOKENS Comma-separated Manus API keys Required
PORT Service listening port 3457
MANUS_API_BASE Upstream Manus API URL https://api.manus.ai
REGISTRY_REFRESH Interval to refresh agent list (e.g., 6h) 6h
SESSION_TIMEOUT Max polling time for a task (e.g., 30m) 30m
TASK_ROTATION Max reuse time for a created task 10m
DEFAULT_TASK_ID Pin agent-default-main_task to a specific ID Optional

🛠️ Usage

Python SDK Example

from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:3457/v1",
    api_key="proxy-key" # Any string works
)

response = client.chat.completions.create(
    model="agent-default-main_task",
    messages=[{"role": "user", "content": "Hello Manus!"}]
)
print(response.choices[0].message.content)

cURL Example

curl http://localhost:3457/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "manus-1.6",
    "messages": [{"role": "user", "content": "Explain the task lifecycle."}],
    "stream": true
  }'

🔌 Integration with 9router

  1. Go to ProvidersCustom ProvidersAdd OpenAI Compatible.
  2. Base URL: http://127.0.0.1:3457/v1
  3. Model: agent-default-main_task
  4. Click Create and start using Manus through the 9router gateway!

🧪 Testing

Run the local test suite to verify functionality:

python3 test_pool.py
python3 test_endpoints.py

📚 References


📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

OpenAI-compatible proxy bridge for Manus IM, featuring multi-token pool, round-robin load balancing, and streaming support.

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages