Skip to main content

Python SDK and CLI for the Meshive GPU Cloud

Project description

Install

pip install meshive

ㅇ## Authentication

The SDK and CLI authenticate with a Meshive API Key (READ scope). Issue one from the console.

The easiest way is meshive login — it verifies the key and stores it (file mode 0600) under ~/.meshive/credentials.json, so later commands need no flags or env vars:

meshive login                 # prompts for the key (hidden input)
meshive me                    # now works with no --api-key
meshive logout                # removes the saved credentials

Alternatively, provide the key explicitly. Resolution order is --api-key flag › MESHIVE_API_KEY env › meshive login file:

export MESHIVE_API_KEY=meshive_xxxxxxxx
# or per-command: meshive me --api-key meshive_xxxxxxxx

By default requests go to the production API. To target the dev endpoint, override the base URL (same precedence: flag › env › login file › prod default) — no code change needed:

export MESHIVE_BASE_URL=https://api.dev.meshive.ai
# or remember it at login time:
meshive login --base-url https://api.dev.meshive.ai

The dev endpoint needs a dev-issued key — pair --base-url/MESHIVE_BASE_URL with the matching key. The config directory can be relocated via MESHIVE_CONFIG_DIR.

CLI

meshive --version
meshive me                     # current API key's owner
meshive workspaces             # list workspaces
meshive pods <workspace>       # list pods in a workspace
meshive pod <workspace> <pod>  # show a single pod

# filter pods (client-side; the API itself returns the full list)
meshive pods <workspace-id> --status running
meshive pods <workspace-id> --status running,error   # comma-separated or repeatable
meshive pods <workspace-id> --rental spot
meshive pods <workspace-id> --name llama              # match the display name (alias)

# any command accepts --json for raw output, plus --api-key / --base-url overrides
meshive pods <workspace-id> --json

IDs vs names

List output shows two columns:

  • ID — the canonical identifier (namespace_name for workspaces, pod_name for pods). This is what you pass to meshive pods <id> / meshive pod <id> <id>. It is unique and stable.
  • NAME — the display alias you set (workspace_name / user_alias). It is a label, not a key: it is not guaranteed unique and can change. Use --name to filter by it, but address resources by their ID.

SDK

from meshive import Meshive

with Meshive() as client:               # reads MESHIVE_API_KEY / MESHIVE_BASE_URL
    me = client.me()
    print(me.email, me.user_role)

    for ws in client.list_workspaces():
        print(ws.namespace_name, ws.status)

    pods = client.list_pods("my-workspace")
    pod = client.get_pod(pods[0].pod_name, "my-workspace")
    print(pod.status, pod.raw)           # .raw holds the full payload (machine, template, ...)

Credentials can also be passed explicitly: Meshive(api_key="meshive_...", base_url="https://api.dev.meshive.ai").

Async

from meshive import AsyncMeshive

async with AsyncMeshive() as client:
    me = await client.me()
    pods = await client.list_pods("my-workspace")

Errors

All errors subclass meshive.MeshiveError:

  • ConfigurationError — missing API key
  • AuthenticationError (401), PermissionDeniedError (403), NotFoundError (404), RateLimitError (429, exposes .retry_after), and MeshiveAPIError for other HTTP errors (carry .status_code, .title, .message, .raw)

License

Apache License 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

meshive-0.0.2.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

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

meshive-0.0.2-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file meshive-0.0.2.tar.gz.

File metadata

  • Download URL: meshive-0.0.2.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for meshive-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fee6d6159aa1752e124906d552231be9c90704d8baa36a47e0d4a8feb04ac034
MD5 e83972547cc952fdb1250c604edb2ad8
BLAKE2b-256 2383b5d9741fbdf52551bf8c4a898280665bcbd757c8a6101c5c2bb7811e14e9

See more details on using hashes here.

File details

Details for the file meshive-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: meshive-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for meshive-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ec3b088edb820d16755e404590d3086e004149ae14bec9d2554814c15abc7416
MD5 055f9874435129144d1cf19ffe8b36d2
BLAKE2b-256 f1371437f0c891cf284c59df88d21e270acfb10ba8885bef0e048c5b0f3e3883

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