Python SDK and CLI for the Meshive GPU Cloud
Project description
Install
pip install meshive
Full SDK & CLI documentation: docs.meshive.ai/sdk-cli
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_URLwith the matching key. The config directory can be relocated viaMESHIVE_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 pods --all # list pods across every workspace (adds a WORKSPACE column)
meshive pod <workspace> <pod> # show a single pod
meshive machines # list your machines (as a host)
meshive machine <id> # show a single machine
# 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)
# filter machines (client-side)
meshive machines --status online # comma-separated or repeatable
meshive machines --type gpu # gpu | cpu | storage
meshive machines --name node-a # match the display name
# 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_namefor workspaces,pod_namefor pods). This is what you pass tomeshive 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--nameto 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, ...)
# host view: the machines you contribute to the network
machines = client.list_machines()
for m in machines:
print(m.machine_id, m.status, m.gpu_count, m.gpu_model)
machine = client.get_machine(machines[0].machine_id)
print(machine.earning_hourly, machine.raw) # .raw holds specs, state, podUses, ...
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 keyAuthenticationError(401),PermissionDeniedError(403),NotFoundError(404),RateLimitError(429, exposes.retry_after), andMeshiveAPIErrorfor other HTTP errors (carry.status_code,.title,.message,.raw)
License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meshive-0.0.5.tar.gz.
File metadata
- Download URL: meshive-0.0.5.tar.gz
- Upload date:
- Size: 30.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47bd115704e0490f00c56f26fc9011a785d51af1059a85d4decff85753286622
|
|
| MD5 |
667c4bcb531a67e29eb0c5c5e9a736d6
|
|
| BLAKE2b-256 |
e10ef10d9c1b83af622c6ddf1372331b8bb088ac009db2ddeda4a9b7a10061ac
|
Provenance
The following attestation bundles were made for meshive-0.0.5.tar.gz:
Publisher:
publish.yml on meshive/meshive-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshive-0.0.5.tar.gz -
Subject digest:
47bd115704e0490f00c56f26fc9011a785d51af1059a85d4decff85753286622 - Sigstore transparency entry: 2083912167
- Sigstore integration time:
-
Permalink:
meshive/meshive-python@41a10c73259ff64f4e15e31231f50bb63740083c -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/meshive
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@41a10c73259ff64f4e15e31231f50bb63740083c -
Trigger Event:
push
-
Statement type:
File details
Details for the file meshive-0.0.5-py3-none-any.whl.
File metadata
- Download URL: meshive-0.0.5-py3-none-any.whl
- Upload date:
- Size: 26.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03eba7640fcb5ab9504562bf40e882670623c325832f9500dfdd9c3c407873aa
|
|
| MD5 |
41214cbf7db3cad014e10c3b6fd0aef8
|
|
| BLAKE2b-256 |
99b86d88eba8935e177eff6e4a989b0b7c9052c481ec5673245198bb89725d39
|
Provenance
The following attestation bundles were made for meshive-0.0.5-py3-none-any.whl:
Publisher:
publish.yml on meshive/meshive-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshive-0.0.5-py3-none-any.whl -
Subject digest:
03eba7640fcb5ab9504562bf40e882670623c325832f9500dfdd9c3c407873aa - Sigstore transparency entry: 2083912191
- Sigstore integration time:
-
Permalink:
meshive/meshive-python@41a10c73259ff64f4e15e31231f50bb63740083c -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/meshive
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@41a10c73259ff64f4e15e31231f50bb63740083c -
Trigger Event:
push
-
Statement type: