Skip to content
v1 · versioned API

Developer Documentation

The console, the SDKs and agent tooling are all clients of the same versioned REST API. Nothing in the dashboard uses a capability the API does not expose.

Quickstart

Discovery and estimation need only an API key. Purchasing additionally requires a connected wallet and a supported payment asset.

install
npm install @vyron/sdk
# or
pnpm add @vyron/sdk

Your first workload

first-job.ts
import { Vyron } from "@vyron/sdk";

const vyron = new Vyron({ apiKey: process.env.VYRON_API_KEY });

// 1. Discover capacity that satisfies your hard constraints
const offers = await vyron.compute.search({
  gpuModel: "A100 SXM",
  minVramGb: 80,
  gpuCount: 1,
});

// 2. Estimate before committing anything
const estimate = await vyron.compute.estimate({
  offerId: offers[0].id,
  runtimeHours: 2,
  storageGb: 200,
});
console.log(estimate.totalUsd, estimate.assumptions);

// 3. Launch. The idempotency key makes retries safe.
const job = await vyron.jobs.launch({
  offerId: offers[0].id,
  workloadId: workload.id,
  maxCostUsd: estimate.totalUsd,
  idempotencyKey: crypto.randomUUID(),
});

// 4. The job starts in 'awaiting_payment' — not 'running'.
console.log(job.state, job.paymentState);

Core concepts

Offer
A point-in-time, normalized description of purchasable capacity. An offer is not a reservation — availability is revalidated with the provider before purchase.
Workload
A versioned, provider-agnostic specification: container image, command, resource requirements, constraints, budget, environment and outputs.
Purchase intent
Created before payment. Carries the offer reference, estimated amount, asset, expiry and an idempotency key.
Job
One execution of a workload against one offer. Carries two independent states: execution state and payment state.
Capability
What a provider can actually do. Checked before an offer is purchasable; an unsupported operation returns an error rather than being emulated.
Reconciliation
Comparison of chain records, the internal ledger and provider usage. A job is not closed until they agree within tolerance.

API reference

All endpoints are versioned under /v1 and authenticated with a bearer API key. Requests that spend funds require an Idempotency-Key header.

MethodEndpointDescription
GET/v1/compute/offersSearch normalized offers.
GET/v1/compute/offers/{id}Retrieve a single offer.
POST/v1/compute/estimateEstimate workload cost.
POST/v1/workloadsCreate a workload specification.
POST/v1/workloads/{id}/matchMatch a spec against inventory.
POST/v1/jobsCreate a purchase intent and launch. Requires Idempotency-Key.
GET/v1/jobs/{id}Retrieve job state, payment state and history.
GET/v1/jobs/{id}/logsStream execution logs (SSE).
POST/v1/jobs/{id}/cancelRequest cancellation.
POST/v1/jobs/{id}/releaseRelease the provisioned resource.
GET/v1/billing/transactionsList payment transactions.
POST/v1/agentsRegister an agent identity.

SDKs

TypeScript and Python clients wrap the REST API with typed models, automatic retries with idempotency and streaming helpers.

@vyron/sdkTypeScript / Node 20+
vyronPython 3.10+

MCP integration

Approved platform operations are exposed as MCP tools. Tool descriptions state required inputs, side effects, required permissions and whether the operation spends funds. Read-only tools are distinguishable from spending tools.

MCP calls enforce the same identity, scope, budget, rate-limit and audit rules as REST. Private keys and unrestricted signing credentials are never passed to a model.
mcp-server-config.json
{
  "mcpServers": {
    "vyron": {
      "command": "npx",
      "args": ["-y", "@vyron/mcp-server"],
      "env": {
        "VYRON_API_KEY": "vyr_live_..."
      }
    }
  }
}

Webhooks

Subscribe to job and payment state changes. Delivery is authenticated, signed and retried with bounded backoff. A delivery failure never rolls back completed job state.

job.state_changedjob.succeededjob.failedpayment.state_changedpayment.confirmedreconciliation.flagged
verify-webhook.ts
import { verifyWebhookSignature } from "@vyron/sdk";

export async function POST(request: Request) {
  const raw = await request.text();
  const signature = request.headers.get("vyron-signature");

  // Throws if the signature or timestamp window is invalid
  const event = verifyWebhookSignature({
    payload: raw,
    signature,
    secret: process.env.VYRON_WEBHOOK_SECRET,
  });

  if (event.type === "job.state_changed") {
    console.log(event.data.jobId, event.data.state, event.data.paymentState);
  }

  return new Response(null, { status: 204 });
}

Errors

Errors are normalized across providers. A provider-specific failure is mapped to a category with the provider detail preserved where it is safe to disclose.

CodeHTTPMeaning
offer_withdrawn409Capacity was withdrawn before purchase. No payment authorized.
offer_expired409The offer is no longer valid. Re-run discovery.
budget_exceeded403Estimated cost exceeds the caller's spending policy.
missing_scope403The credential does not hold the required scope.
approval_required202Purchase routed to a human approver.
capability_unsupported422The provider cannot perform the requested operation.
idempotency_conflict409Key reused with a different request body.
provisioning_failed502Provider failed to allocate after payment. Reconciliation opened.

Ready to run something?

Discovery and estimation work before you connect a wallet.