client.gpu, a typed
mirror of the /v1/gpu REST API. The request names an accelerator, a count,
a region and a price ceiling; AI Reserve places it on whichever backing
provider has stock, and the SDK never receives, needs or exposes a provider,
data center or tenancy. Whichever provider served a resource, the same calls
work; the capabilities flags on quotes and resources are the only
provider-derived facts, and the SDKs consult them rather than assume.
Every language carries the full surface:
offers, instances (quote, launch,
list, get, connections, logs, stop, start, terminate, recovery), clusters
(quote, launch, list, get, connections, logs per node, terminate, recovery),
volumes (create, list, get, grow, delete), sshKeys, registries,
templates, operations and usage. Authentication is the SDK’s usual
credential chain (AIRESERVE_API_KEY, or a management token from
aireserve login); the key needs Compute permission.
Quote, launch, connect, terminate
What every SDK guarantees
- Mutations are idempotent. Every launch, stop, start, terminate, create,
grow, delete, rotate and recovery call sends an
Idempotency-Key(sdk-<resource>-<action>-<uuid>unless you pass one) and returns a typed operation handle.wait()pollsGET /v1/gpu/operations/{id}with backoff (1 s → 5 s), then fetches the resource; a failed operation raisesOperationFailedErrorcarrying the structuredfailure(code,actor,message,next); running out of time raisesOperationTimeoutError. - Refusals are typed.
409 no_capacityisNoCapacityErrorwithreason(no_stock,price_ceiling,volume_location,no_persistent_storage),cheapestEligibleUsdPerHourandalternatives;quote_expiredandprice_changedare distinct exceptions;insufficient_fundsmaps to the quota exception. - Money is a string. Every price is a six-decimal USD string, never a float.
- No provider surfaces. SDK types carry
region, never a data-center id;acceleratorids are the public onesoffers.list()returns; the legacy provider-shaped/v1/gpu/pods,/v1/gpu/catalogand/v1/gpu/quotesroutes are not exposed. - Clusters take no registry credential, exactly like the API; a private image needs a single instance.
- Logs are an iterator of
{ timestamp, source, line, eventId }withtail,source,since(andnodefor clusters); the SDK reconnects across relay windows withLast-Event-ID.
Conformance
The SDKs are specified once, in the SDK repository’sSPEC.md (section 10),
and tested against one shared fixture corpus recorded from AI Reserve’s
two-provider end-to-end harness, so Python, TypeScript, Go, Java and Rust
replay byte-identical server behavior for every scenario above, including a
resource placed on a marketplace provider and a cluster request no provider
can place.
Related: the CLI is the same contract from a shell; the
MCP server gives a coding agent the same surface as
tools.