Python client

The implemented client is gradient_dynamics.GradientClient, a thin wrapper around the central HTTPS API. It is different from the earlier proposed object-oriented SDK described on this site.

The repository’s package is named gradient-dynamics, version 0.0.1. It is not yet advertised as a published PyPI distribution. Use an operator-supplied verified package when available. Contributors with the API checkout can install its sdk directory. REST and MCP need no Gradient Dynamics Python package.

import os
from gradient_dynamics import GradientClient

with GradientClient(os.environ["GD_API_KEY"]) as gd:
    capabilities = gd.request("GET", "/v1/capabilities")
    print(capabilities)

Upload and inspect

with GradientClient(os.environ["GD_API_KEY"]) as gd:
    artifact = gd.upload_file(None, "/absolute/path/part.step")
    print(artifact["id"], artifact["sha256"])

upload_file streams the file and returns a verified ready artifact. None uses the project-optional upload workflow. A transfer error can carry an artifact ID; inspect that artifact before creating another upload.

Durable preparation

with GradientClient(os.environ["GD_API_KEY"]) as gd:
    pending = gd.prepare(
        "POST", f"/v1/artifacts/{mesh_artifact_id}/mesh-view", json={}
    )
    if "operation_id" not in pending:
        print(pending["viewer_url"])
    else:
        operation = gd.wait_operation(pending["operation_id"])
        if operation["state"] == "succeeded":
            print(operation["result"]["viewer_url"])
        else:
            print(operation["state"], operation.get("error"))

The ID in this example must come from a saved owned mesh. Resume a timed-out wait with operation or wait_operation; timeout does not cancel work. Compute jobs use the separate submit/job/wait/cancel methods. wait returns an awaiting_decision mesh for explicit review instead of polling forever.

The REST reference remains the contract for generic request calls. Do not use the authenticated client request method for capability transfers that specify their own headers.