Skip to main content
Every AI Reserve SDK exposes GPU infrastructure as 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() polls GET /v1/gpu/operations/{id} with backoff (1 s → 5 s), then fetches the resource; a failed operation raises OperationFailedError carrying the structured failure (code, actor, message, next); running out of time raises OperationTimeoutError.
  • Refusals are typed. 409 no_capacity is NoCapacityError with reason (no_stock, price_ceiling, volume_location, no_persistent_storage), cheapestEligibleUsdPerHour and alternatives; quote_expired and price_changed are distinct exceptions; insufficient_funds maps 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; accelerator ids are the public ones offers.list() returns; the legacy provider-shaped /v1/gpu/pods, /v1/gpu/catalog and /v1/gpu/quotes routes 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 } with tail, source, since (and node for clusters); the SDK reconnects across relay windows with Last-Event-ID.

Conformance

The SDKs are specified once, in the SDK repository’s SPEC.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.