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:

IntegrationBest forTime to set upLink
Agent CanvasNo-code creation — generate images / videos / music directly in a conversationLowest/chat workspace
CLI (meitu-cli)Local batch processing, scripting, and automationMediummeitu-cli command docs
OpenAPIServer-side deep integration and calling from your own systemsHigherAPI 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:

  1. Open the workspace and click "Sign in" in the bottom-right corner to log in or register.
  2. 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.
  3. Adjust the input as needed, then send it.
  4. 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:

  1. Install

    npm install -g meitu-cli meitu

    If meitu is not found, reopen your terminal and try again (only applies to global installs).

  2. 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>"
  3. Verify credentials

    meitu auth verify --json

    A result of code: 0 or ok: true means 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
  4. 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 ./output

    Success indicator: an image file is generated in the output directory, and the JSON contains code: 0 or ok: true.

For parameter reference, run meitu <command> --help. If an async task times out, you can poll it manually with meitu 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:

  1. 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.

  2. 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.

  3. 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
  4. 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-Date and Authorization.