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.
npm install @vyron/sdk
# or
pnpm add @vyron/sdkYour first workload
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.
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/compute/offers | Search normalized offers. |
| GET | /v1/compute/offers/{id} | Retrieve a single offer. |
| POST | /v1/compute/estimate | Estimate workload cost. |
| POST | /v1/workloads | Create a workload specification. |
| POST | /v1/workloads/{id}/match | Match a spec against inventory. |
| POST | /v1/jobs | Create a purchase intent and launch. Requires Idempotency-Key. |
| GET | /v1/jobs/{id} | Retrieve job state, payment state and history. |
| GET | /v1/jobs/{id}/logs | Stream execution logs (SSE). |
| POST | /v1/jobs/{id}/cancel | Request cancellation. |
| POST | /v1/jobs/{id}/release | Release the provisioned resource. |
| GET | /v1/billing/transactions | List payment transactions. |
| POST | /v1/agents | Register 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.
{
"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.flaggedimport { 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.
| Code | HTTP | Meaning |
|---|---|---|
offer_withdrawn | 409 | Capacity was withdrawn before purchase. No payment authorized. |
offer_expired | 409 | The offer is no longer valid. Re-run discovery. |
budget_exceeded | 403 | Estimated cost exceeds the caller's spending policy. |
missing_scope | 403 | The credential does not hold the required scope. |
approval_required | 202 | Purchase routed to a human approver. |
capability_unsupported | 422 | The provider cannot perform the requested operation. |
idempotency_conflict | 409 | Key reused with a different request body. |
provisioning_failed | 502 | Provider failed to allocate after payment. Reconciliation opened. |