Getting Started
MeituHub is Meitu's AI imaging platform. It offers three ways to integrate, so you can pick the one that best fits your role and use case:
| Integration | Best for | Time to set up | Link |
|---|---|---|---|
| Agent Canvas | No-code creation — generate images / videos / music directly in a conversation | Lowest | /chat workspace |
| CLI (meitu-cli) | Local batch processing, scripting, and automation | Medium | meitu-cli command docs |
| OpenAPI | Server-side deep integration and calling from your own systems | Higher | API integration guide |
Just want to try the effect quickly? Use the Agent Canvas. Need local batch output? Use the CLI. Want to embed imaging capabilities into your own system? Use the OpenAPI.
Option 1: Agent Canvas (no-code, fastest to start)
No code required. Sign in and describe what you need directly in the conversation — the Agent handles image generation and video creation for you.
Link: https://meituhub.cn/zh-cn/chat
Getting started:
- Open the workspace and click "Sign in" in the bottom-right corner to log in or register.
- Ask a question directly in the input box — for example, "What can you do?" — or click one of the industry template cards at the top (Gaming / E-commerce / Education / Marketing & Design) to auto-fill a task description.
- Adjust the input as needed, then send it.
- Wait for the task to finish and view the result. You can upload attachments and stop generation at any time.
No need to understand parameters or models, and no API key required — great for validating a creative idea quickly.
Option 2: CLI (meitu-cli)
For local batch processing and script automation. Install it and call platform capabilities from the command line. See the meitu-cli command docs for the full command list.
Getting started:
-
Install
npm install -g meitu-cli meituIf
meituis not found, reopen your terminal and try again (only applies to global installs). -
Configure credentials
Sign in to MeituHub and copy your Access Key and Secret Key from the site.
Local config (recommended):
meitu config set-ak --value <ACCESS_KEY> meitu config set-sk --value <SECRET_KEY>With
npx:npx -y meitu-cli config set-ak --value <ACCESS_KEY> npx -y meitu-cli config set-sk --value <SECRET_KEY>Or use environment variables (take priority over the local file; useful for CI / agent):
export MEITU_OPENAPI_ACCESS_KEY="<ACCESS_KEY>" export MEITU_OPENAPI_SECRET_KEY="<SECRET_KEY>" -
Verify credentials
meitu auth verify --jsonA result of
code: 0orok: truemeans the credentials are valid. If it fails, check that the Keys were copied in full and contain no leading or trailing spaces.We also recommend syncing the command metadata on first use:
meitu tools update -
Run your first command
Create an output directory and generate an image:
mkdir -p ./output meitu text-to-image \ --prompt "a simple illustration of an orange cat" \ --size 2K \ --json \ --download-dir ./outputSuccess indicator: an image file is generated in the
outputdirectory, and the JSON containscode: 0orok: true.
For parameter reference, run
meitu <command> --help. If an async task times out, you can poll it manually withmeitu task wait <task_id> --timeout-ms 600000 --json(use a larger timeout for video tasks).
Option 3: OpenAPI (server-side integration)
For developers who need to deeply integrate imaging capabilities into their own systems. Access is based on Access Key (AK) + Secret Key (SK) with SDK-HMAC-SHA256 signing. See the API AK/SK signing guide for details.
Getting started:
-
Get credentials
Sign in to MeituHub and obtain your AK and SK. The SK must be stored only on the server — never in client-side code.
-
Choose an SDK
Multi-language signing SDKs are available: Python, Java, Go, JavaScript, PHP, C#, Kotlin, Swift, Bash/Shell, and more. See the Python signing SDK guide for an example.
-
Make your first request
Build a signed request (the HTTP method, URL, query parameters, headers, and body all participate in SHA-256 signing). Example endpoint:
POST https://openapi.meitu.com/api/v1/sdk/sync/push -
Handle the result
Sync tasks return the result directly; for async tasks, poll the task status via
GET /api/v1/sdk/status?task_id=<task_id>.
Note: Use AK/SK authentication when the body does not exceed 12 MB; for larger bodies, switch to Token authentication per the corresponding capability API docs. After signing, you must not modify the URL, query parameters, headers, or body again; each request needs a fresh
X-Sdk-DateandAuthorization.