# Compute

Compute gives you a dedicated machine with your own SSH access. Start in the
[Console](https://app.nestor.software): sign in, create or select an organization
and project, and open Compute. Add a card from the instance form or Billing.
Choose a machine, add your SSH public key, and select **Launch instance** to
accept the displayed price and Compute billing terms. There is no separate
billing activation checkbox. Normal customer access does not require
an organization allowlist or an operator to install your SSH key.

## Choose a machine

The catalog shows currently available, qualified configurations: GPU, CPU, RAM,
local storage, region and a customer price. Availability can change before a
launch completes. An empty catalog means no qualified offering is available; check again later.

Review the price and [billing and termination terms](/compute/billing/v2) for the
selected region. The catalog's `price_id` and `terms_ref` identify the price and
terms you accept. A launch with outdated values fails with `PRICE_CHANGED`;
refresh the catalog and review the replacement before sending a new request.
A policy preview without a `price_id`, or a price with `eligible: false`, cannot
authorize a purchase. Finish Billing setup or resolve the reported limit first.

New card setup uses standard consumer tax treatment. Existing business billing
stays unchanged. If you need business billing, change the tax treatment in Billing
before your first launch. Saving a card never launches an instance on its own.

You can use the same verified card for every organization you manage. Each
organization has its own unpaid-usage limit and concurrent instance limit.

## Connect securely

Supply a single Ed25519 **public** key, usually `~/.ssh/id_ed25519.pub`. Keep the
corresponding private key on your computer. Nestor rejects invalid keys. Launch
returns an Operation while the Instance is provisioning; wait for READY and
connection details before connecting.

The Instance shows an SSH command and authenticated host-key fingerprints.
Compare the fingerprint displayed by SSH with those values before accepting a
new host. Never bypass a mismatch or disable host-key checking. Log in using the
private key that matches the public key you supplied. The customer account has
passwordless sudo for installing software and running your workloads.

Reboot is available when the Instance advertises it. Start and stop are only
available on machines whose capabilities include them. Stopped instances still count toward your limits. Delete the instance when you
are finished.

## Python SDK

Install the [Python SDK](/sdks/python) and configure a management credential,
organization and project. Compute requires SDK version 0.1.3 or later; verify
with `nestor --version` and `nestor compute --help`. The SDK uses the same authenticated API and durable Operations as
the Console.

```python
import os
from pathlib import Path
from nestor import Nestor

client = Nestor()
print(client.compute.access().to_dict())
for shape in client.compute.catalog():
    print(shape.to_dict())  # Review hardware, regions, price and terms.

# Copy these exact values from the reviewed, eligible catalog entry.
operation = client.compute.instances.create(
    instance_type=os.environ["NESTOR_INSTANCE_TYPE"],
    region=os.environ["NESTOR_INSTANCE_REGION"],
    price_id=os.environ["NESTOR_ACCEPTED_PRICE_ID"],
    terms_ref=os.environ["NESTOR_ACCEPTED_TERMS_REF"],
    ssh_public_key=Path("~/.ssh/id_ed25519.pub").expanduser().read_text(),
    idempotency_key="my-instance-create-001",
)
instance = client.compute.instances.wait(operation)
print(instance.ssh_command)
print(instance.ssh["host_key_fingerprints"])

# Run your workload over SSH. When finished:
deleted = client.compute.instances.delete(
    instance, idempotency_key="my-instance-delete-001", wait=True,
)
assert deleted.succeeded
```

Every list returns the existing lazy `Page` object. Iteration follows opaque
page tokens; lists are not snapshots. Filter Instances by `state`, `region` or
`instance_type`. `get`, `reboot`, `start` and `stop` accept an Instance document
or its ID. Power methods return Operations; use `client.operations.wait(op)` to
follow them. `client.compute.instances.wait(op)` checks READY after a successful
create, reboot or start Operation.

Use a distinct idempotency key for each intended mutation. Retry an uncertain
request with the **same** key, body and ETag. The SDK preserves those values
across its automatic transport retries. To retry a deletion in a later process,
retain its key and original ETag and pass `etag=...`; do not fetch a different
precondition for the same request. A local timeout or interrupted CLI wait does
not cancel remote work or delete a machine. Resume polling the original Operation.

## CLI

```sh
nestor compute access --json
nestor compute catalog --json
nestor compute instances create \
  --instance-type "$NESTOR_INSTANCE_TYPE" \
  --region "$NESTOR_INSTANCE_REGION" \
  --price-id "$NESTOR_ACCEPTED_PRICE_ID" \
  --terms-ref "$NESTOR_ACCEPTED_TERMS_REF" \
  --ssh-public-key-file ~/.ssh/id_ed25519.pub \
  --idempotency-key my-instance-create-002 --wait --json
nestor compute instances list --json
nestor compute instances get "$NESTOR_INSTANCE_ID" --json
nestor compute instances connect "$NESTOR_INSTANCE_ID"
nestor compute instances reboot "$NESTOR_INSTANCE_ID" --wait
nestor usage series gpu.hours --resource "$NESTOR_INSTANCE_ID" --period 24h --json
nestor compute instances delete "$NESTOR_INSTANCE_ID" --wait --json
```

`connect` prints connection instructions and fingerprints; it does not execute
SSH or install a private key. `--wait` follows the durable Operation and reports
failure instead of declaring an unsuccessful operation complete. Unsupported
power actions are rejected, and stale ETags require you to re-read and decide.

## Usage and cleanup

Usage records identify the exact Instance. GPU, CPU and RAM meters are factual;
the displayed customer tariff determines applicable charges. Posted usage may
lag an active machine and is not a final invoice. Billing statements require
complete usage coverage. See Billing for estimates and statements.

Delete from the Console or SDK/CLI and follow its Operation through completion.
A deletion acknowledgment or a disconnected SSH session does not prove cleanup.
Nestor confirms infrastructure release, closes meters and returns the quota
claim before reporting deletion complete. Cleanup failures remain visible and
are retried; retain the Operation ID when contacting support. Back up your data
before deletion or a financial termination: local disk contents do not survive
release.
