Skip to main content

Getting Started

This guide walks through installing the Targon CLI and SDK, configuring credentials, and querying Targon resources.

Prerequisites​

  • Python 3.9 or later (for the Python SDK)
  • Node.js 20 or later (for the TypeScript SDK)
  • Go 1.21 or later (for the Go SDK)
  • Rust toolchain (for the CLI)
  • A Targon account and API key

Install the CLI​

The CLI is a standalone Rust binary. Build it from the targon-sdk repo:

git clone https://github.com/manifold-inc/targon-sdk.git
cd targon-sdk/cli
cargo build --release

See the CLI installation guide for details.

Install the SDK​

The SDK lives under libs/ in the targon-sdk repository. Language packages are published separately.

Python​

pip install targon-sdk

For local development from the repo:

git clone https://github.com/manifold-inc/targon-sdk.git
cd targon-sdk/libs/python
pip install -e ".[dev]"

Import the top-level API:

from targon import Client, Resources
from targon.client import CreateWorkloadRequest, PortConfig

TypeScript​

npm install @targon/sdk

Source: libs/typescript

Go​

go get github.com/manifold-inc/targon-sdk/libs/go

Source: libs/go

Configure Credentials​

Store your API key with the CLI:

targon auth login

Follow the prompt to paste your key. Credentials are stored under ~/.targon/.

The Python SDK also accepts credentials from:

  • The TARGON_API_KEY environment variable
  • The same ~/.targon/ credential files written by the CLI
from targon import Client

client = Client.from_env() # reads TARGON_API_KEY or ~/.targon/
# or
client = Client(api_key="your-api-key")

Check Available Resources​

List compute that is available right now:

targon inventory --gpu

Or query inventory from Python:

from targon import Client

client = Client.from_env()

for item in client.inventory.capacity(gpu=True):
print(f"{item.name}: {item.available} available @ ${item.cost_per_hour}/hr")

Use targon inventory to compare GPU tiers, hourly cost, and availability before creating a workload.

Explore available resources​

Use the SDK or targon inventory to compare available CPU and GPU resources before creating compute.

Next Steps​