Skip to main content

MUXI Python SDK

Project description

MUXI Python SDK

Official Python SDK for MUXI — infrastructure for AI agents.

Highlights

  • Sync & async clients with pooled httpx transport
  • Context managers for automatic client cleanup
  • Built-in retries, idempotency, and typed errors
  • Streaming helpers for chat/audio and deploy/log tails

Need deeper usage notes? See the User Guide for streaming, retries, and auth details.

Installation

pip install muxi-client

Quick Start (sync)

from muxi import ServerClient, FormationClient

server = ServerClient(
    url="https://server.example.com",
    key_id="<key_id>",
    secret_key="<secret_key>",
)
print(server.status())

formation = FormationClient(
    server_url="https://server.example.com",
    formation_id="<formation_id>",
    client_key="<client_key>",
    admin_key="<admin_key>",
)
print(formation.health())

Quick Start (async)

import asyncio
from muxi import AsyncServerClient, AsyncFormationClient

async def main():
    server = AsyncServerClient(
        url="https://server.example.com",
        key_id="<key_id>",
        secret_key="<secret_key>",
    )
    print(await server.status())

    formation = AsyncFormationClient(
        server_url="https://server.example.com",
        formation_id="<formation_id>",
        client_key="<client_key>",
        admin_key="<admin_key>",
    )
    async for evt in await formation.chat_stream({"message": "hi"}):
        print(evt)
        break

asyncio.run(main())

Formation base URL override

  • Default (via server proxy): server_url + /api/{formation_id}/v1
  • Direct formation: set base_url="http://localhost:9012/v1" (or use url for dev mode http://localhost:8001/v1)

Auth & headers

  • Server: HMAC with key_id/secret_key on /rpc/*.
  • Formation: X-MUXI-CLIENT-KEY or X-MUXI-ADMIN-KEY on formation API.
  • Idempotency: X-Muxi-Idempotency-Key auto-generated on every request.
  • SDK: X-Muxi-SDK, X-Muxi-Client headers set automatically.

Streaming

  • Chat/audio: POST /chat or /audiochat with stream=True; consume SSE events.
  • Deploy/log streams: methods return generators/async generators.

Errors, retries, timeouts

  • Typed errors for auth/validation/rate-limit/server/connection.
  • Default timeout 30s (streaming is unbounded); retries on 429/5xx/connection with backoff.

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

muxi-0.20260514.0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

muxi-0.20260514.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file muxi-0.20260514.0.tar.gz.

File metadata

  • Download URL: muxi-0.20260514.0.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for muxi-0.20260514.0.tar.gz
Algorithm Hash digest
SHA256 39ff2f38c0941c9bcc822419bbb6b4a7e531a834451ca39b86f09795fe7aa6a0
MD5 0b1a70354c6f96f762d42f2c3b28c847
BLAKE2b-256 bc46069ab4ae3e7f0e68f76523f6fc35f8d21e32243fba82b9f94281d70ff88c

See more details on using hashes here.

Provenance

The following attestation bundles were made for muxi-0.20260514.0.tar.gz:

Publisher: python-release.yml on muxi-ai/muxi-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file muxi-0.20260514.0-py3-none-any.whl.

File metadata

  • Download URL: muxi-0.20260514.0-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for muxi-0.20260514.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a555191a003fb4dac65ea637f25f5f1931411a4d296bfaf344970e177afbbd7
MD5 30929fcfc2d38f8da6fe74e75eef70b1
BLAKE2b-256 335db6a1a712529d1744d2533367cb9e6e270a5cfa5b666cf7c06a911635894a

See more details on using hashes here.

Provenance

The following attestation bundles were made for muxi-0.20260514.0-py3-none-any.whl:

Publisher: python-release.yml on muxi-ai/muxi-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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