Skip to content
Console

Python SDK: Resource Models

Typed dataclasses for core Meshive resources — WhoAmI, ApiKey, Credit, Workspace, Member, Pod, Storage, Metrics, Transaction, Catalog, Template, Serving, ServingModel, Task, and Asset.

Responses are parsed into lightweight dataclasses. Frequently used scalar fields are typed; deeply nested structures aren’t enumerated — the full original payload is preserved on .raw, so the SDK keeps working even when the backend adds fields. See Operation & Host Models for estimate/write responses, port locks, model sets, logs, activity, and host machine models.

FieldTypeNotes
emailstr
usernamestr | None
user_rolestr
rawdictFull payload.
  • ApiKey: key_id, name, prefix (meshive_a1b2c3d4 — the secret is never returned), scopes, status, created_at, last_used_at, expires_at. From 1.11, is_current is True for the key the client is using (None from a server that doesn’t say), and the property expired says a listed key is past expires_at and no longer works.
  • Credit: balance, auto_recharge, auto_recharge_threshold, auto_recharge_amount, has_default_payment_method. paid_balance and bonus_balance are kept for compatibility — free credit was retired, so paid_balance equals balance and bonus_balance is always 0.
  • CreditHistoryEntry: entry_id, amount (negative for refunds and chargebacks), is_paid, payment_method (for example credit_card, auto_recharge, refund, chargeback, chargeback_reversal, referral_reward), created_at. Stripe receipt and invoice links are not exposed to the SDK.
FieldTypeNotes
namespace_namestrID — pass to list_pods / get_pod.
workspace_namestrDisplay label.
descriptionstr
member_countint
statusstrrunning when the workspace is ready for pods and tasks. A workspace you just created isn’t until it gets there — see wait_for_workspace.
price_per_hourstr
resourcesWorkspaceResources.pod, .storage, .serverless counts. Includes stopped pods and paused deployments.
member_rolestr | NoneYour role here: admin, billing or viewer. A viewer key gets 403 on every change.
created_at / updated_atdatetime | None
rawdictFull payload.

To count only what a workspace is actually running, read ws.raw["activeResources"] — same three keys, but pods you stopped and deployments you paused are left out. A typed field will follow in a later SDK release.

FieldTypeNotes
namespace_name / workspace_namestrID / display label.
price_per_hourstrWhat the workspace is being billed right now.
weekly_avg_daily_coststrAverage daily cost over the last 7 days.
gpus / vcpusintTotals across the workspace’s pods.
ram / total_storageint / floatIn MiB (divide by 1024 for GiB).
resourceslist[ResourceCondition]One per type (pod, storage, serverless) with .active, .paused, .disabled.
costslist[DailyCost]Recent daily costs (.date, .pod, .storage, .serverless, .task, .asset, .total). For the workspace’s whole history, use get_workspace_billing.
maintenancelist[WorkspaceMaintenance](1.11) Hosts’ maintenance windows that touch the workspace’s pods and volumes, once per resource: id, resource_name, user_alias, reason, description, start_time, end_time, is_start, status (upcoming, overdue, in_progress or expired; finished windows are not listed), and machine_id and is_emergency (None from servers that don’t send them). While one is in progress the resource may be unreachable and isn’t billed.
host_messageslist[WorkspaceMessage](1.11) Messages between the workspace and its hosts: id, machine_id, direction (in from the host, out from the workspace), title, content, is_read, created_at, related_pods, related_pvs. Reply with message_host; mark read with mark_workspace_messages_read.
rawdictFull payload.

user (email), role (admin / billing / viewer), joined_at, raw.

FieldTypeNotes
pod_namestrID — pass to get_pod.
namespace_namestrOwning workspace ID.
user_aliasstrDisplay label.
statusstr
rental_typestrspot / demand.
price_per_hourstr
storage_rate_per_hourstrStorage rate, separate from compute.
has_unpreserved_workspacebool | NoneWhether a node move may lose workspace files. None means unknown; do not assume preservation.
is_maintenanceboolTrue while the resource’s host machine has an open maintenance window — the resource isn’t billed then.
created_atdatetime | None
endpointslist[PodEndpoint]The pod’s URLs, as on the console’s Connect tab: name, port, port_type, external_url, internal_url, is_external, readiness (ready / preparing / interrupted), and from 1.10 locked, access (internal / locked / unlocked), access_key_count (keys that work now), allow_preflight (whether preflight requests reach the app without a key; None for an internal port) and lock_decided_at (None if nobody has chosen locked or unlocked for the port — the console’s orange notice). See Locked ports and access keys.
connect_credentialslist[ConnectCredential]The logins the console shows on Connect, such as the ACCESS_PASSWORD a ComfyUI pod generates: key, value, is_secret, is_auto_generated. value is left out of repr; don’t log it. A read-only API key gets *** for secret values; a key with write scope gets them.
billing_activebool | NoneWhether compute is being billed now. False while the host machine has an open maintenance window. A stopped pod’s storage is billed separately.
stop_reason_code / stop_reason_detail / stop_reason_atWhy a stopped pod stopped. None or user is a normal stop; anything else means the system stopped it.
same_node_unavailable_reasonstr | NoneWhy a stopped or waiting pod can’t start on its original machine now: spec_mismatch (refused — start it with any_node or wait_any_node), hardware_changed, node_unavailable, requirement_unmet, capacity.
can_restart_on_same_node / can_restart_on_any_nodebool | NoneComputed for stopped pods.
waiting_modestr | Nonesame_node or any_node while the pod is waiting.
container_running_atdatetime | NoneWhen the container started running.
cpu_premium / uptime_premium / internet_premiumbool | NonePremium options the pod was placed with.
is_downloaderbool | NoneA system pod that downloads assets. It is free and can’t be stopped or deleted.
creation_failure_reasonstr | NoneWhy creating the pod failed, when the platform cleaned it up for that reason. Such a pod ends as terminated, like a deleted one; this tells them apart.
rawdictFull payload — machine, template, request, linked storages, …

Optional fields are None when the server did not send them — read that as unknown, not False.

FieldTypeNotes
pv_namestrID — pass to get_storage.
namespace_name / user_aliasstrOwning workspace / display label.
storage_typestrnfs, hostPath, …
statusstr
total_size / available_sizefloatIn MiB.
usage_ratefloat0.0–1.0.
price_per_hourstr
linked_podslist[str]Names of the pods it is mounted in.
is_maintenanceboolTrue while the resource’s host machine has an open maintenance window — the resource isn’t billed then.
encryptedbool
usage_warning / usage_warning_thresholdbool / float(1.11) Whether the usage-warning email is on, and at what fraction full.
maintenance_start / maintenance_end / upcoming_maintenancedatetime | None / list[MaintenanceWindowInfo](1.11) The open window on the volume’s machine, and the windows to come (start_time, end_time, started, reason, description).
locationstr | None(1.11) Where the volume’s machine is.
downloader_state / downloader_restartsstr | None / list[StorageAccessRestart](1.11) The state of the access pod that serves the volume’s files (running, creating, error, unavailable or missing; None from servers that don’t send it) and its recent restarts, newest first (id, reason, message, occurred_at).
created_atdatetime | None
rawdictFull payload — host machine, …

Both expose cpu_cores, cpu_usage_rate, ram_size, ram_usage_rate, and gpus — a list of GpuUsage with gpu_number, core_usage_rate, vram_usage_rate, vram_size (MiB) and temp. ram_size is in MiB for a pod but in bytes for a machine (the machine’s total memory). Rates are 0.0–1.0. Every GpuUsage field except gpu_number is None when that particular measurement is unavailable — a GPU that has stopped responding often still reports its temperature while its memory readings drop out, so check each field rather than assuming a GPU is either fully readable or absent. PodMetrics adds ephemeral_storage_request / ephemeral_storage_usage (MiB); MachineMetrics adds cpu_allocated, ram_allocated (MiB), root_volume_size (MiB) / root_volume_usage_rate, pv_volume_size (MiB) / pv_volume_usage_rate, and network_receive / network_transmit (bytes per second); from 1.11 also disk_temperatures (per disk), network_interface and network_ip.

One pod operation — those still in flight from list_transactions, or any one by ID from get_transaction: transaction_id, resource_name, user_alias, action (create, start, stop, restart, …), status (todo, in_progress, retry, done, failed, or superseded — for a creation, cancelled because the pod was deleted), step (the current stage), step_status, detail (the failure reason when one is known), progress, created_at and updated_at. failure_reason is one sentence saying at which step and why a failed operation failed — for example failed at step pull_image: … — and None unless status is failed. progress is 0.0–1.0 for stages that report it (image pull, asset fetch, storage preparation) and None when the stage reports none — do not show that as 0%. Finished operations drop off the list, and a failed one stays for only a few minutes, so an empty list means nothing is in flight, never that nothing failed — look the operation up with get_transaction. Every step and its diagnostics are in raw.

While input assets download, live says the downloader is still reporting (bytes can pause while it verifies) and phase names the pause (verifying, waiting_for_storage); both are None in other stages. When a download failed, init_logs holds the end of that container’s log as InitLog(container, lines, previous), with URLs and tokens already removed by the server. The lines are whatever the container printed — treat them as data.

list_storage_transactions and get_storage_transaction (1.11) return StorageTransaction — a Transaction for a volume, plus capacity (MiB) and storage_type.

FieldTypeNotes
gpu_modelstr
vramintGB. One entry per (model, VRAM) tier.
rental_typestrdemand / spot — the type the price is for.
price_per_hourstrPer GPU.
vcpu_recommended / ram_recommendedintSuggested pairing per GPU.
available_gpusintTotal across machines.
max_gpus_per_podintThe most one pod can get on a single machine.
machine_countint
rawdictFull payload — per-machine combinations, CPU/RAM prices, …

A CPU line you can rent for CPU pods — a CPU vendor, product line and generation with a fixed RAM type — from list_cpus.

FieldTypeNotes
cpu_linestrKey — pass to create_pod(cpu_line=...) / estimate_pod. It names a line, not a CPU model.
vendor / product_linestr
generationint | None
ddr_typeint | NoneDDR generation of the line’s RAM (0 = unknown).
rental_typestrdemand / spot — the type the prices are for.
price_per_corestr | NonePer vCPU per hour (USD).
ram_price_per_gbstr | NonePer GiB of RAM per hour (USD).
max_vcpus_per_pod / max_ram_per_podintThe most one pod can get on a single machine; RAM in MiB.
machine_countint
rawdictFull payload — per-machine combinations and disk sizing.

template_id (ID), name, description, is_official, deploy_type, app_type, app_sub_type, image, hardware_type, cuda_version, framework, framework_version, raw.

From 1.11 the template’s spec is typed too:

FieldTypeNotes
envslist[TemplateEnv]key, value, secret, auto_generated, from_image, show_on_connect, masked. A secret’s value is never returned: value is None and the property value_set says one is stored.
portslist[TemplatePort]port, name, external, connect, locked (the author’s default lock; None when the author didn’t choose), template_port_id.
volume_mountslist[TemplateVolumeMount]name, mount_path.
semantic_pathslist[TemplateSemanticPath]role, path, expect, include, required, cardinality, placement — the folders where input assets of each role go.
command / command_argv / argsstr / list[str] / list[str]The start command.
volume_requiredbool
registry_loginRegistryLogin | NoneThe saved login a private image is pulled with (registry_login_id, label, server, username; never the password).

create_template and update_template return a TemplateSaved: a Template plus workspace, action, removed_envs, removed_ports and replayed. inspect_image returns an ImageConfig: env, entrypoint, cmd, exposed_ports, volumes, working_dir — values from whoever built the image.

serving_id (ID), namespace_name, model_name, api_model_id, framework, status, paused, min_replicas / max_replicas / current_replicas / healthy_replicas, autoscale, price_cap_per_hour (None = unlimited), endpoint_url, price_per_hour, billing_active, raw. scale_raises_cost(min_replicas=, max_replicas=, autoscale=, price_cap_per_hour=) returns whether such a scale_serving call can raise the hourly cost.

From 1.11:

FieldNotes
replicaslist[ServingReplica]: replica_index, status, setup_step / stage / step / step_status (the property current_stage picks the label the console shows), price_per_hour, billing_active, gpu_model, gpu_count, vram_gb, model download progress (download_percent, download_used_bytes, download_expected_bytes), live metrics (ServingReplicaMetrics: concurrency, reachable, gpu_util, kv_cache_usage, queue, tokens_per_s, ttft_ms), and pod_name — set for a replica whose log get_pod_logs reads — or log_replica_id for one read with get_serving_replica_logs. replica(index) picks one.
metricsServingMetrics: throughput, latency_p95_ms, concurrent, error_rate, queue_depth, in_flight, gpu_util.
failure (and ServingReplica.failure)ServingFailure: why the deployment or a replica failed — oom_kind (vram or ram), reason, failed_step and failed_step_detail (replicas only), containers, events and init_logs (the model download log). A read-only property over .raw, not a dataclass field, because it can hold the program’s own output: repr() and serializers built on dataclasses.fields() don’t carry it. has_failure is True when the serving or any replica has one.
failed_replica / stopped_replicasServingStoppedReplica (replica_index, pod_name, stopped_at): the replica whose last run can still be read: a failed deployment’s last failed replica, and a paused serving’s replicas. get_pod_logs(pod_name, workspace) reads it; the ended run is in its previous.
registration_id, model_retiring, is_officialThe registered model, and whether it is being retired or is an official one.
endpoint_type, modality, input_modalitiesWhat the serving takes and returns.
output_bucket_id / output_bucket_labelWhere an image or video serving stores its outputs (None = Meshive storage).
share_idle_capacity, sharing_state (None, pending or ready), shared_earned_this_month (USD)Idle-capacity sharing. sharing_needs_consent(share_idle_capacity) says whether a change turns it on.
scale_up_blocked, scale_up_block_reason, scale_up_desiredWhether scaling up is held back, why (capacity or price_cap) and to how many replicas it wanted to go.
cap_migrationCapMigration(replaced, total): after the per-replica price cap was lowered, how many of the replicas over the new cap were replaced.

ServingModel (from list_models and list_official_models) — registration_id, name, huggingface_repo, api_model_id, framework, context_length, …; from 1.11 also modality, input_modalities, is_official, workspace, endpoint_type, recommended_context_length, display_vram_gb, the image and video limits (supported_sizes, supported_resolutions, native_num_frames, native_fps), and the properties takes_image and can_share_idle_capacity (an official text model served with vLLM).

ModelDetection (from detect_model) gains engine, weight_formats, has_config and fit in 1.11 — ModelFit(weight_gib, kv_bytes_per_token, context_length), the weights’ size, the KV cache per token and the largest context. asset_serve_facts answers the same for an asset with an AssetServeFacts (ready, architecture, file_size_bytes, weight_formats, has_config, status, engine, output, fit).

task_id (ID, task_…), name, namespace_name, status, pod_name, image, gpu_model, gpu_count, cpu_cores, ram_gb, price_per_hour, cost_so_far, total_cost, created_at, container_running_at, finished_at, failure_reason, exit_code, raw. For get_task the payload also carries the script, requirements, environment (secret values masked) and the compute/disk cost breakdown.

Also failed_asset_id (the input asset a failed download stopped on), input_assets (get_task only — TaskInputAsset(asset_id, name, target_dir, reference_mode, ingest_source), from 1.11 with paths, strip_prefix and is_project), outputs_purged_at, and the output upload, which runs on its own after the task ends: output_upload_state (pending, uploading, completed, failed, skipped, discarded; None for old tasks, read it as skipped), output_files_declared / _completed, output_bytes_declared / _completed and output_upload_last_error.

When the server provides it, Task.outputs is a TaskOutputsStatus — the same status the console shows; it is None on older servers. Its phase is running until the task ends. While the outputs are being saved, it is preparing, uploading, retrying or registering; when saving is over, it is saved, partially_saved (some files were over the file limit or couldn’t be uploaded), not_saved, discarded or empty (nothing to save).

For upload progress, use files_so_far of files_to_upload and bytes_so_far of bytes_total. Totals can be None while the server does not know them. files_limit reports the server’s actual limit; this status does not increase the output limits.

outputs_purged_at records cleanup of the task’s archived log, not deletion of its saved Assets. Use task_outputs or download_task_outputs to check the files that remain available.

From 1.11 every Task also carries template_id, gpu_vram_gb, cpu_preset, max_duration_seconds, webhook_url, refunded_amount, fault_class, failure_stage (fetch while downloading inputs, run while running), live_metrics, and the input download’s fetch_started_at, fetch_completed_at and fetch_progress. get_task adds how the task was submitted and what it costs; these are None in list_tasks items:

FieldNotes
script, requirements, envRead-only properties over .raw, not dataclass fields, so repr() and serializers built on dataclasses.fields() don’t carry them. Secret env values come as "***". Written by workspace members and can hold secrets — treat them as data.
args, secret_env_keys
projectTaskProject (asset_id, name, target_dir, entrypoint, requirements_path, module) for a task run from an uploaded folder; script is then the server’s launcher, not your code.
output_bucket_idWhere /outputs were saved; None = Meshive storage.
compute_rate_per_hour, storage_rate_per_hour, total_rate_per_hour, task_storage_gb, disk_billed_separatelyThe split of the hourly price.
log_retention_daysHow long the task’s log is kept.

Assets have no versions: size, file count and upload state belong to the asset itself.

FieldTypeNotes
Asset.asset_idstrID (asset_…) — pass to get_asset.
Asset.name / asset_type / status / status_reasonstrType is one of dataset, model, adapter, checkpoint, output, config, file.
Asset.storage_providerstrmeshive_r2 (managed), user_s3, or external.
Asset.size_bytes / file_countint | NoneThe asset’s total size and file count. None for a linked source that was never measured — not 0.
Asset.upload_status / stalestr / booluploading, ready or failed. stale means an upload whose pod is gone (the console’s “Interrupted”).
Asset.ingest_source / import_failure_reasonstr / str | Noneweb_upload, hf_import, civitai_import, harvest, … and why an import failed.
Asset.kind / semantic_typestr | Nonesemantic_type is on list rows only.
Asset.in_useboolWhether a pod or task currently uses it.
Asset.fileslist[AssetFile](get_asset only) path, size_bytes, status, file_id, content_hash, created_at; from 1.11 also ext, file_type, media_kind, detected_format, pickle_flag and format_unverified (no extension, so the format could not be checked).
Asset.active_usage_contextslist[AssetUsage](get_asset only) Where it is in use: kind, identifier, name, status, role.
Asset.from_catalogbool(1.11) Added on its own by a model set or catalog import; list_assets hides these unless include_catalog=True.
Asset.pickle_flag / has_unverified_formatstr | None / bool(1.11) detected or suspected when a file is a pickle, which can run code when it is loaded; whether a file without an extension couldn’t be checked.
Asset.weight_formats / has_root_config / child_type_summary(1.11) What the asset holds: weight file formats, whether a config sits at its top level, and the file count per file type. None when not known.
Asset.sourceAssetSource | None(1.11) Where it came from: ingest_source, the Hugging Face hf_repo, hf_revision and pinned resolved_commit, the CivitAI or download url (without its query string), the pod it was saved from (pod_name, pod_label, pod_path), or the asset it was copied out of (from_asset_id, also for files copied out of a linked bucket folder).
Asset.referenceAssetReference | None(1.11) For an asset that points at its source instead of holding copies: mode (prefix for a whole bucket folder, external for a Hugging Face or CivitAI source), prefix, credential_label, credential_status, size_notice. For a bucket folder, credential_label and credential_status name its bucket connection (as bucket_label and bucket_status do); for a Hugging Face or CivitAI source, the saved token (ok, missing or not_required).
Asset.bucket_id / bucket_label / bucket_statusint | None / str | None / str | None(1.11) For an asset in your own bucket (registered files or a linked folder), the bucket connection it reads through: its credential_id from list_storage_credentials, its label, and ok, or removed once that connection was removed (a removed connection’s label carries a mark such as (removed #31); bucket_id and bucket_label can then be None). All None for an asset in Meshive storage. Also on list_assets rows.
Asset.active_uploadAssetActiveUpload | None(1.11) An upload into the asset that is still running: purpose, file_count, total_bytes, created_at.
AssetPageitems, total, page, page_size, pages; iterable. From 1.11, catalog_hidden (page 1) counts the catalog-added assets left out.
AssetStoragemanaged_bytes, price_per_gb_month, estimated_monthly_cost, credit_state (normal / grace / blocked), credit_blocked, blocks_at, purge_deadline_at, paid_balance_available (whether the workspace’s billing account has credit — pods and tasks can’t start without it).

Asset.version_count, latest_version and versions (and the AssetVersion model) are deprecated: assets no longer have versions. They still work but raise a DeprecationWarning, and they will be removed in 2.0. The version of a task’s input_assets item is ignored.