ReferenceQuery via SDKs

Query Data via SDKs

You can query all Polyaxon data programmatically via the SDKs and the API. For export and pull functionality, see Export Options.

Common use cases:

  • Retrieve operation results and metrics for analysis and reporting.
  • Query model versions and artifacts for deployment pipelines.
  • Build custom dashboards and integrations on top of Polyaxon data.
  • Automate workflows based on operation status, tags, or metrics.

SDKs

Via the SDKs for Python and JS/TS you can query the API without having to write HTTP requests yourself.

pip install polyaxon

Polyaxon provides high-level clients (RunClient, ProjectClient) that handle authentication, project resolution, and provide an ergonomic API.

Operations (Runs)

from polyaxon.client import RunClient

# Initialize a client for a project
client = RunClient(owner="org", project="my-project")

# List operations with filters
runs = client.list(query="status:succeeded", sort="-created_at", limit=100)

# Get a specific operation
client = RunClient(owner="org", project="my-project", run_uuid="run_uuid")
run = client.get_run_data()

# Get operation events (metrics)
events = client.get_events(names="loss,accuracy")

# Get operation logs
client.get_logs()

# Get artifact lineage for a run
artifacts = client.get_artifacts_lineage()

Projects, Models, Artifacts, and Components

from polyaxon.client import ProjectClient
from polyaxon._schemas.lifecycle import V1ProjectVersionKind

# Initialize a client for a project
client = ProjectClient(owner="org", project="my-project")

# List runs in the project
runs = client.list_runs(query="status:succeeded", sort="-created_at")

# List model versions
models = client.list_versions(kind=V1ProjectVersionKind.MODEL)

# Get a specific model version
model = client.get_version(kind=V1ProjectVersionKind.MODEL, version="v1.0")

# List artifact versions
artifacts = client.list_versions(kind=V1ProjectVersionKind.ARTIFACT)

# List component versions
components = client.list_versions(kind=V1ProjectVersionKind.COMPONENT)

Team-scoped projects

# Access projects under a team space
client = ProjectClient(owner="org/engineering", project="my-project")

Common filtering & pagination

  • limit, offset — pagination
  • query — filter using Polyaxon Query Language (e.g. "status:running", "tags:experiment", "metrics.loss:<0.5")
  • sort — sort by field (prefix with - for descending, e.g. "-created_at")

See the API Reference for exact parameters per resource.

npm install @polyaxon/client
import { PolyaxonClient } from "@polyaxon/client";

const client = new PolyaxonClient();

// List operations in a project with filters
const runs = await client.runsV1.listRuns("owner", "project", {
  query: "status:succeeded",
  sort: "-created_at",
  limit: 100,
});

// Get a specific operation
const run = await client.runsV1.getRun("owner", "project", "run_uuid");

// List model versions
const models = await client.projectModelV1.listVersions("owner", "project");

// List projects
const projects = await client.projectV1.listProjects("owner");

All methods support filters and pagination. Explore available methods via Intellisense.