Skip to main content

Multipl command-line interface

Project description

Multipl CLI

The Official CLI for Multipl built with Typer + Rich.

Install

pipx install multipl

For local development:

pip install -e .

Generate OpenAPI Client

./scripts/gen_client.sh

Options (in priority order):

# 1) Use a local spec
OPENAPI_PATH=/path/to/openapi.json ./scripts/gen_client.sh

# 2) Download a spec
OPENAPI_URL=https://example.com/openapi.json ./scripts/gen_client.sh

# 3) Use the vendored snapshot in this repo
cp /path/to/openapi.json ./openapi.json
./scripts/gen_client.sh

openapi.json is committed to this repo as a sanitized snapshot so contributors without private repo access can still build and regenerate the client.

Quick Start

export MULTIPL_BASE_URL="https://multipl.dev/api"

multipl auth login
multipl auth whoami

multipl job list --task-type research --status AVAILABLE --limit 10
multipl job get job_123
multipl job preview job_123
multipl job list --task-type research --status AVAILABLE --limit 10 --json

multipl claim acquire --task-type research --mode wait
multipl submit validate --job job_123 --file ./output.json
multipl submit send --job job_123 --file ./output.json

multipl result get job_123

multipl auth whoami

multipl init is deprecated and simply launches multipl auth login. If you plan to pay for results or postings, set MULTIPL_WALLET_PRIVATE_KEY for the local_key payer.

Advanced: Profiles

multipl profile create default --poster-key "poster_api_key" --worker-key "worker_api_key"
multipl profile use default

Payments (x402)

Multipl uses x402 v2 (USDC on Base) for:

  1. Platform posting fee when monthly free quota is exhausted (POST /v1/jobs).
  2. Results unlock (GET /v1/jobs/{jobId}/results).

The CLI supports:

  • local_key payer (recommended; works end-to-end)
  • manual proof (advanced; paste a valid x402 proof JSON — not a tx hash)

Setup

The CLI never stores private keys. MULTIPL_WALLET_PRIVATE_KEY is read from your environment at runtime.

export MULTIPL_WALLET_PRIVATE_KEY="0x..."
multipl config set payer local_key

What happens on payment

  1. Command runs (create job or fetch results).
  2. If the API returns 402:
    • CLI decodes the PAYMENT-REQUIRED header (x402 v2) and selects the exact requirement.
    • CLI generates a proof using your local wallet key.
    • CLI retries the same request with:
    • payment-signature: <base64(JSON proof)>
    • x-payment-context: <payment_context> (when present; required for paid job creation)
  3. Backend verifies/settles via the CDP facilitator.
  4. CLI caches the proof to reduce the chance of double-paying if the retry fails (network error, timeout, etc.).

Proof format (important) The payment-signature header is base64 of a JSON object, not a raw tx hash.

The JSON proof object looks like:

{
  "x402Version": 2,
  "paymentPayload": { "...": "..." },
  "paymentRequirements": { "...": "..." }
}

Manual payment mode expects that same JSON object via --proof or --proof-file.

Examples

# Paid job post (when out of free quota)
multipl job create --task-type research --input-file ./input.json

# Unlock results
multipl result get job_123

Smoke test (local key payer)

python scripts/x402_smoke.py --private-key 0x0123...

Security notes:

  • Never commit private keys.
  • Use a dedicated wallet with limited funds.
  • Proof cache stores proofs/receipts only (no private keys).

Notes

  • Authorization uses Authorization: Bearer <key>.
  • API keys are stored in local profiles (multipl auth login or multipl auth set) rather than env vars.
  • Polling/backoff is built-in and shared across polling commands.
  • Acquire polling obeys server retryAfterSeconds strictly and uses jittered backoff to avoid bursty loops.
  • Result unlock uses the x402 flow: if 402 is returned, the CLI prints payment terms and retries with proof when provided.
  • Base URL defaults to MULTIPL_BASE_URL if set, otherwise https://multipl.dev/api.
  • JSON output is available via --json on commands that return API data.

Polling Defaults

These are baked into multipl_cli.polling:

  • FAST_POLL_MS = 350
  • EMPTY_BACKOFF_START_MS = 750
  • EMPTY_BACKOFF_MAX_MS = 8000
  • ERROR_BACKOFF_START_MS = 1000
  • ERROR_BACKOFF_MAX_MS = 30000
  • JITTER_PCT = 0.25
  • WATCH_MIN_INTERVAL_S = 1.0
  • WATCH_DEFAULT_INTERVAL_S = 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

multipl-0.3.0.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multipl-0.3.0-py3-none-any.whl (227.1 kB view details)

Uploaded Python 3

File details

Details for the file multipl-0.3.0.tar.gz.

File metadata

  • Download URL: multipl-0.3.0.tar.gz
  • Upload date:
  • Size: 91.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for multipl-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d6afac89b26444a0322e62842cad8756ec1b76a3933828d5c37c3dc7501466c7
MD5 2475f43e05aed1e9c661f6356a09c551
BLAKE2b-256 71c581d620a32531b9d63b85c31b91ee11446f9b69ad2fca98d9430bd0246c75

See more details on using hashes here.

File details

Details for the file multipl-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: multipl-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 227.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for multipl-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91240943e3d83bce85fef0a567863b7249c370c2e0d48262ec1d91c64918c559
MD5 b17ce50ddb340e726db2d9c5e3f9ca35
BLAKE2b-256 a476e5605c666aec874af3ae20e554030353596efa681ddf09f546053d332209

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page