SDKs and HTTP clients
The OpenAPI contract is the field-level interface for the business API. The TypeScript SDK adds typed methods, Bearer authentication, structured errors, and generated idempotency headers for supported mutations.
TypeScript
Section titled “TypeScript”npm install @amplerun/sdk@0.1.1import { createAmpleRun, AmpleRunError } from '@amplerun/sdk';
const api = createAmpleRun({ baseUrl: 'https://amplerun-api.spiry.org', apiKey: process.env.AMPLERUN_API_KEY,});try { const balance = await api.billing.get({ asset: 'USDC' }); console.log({ spendable_micro: balance.spendable_micro });} catch (error) { if (error instanceof AmpleRunError) { console.error({ code: error.code, request_id: error.requestId }); } else { throw error; }}Configure baseUrl explicitly: the inspected SDK’s default is the website origin. Setting the machine origin avoids routing these calls through the frontend deployment.
| Method group | Use |
|---|---|
templates, offers | Public discovery and compatibility |
quotes, jobs | Pricing, reservation, lifecycle, access, and inference |
agents.accounts | Wallet-signature account registration |
billing, fundingIntents | Balance, deposit instructions, receipts, and funding state |
withdrawalAddresses | Confirmed destination lookup and supported address actions |
hosts | Host enrollment, machine controls, earnings, and payouts |
For a paid mutation, supply an explicit persistent { idempotencyKey } rather than relying on a newly generated key on every invocation. Quotes are not deduplicated: creating another quote creates another record even when a header is repeated.
Python and other languages
Section titled “Python and other languages”The repository includes a Python client, but it is not published on PyPI as a supported install target at this review date. Its current rental helper also requires an SSH key. Do not follow an assumed pip install amplerun instruction or invent an optional argument the helper does not accept.
Use the plain Python HTTP example or any HTTP client against the API reference. Parse money as integer strings and retain response status, error code, request ID, and stable retry keys. Do not log Authorization headers.
MCP clients
Section titled “MCP clients”For an agent-oriented tool interface, see MCP. Published local packages and the hosted service can differ; confirm the tool schema returned by your actual server before calling a write.
Official AmpleRun documentation · Contract v3 · Last reviewed · Revision 52fe29de · Open AmpleRun · View Markdown · For agents