Integrate Agent Vault from your own stack — REST API, TypeScript SDK, and Python SDK, all sharing one byte-compatible zero-knowledge envelope.
Everything the CLI does is plain HTTP on https://compute.x402layer.cc/backups/*,
authenticated with a compute API key (X-API-Key). Encryption always happens
on your side — the flow is reserve → presigned PUT of ciphertext → complete.
Full endpoint schemas: Agent Vault API reference.
TypeScript — @singularity-layer/grid
Pure-JS envelope (noble crypto) — works in Node and browsers.
// npm i @singularity-layer/gridimport { VaultClient } from "@singularity-layer/grid";const vault = new VaultClient({ apiKey: "x402c_..." });const agent = await vault.createAgent("My Bot", "custom-my-bot-a1b2c3");const id = await vault.backupBytes(agent.id, payloadBytes, passphrase);const bytes = await vault.restoreBytes(id, passphrase); // decrypted payloadawait vault.subscribePro(); // $3/mo from credits
backupBytes/restoreBytes handle arbitrary payloads — pack directories with
the CLI or Python SDK, or bring your own archive.
Python — singularity-grid
Full directory backup/restore, stdlib scrypt + cryptography AES-GCM:
POST /backups/subscribe takes credits by default. Add pay: "x402" (and
optionally network) and, if a charge is actually required and your credits
are short, it answers 402 with a standard x402 challenge:
# 1. Ask for the plan, requesting the x402 railcurl -X POST https://compute.x402layer.cc/backups/subscribe \ -H "X-API-Key: x402c_..." -H "Content-Type: application/json" \ -d '{"plan":"pro","interval":"year","pay":"x402","network":"base"}'# -> 402 { "x402Version": 1, "accepts": [ { "network":"base", "maxAmountRequired":"30000000", ... } ] }# 2. Settle it and re-send with the X-Payment headercurl -X POST https://compute.x402layer.cc/backups/subscribe \ -H "X-API-Key: x402c_..." -H "X-Payment: <base64 payload>" \ -H "Content-Type: application/json" \ -d '{"plan":"pro","interval":"year","pay":"x402","network":"base"}'# -> 200 { "ok": true, "plan": "pro", "interval": "year", "charged": 30 }
Networks: base (USDC) · solana (USDC) · robinhood (USDG) · megaeth (USDm).A few deliberate properties worth knowing:
The challenge quotes the full plan price. Upgrades are prorated against
the time you already paid for, so the actual debit is often lower — whatever
the charge doesn’t consume stays in your credit balance.
You are never asked to pay for nothing. The subscription decides first,
so cancelling (plan: "free"), scheduling a downgrade, or re-picking the plan
you are already on returns 200 and never issues a challenge.
The payer must be the authenticated wallet. Paying from one wallet to
subscribe another is refused.
Replays are safe. Settlement is idempotent on the transaction hash, so
re-sending the same X-Payment cannot charge you twice.
One envelope, everywhere
CLI, pod runner, TypeScript, and Python all produce the identical encrypted
envelope (scrypt N=2^17 r=8 p=1 → AES-256-GCM, snapshot identity bound into
the AAD, parsed from the snapshot’s r2Key). A blob encrypted by any of them
restores with any other — cross-verified byte-for-byte in CI-style tests.
Zero-knowledge cuts both ways: a lost passphrase is unrecoverable by
anyone, including Singularity Layer.
MCP (for agents)
The Singularity MCP (https://mcp.x402layer.cc/mcp, streamable HTTP) ships six
vault tools: vault_usage, vault_list_agents, vault_list_snapshots,
vault_delete_snapshot, vault_subscribe_pro, and vault_how_to_backup.
Management tools take a compute API key per call; creating/restoring the
encrypted payload itself stays on the agent’s machine (zero-knowledge), and
vault_how_to_backup hands the agent the exact CLI steps. Agent Pods carry
this MCP natively — pod agents can check and manage their own backups out of
the box.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"x402 Singularity Layer","colors":{"primary":"#50A7E3","light":"#F5EEE2","dark":"#0A0A0A"},"logo":{"light":"https://mintcdn.com/singularitylayer/UUMXGfdtSU8sd_LO/images/sgl-logo.webp?fit=max\u0026auto=format\u0026n=UUMXGfdtSU8sd_LO\u0026q=85\u0026s=8859fac8d109559fc73dea8a15bc8679","dark":"https://mintcdn.com/singularitylayer/UUMXGfdtSU8sd_LO/images/sgl-logo.webp?fit=max\u0026auto=format\u0026n=UUMXGfdtSU8sd_LO\u0026q=85\u0026s=8859fac8d109559fc73dea8a15bc8679"},"favicon":"https://mintcdn.com/singularitylayer/UUMXGfdtSU8sd_LO/images/sgl-logo.webp?fit=max\u0026auto=format\u0026n=UUMXGfdtSU8sd_LO\u0026q=85\u0026s=8859fac8d109559fc73dea8a15bc8679","navbar":{"links":[{"href":"https://studio.x402layer.cc/marketplace","label":"Marketplace"}],"primary":{"type":"button","label":"Launch Studio","href":"https://studio.x402layer.cc"}},"footer":{"socials":{"x":"https://x.com/ivaavimusic","github":"https://github.com/ivaavimusic/x402Studio-frontend"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Studio","icon":"book-open-cover","href":"https://studio.x402layer.cc"},{"anchor":"Singularity Compute","icon":"server","href":"https://x402compute.cc"},{"anchor":"Website","icon":"globe","href":"https://x402layer.cc"},{"anchor":"SDK","icon":"github","href":"https://github.com/ivaavimusic/Singularity-SDK"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"singularitylayer","hasAudioNarration":false,"actualSubdomain":"singularitylayer","customDomains":["docs.x402layer.cc"],"gitSource":{"type":"github","owner":"ivaavimusic","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6b03109861d562fd150d40c3","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"API Reference","count":277},{"language":"default","tag":"Guides","count":116},{"language":"default","tag":"Agent Pods API","count":82},{"language":"default","tag":"Singularity Cloud Network","count":59},{"language":"default","tag":"SGL Grid","count":40},{"language":"default","tag":"Agent Pods","count":37},{"language":"default","tag":"Staking Engine","count":29},{"language":"default","tag":"Singularity Compute","count":15},{"language":"default","tag":"Enterprise","count":12},{"language":"default","tag":"Agent Vault","count":12}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"cloud/vault/api-sdks","slug":"/cloud/vault/api-sdks","pageMetadata":{"title":"Agent Vault — API \u0026 SDKs","description":"Integrate Agent Vault from your own stack — REST API, TypeScript SDK, and Python SDK, all sharing one byte-compatible zero-knowledge envelope.","href":"/cloud/vault/api-sdks"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Integrate Agent Vault from your own stack — REST API, TypeScript SDK, and Python SDK, all sharing one byte-compatible zero-knowledge envelope.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Everything the CLI does is plain HTTP on `,_jsx(_components.code,{children:`https://compute.x402layer.cc/backups/*`}),`,\nauthenticated with a compute API key (`,_jsx(_components.code,{children:`X-API-Key`}),`). Encryption always happens\non `,_jsx(_components.strong,{children:`your`}),` side — the flow is `,_jsx(_components.em,{children:`reserve → presigned PUT of ciphertext → complete`}),`.\nFull endpoint schemas: `,_jsx(_components.a,{href:`/api-reference/vault-agents-list`,children:`Agent Vault API reference`}),`.`]}),`\n`,_jsxs(Heading,{level:`2`,id:`typescript-—-@singularity-layer/grid`,children:[`TypeScript — `,_jsx(_components.code,{children:`@singularity-layer/grid`})]}),`\n`,_jsxs(_components.p,{children:[`Pure-JS envelope (noble crypto) — works in Node `,_jsx(_components.strong,{children:`and`}),` browsers.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// npm i @singularity-layer/grid`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`VaultClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@singularity-layer/grid\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` vault`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` VaultClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x402c_...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` agent`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` vault`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createAgent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"My Bot\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"custom-my-bot-a1b2c3\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` vault`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`backupBytes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`agent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`payloadBytes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`passphrase`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` bytes`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` vault`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`restoreBytes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`passphrase`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// decrypted payload`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` vault`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`subscribePro`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// $3/mo from credits`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`backupBytes`}),`/`,_jsx(_components.code,{children:`restoreBytes`}),` handle arbitrary payloads — pack directories with\nthe CLI or Python SDK, or bring your own archive.`]}),`\n`,_jsxs(Heading,{level:`2`,id:`python-—-singularity-grid`,children:[`Python — `,_jsx(_components.code,{children:`singularity-grid`})]}),`\n`,_jsxs(_components.p,{children:[`Full directory backup/restore, stdlib `,_jsx(_components.code,{children:`scrypt`}),` + `,_jsx(_components.code,{children:`cryptography`}),` AES-GCM:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# pip install singularity-grid`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` singularity_grid `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` VaultClient`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`vault `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` VaultClient(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"x402c_...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`snapshot_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vault.backup_dir(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"~/my-agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`passphrase`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"My Agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`vault.restore(snapshot_id, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`passphrase`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`dest`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./restored\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`vault.usage() `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# plan, bytes, caps`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`vault.subscribe_pro() `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# $3/mo from credits`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`paying-with-x402`,children:`Paying with x402`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /backups/subscribe`}),` takes credits by default. Add `,_jsx(_components.code,{children:`pay: \"x402\"`}),` (and\noptionally `,_jsx(_components.code,{children:`network`}),`) and, `,_jsx(_components.strong,{children:`if a charge is actually required and your credits\nare short`}),`, it answers `,_jsx(_components.code,{children:`402`}),` with a standard x402 challenge:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 1. Ask for the plan, requesting the x402 rail`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://compute.x402layer.cc/backups/subscribe`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: x402c_...\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"plan\":\"pro\",\"interval\":\"year\",\"pay\":\"x402\",\"network\":\"base\"}'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# -> 402 { \"x402Version\": 1, \"accepts\": [ { \"network\":\"base\", \"maxAmountRequired\":\"30000000\", ... } ] }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 2. Settle it and re-send with the X-Payment header`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://compute.x402layer.cc/backups/subscribe`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: x402c_...\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-Payment: \u003cbase64 payload>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"plan\":\"pro\",\"interval\":\"year\",\"pay\":\"x402\",\"network\":\"base\"}'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# -> 200 { \"ok\": true, \"plan\": \"pro\", \"interval\": \"year\", \"charged\": 30 }`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Networks: `,_jsx(_components.code,{children:`base`}),` (USDC) · `,_jsx(_components.code,{children:`solana`}),` (USDC) · `,_jsx(_components.code,{children:`robinhood`}),` (USDG) · `,_jsx(_components.code,{children:`megaeth`}),` (USDm).`]}),`\n`,_jsx(_components.p,{children:`A few deliberate properties worth knowing:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`The challenge quotes the full plan price.`}),` Upgrades are prorated against\nthe time you already paid for, so the actual debit is often lower — whatever\nthe charge doesn’t consume stays in your credit balance.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`You are never asked to pay for nothing.`}),` The subscription decides first,\nso cancelling (`,_jsx(_components.code,{children:`plan: \"free\"`}),`), scheduling a downgrade, or re-picking the plan\nyou are already on returns `,_jsx(_components.code,{children:`200`}),` and never issues a challenge.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`The payer must be the authenticated wallet.`}),` Paying from one wallet to\nsubscribe another is refused.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Replays are safe.`}),` Settlement is idempotent on the transaction hash, so\nre-sending the same `,_jsx(_components.code,{children:`X-Payment`}),` cannot charge you twice.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`one-envelope-everywhere`,children:`One envelope, everywhere`}),`\n`,_jsxs(_components.p,{children:[`CLI, pod runner, TypeScript, and Python all produce the identical encrypted\nenvelope (`,_jsx(_components.code,{children:`scrypt N=2^17 r=8 p=1`}),` → AES-256-GCM, snapshot identity bound into\nthe AAD, parsed from the snapshot’s `,_jsx(_components.code,{children:`r2Key`}),`). A blob encrypted by any of them\nrestores with any other — cross-verified byte-for-byte in CI-style tests.`]}),`\n`,_jsx(Warning,{children:`Zero-knowledge cuts both ways: a lost passphrase is unrecoverable by\nanyone, including Singularity Layer.`}),`\n`,_jsx(Heading,{level:`2`,id:`mcp-for-agents`,children:`MCP (for agents)`}),`\n`,_jsxs(_components.p,{children:[`The Singularity MCP (`,_jsx(_components.code,{children:`https://mcp.x402layer.cc/mcp`}),`, streamable HTTP) ships six\nvault tools: `,_jsx(_components.code,{children:`vault_usage`}),`, `,_jsx(_components.code,{children:`vault_list_agents`}),`, `,_jsx(_components.code,{children:`vault_list_snapshots`}),`,\n`,_jsx(_components.code,{children:`vault_delete_snapshot`}),`, `,_jsx(_components.code,{children:`vault_subscribe_pro`}),`, and `,_jsx(_components.code,{children:`vault_how_to_backup`}),`.\nManagement tools take a compute API key per call; creating/restoring the\nencrypted payload itself stays on the agent’s machine (zero-knowledge), and\n`,_jsx(_components.code,{children:`vault_how_to_backup`}),` hands the agent the exact CLI steps. Agent Pods carry\nthis MCP natively — pod agents can check and manage their own backups out of\nthe box.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Agent Vault — API \u0026 SDKs","description":"Integrate Agent Vault from your own stack — REST API, TypeScript SDK, and Python SDK, all sharing one byte-compatible zero-knowledge envelope.","href":"/cloud/vault/api-sdks"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"TypeScript — @singularity-layer/grid","slug":"typescript-—-@singularity-layer/grid","depth":2,"children":[]},{"title":"Python — singularity-grid","slug":"python-—-singularity-grid","depth":2,"children":[]},{"title":"Paying with x402","slug":"paying-with-x402","depth":2,"children":[]},{"title":"One envelope, everywhere","slug":"one-envelope-everywhere","depth":2,"children":[]},{"title":"MCP (for agents)","slug":"mcp-for-agents","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"singularitylayer","siteName":"x402 Singularity Layer","title":"Agent Vault — API \u0026 SDKs - x402 Singularity Layer","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-21T19:32:42.905Z","originalFileLocation":"cloud/vault/api-sdks.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Integrate Agent Vault from your own stack — REST API, TypeScript SDK, and Python SDK, all sharing one byte-compatible zero-knowledge envelope.\">\u003cmeta data-mint-head name=\"application-name\" content=\"x402 Singularity Layer\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Agent Vault — API \u0026amp; SDKs - x402 Singularity Layer\">\u003cmeta data-mint-head property=\"og:description\" content=\"Integrate Agent Vault from your own stack — REST API, TypeScript SDK, and Python SDK, all sharing one byte-compatible zero-knowledge envelope.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"x402 Singularity Layer\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.x402layer.cc/cloud/vault/api-sdks\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://singularitylayer.mintlify.site/_mintlify/api/og/v2?division=Agent+Vault\u0026amp;title=Agent+Vault+%E2%80%94+API+%26+SDKs\u0026amp;description=Integrate+Agent+Vault+from+your+own+stack+%E2%80%94+REST+API%2C+TypeScript+SDK%2C+and+Python+SDK%2C+all+sharing+one+byte-compatible+zero-knowledge+envelope.\u0026amp;theme=907e4395bac9d9ffff169ca5\u0026amp;signature=6de53525a8c742b8a0be6b3efd9462139de2d0675c21bca2abf9626206ed6e76\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Agent Vault — API \u0026amp; SDKs - x402 Singularity Layer\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Integrate Agent Vault from your own stack — REST API, TypeScript SDK, and Python SDK, all sharing one byte-compatible zero-knowledge envelope.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://singularitylayer.mintlify.site/_mintlify/api/og/v2?division=Agent+Vault\u0026amp;title=Agent+Vault+%E2%80%94+API+%26+SDKs\u0026amp;description=Integrate+Agent+Vault+from+your+own+stack+%E2%80%94+REST+API%2C+TypeScript+SDK%2C+and+Python+SDK%2C+all+sharing+one+byte-compatible+zero-knowledge+envelope.\u0026amp;theme=907e4395bac9d9ffff169ca5\u0026amp;signature=6de53525a8c742b8a0be6b3efd9462139de2d0675c21bca2abf9626206ed6e76\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/singularitylayer/ybPcGxBBgKGneN4a/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"x402 Singularity Layer\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#50A7E3\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.x402layer.cc/cloud/vault/api-sdks\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cloud/vault/api-sdks.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.x402layer.cc/#organization\",\"name\":\"x402 Singularity Layer\",\"url\":\"https://docs.x402layer.cc\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/singularitylayer/UUMXGfdtSU8sd_LO/images/sgl-logo.webp?fit=max\u0026auto=format\u0026n=UUMXGfdtSU8sd_LO\u0026q=85\u0026s=8859fac8d109559fc73dea8a15bc8679\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.x402layer.cc#website\",\"name\":\"x402 Singularity Layer\",\"url\":\"https://docs.x402layer.cc\",\"publisher\":{\"@id\":\"https://docs.x402layer.cc/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.x402layer.cc/cloud/vault/api-sdks#webpage\",\"url\":\"https://docs.x402layer.cc/cloud/vault/api-sdks\",\"name\":\"Agent Vault — API \u0026 SDKs\",\"description\":\"Integrate Agent Vault from your own stack — REST API, TypeScript SDK, and Python SDK, all sharing one byte-compatible zero-knowledge envelope.\",\"dateModified\":\"2026-08-21T19:32:42.905Z\",\"isPartOf\":{\"@id\":\"https://docs.x402layer.cc#website\"},\"breadcrumb\":{\"@id\":\"https://docs.x402layer.cc/cloud/vault/api-sdks#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.x402layer.cc/cloud/vault/api-sdks#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Singularity Cloud Network\",\"item\":\"https://docs.x402layer.cc/cloud/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Agent Vault\",\"item\":\"https://docs.x402layer.cc/cloud/vault/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Agent Vault — API \u0026 SDKs\",\"item\":\"https://docs.x402layer.cc/cloud/vault/api-sdks\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.x402layer.cc/cloud/vault/api-sdks#article\",\"headline\":\"Agent Vault — API \u0026 SDKs\",\"name\":\"Agent Vault — API \u0026 SDKs\",\"description\":\"Integrate Agent Vault from your own stack — REST API, TypeScript SDK, and Python SDK, all sharing one byte-compatible zero-knowledge envelope.\",\"url\":\"https://docs.x402layer.cc/cloud/vault/api-sdks\",\"mainEntityOfPage\":{\"@id\":\"https://docs.x402layer.cc/cloud/vault/api-sdks#webpage\"},\"dateModified\":\"2026-08-21T19:32:42.905Z\",\"publisher\":{\"@id\":\"https://docs.x402layer.cc/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.x402layer.cc#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"x402 Singularity Layer\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"x402 Singularity Layer\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/cloud/vault/api-sdks.md","siteName":"x402 Singularity Layer","nav":{"global":{"anchors":[{"anchor":"Studio","icon":"book-open-cover","href":"https://studio.x402layer.cc"},{"anchor":"Singularity Compute","icon":"server","href":"https://x402compute.cc"},{"anchor":"Website","icon":"globe","href":"https://x402layer.cc"},{"anchor":"SDK","icon":"github","href":"https://github.com/ivaavimusic/Singularity-SDK"}]},"tabs":[{"tab":"Guides","groups":[{"group":"Overview","pages":[{"title":"Documentation","href":""},{"title":"SDKs \u0026 Packages","href":"/sdks"}]},{"group":"User Guide","pages":[{"title":"Getting Started","href":"/user-guide/getting-started"},{"title":"Dashboard Overview","href":"/user-guide/dashboard"},{"title":"Wallet Connection","href":"/user-guide/wallet-connection"},{"title":"Creating Endpoints","href":"/user-guide/creating-endpoints"},{"title":"Managing Credits","href":"/user-guide/managing-credits"},{"title":"Products \u0026 Payment Links","href":"/user-guide/products-payment-links"},{"title":"Components Library","href":"/user-guide/components"},{"title":"Marketplace","href":"/user-guide/marketplace"}]},{"group":"Slayer Agent","pages":[{"title":"Slayer Agent","href":"/ai-tools/slayer-ai"},{"title":"Slayer on the Dashboard","href":"/ai-tools/slayer-dashboard"},{"title":"Slayer on the Marketplace","href":"/ai-tools/slayer-marketplace"}]},{"group":"Core flows","pages":[{"title":"Agentic Access: Introduction","href":"/agentic-access/introduction"},{"title":"Pay-Per-Request","href":"/agentic-access/pay-per-request"},{"title":"Credit-Based Access","href":"/agentic-access/credit-based"},{"title":"Marketplace API","href":"/agentic-access/marketplace"},{"title":"Flow Planner API","href":"/agentic-access/flow-planner-api"},{"title":"Agent Management API","href":"/agentic-access/agent-management"},{"title":null,"href":"/agentic-access/mcp-server"}]},{"group":"Staking Engine","pages":[{"title":"Staking Overview","href":"/staking/introduction"},{"group":"Concepts","pages":[{"title":"Why Stake $SGL","href":"/staking/concepts/why-stake"},{"title":"Positions \u0026 Accounts","href":"/staking/concepts/positions"},{"title":"Cooldowns","href":"/staking/concepts/cooldowns"}]},{"group":"Staker Types","pages":[{"title":"Choosing a Tier","href":"/staking/types/overview"},{"title":"Compute Node","href":"/staking/types/compute"},{"title":"Validator","href":"/staking/types/validator"},{"title":"Yield Enjoyer","href":"/staking/types/yield"}]},{"group":"Staking \u0026 Unstaking","pages":[{"title":"Stake","href":"/staking/lifecycle/stake"},{"title":"Top Up","href":"/staking/lifecycle/top-up"},{"title":"Unstake \u0026 Cooldown","href":"/staking/lifecycle/unstake"},{"title":"Withdraw","href":"/staking/lifecycle/withdraw"}]},{"group":"Rewards","pages":[{"title":"How Rewards Work","href":"/staking/rewards/overview"},{"title":"Revenue Split","href":"/staking/rewards/split"},{"title":"Your Share","href":"/staking/rewards/your-share"},{"title":"Claiming","href":"/staking/rewards/claiming"}]},{"group":"Slashing \u0026 Safety","pages":[{"title":"Non-Custodial Design","href":"/staking/safety/non-custodial"},{"title":"Slashing","href":"/staking/safety/slashing"},{"title":"What's Never Slashed","href":"/staking/safety/protections"}]},{"group":"Agentic Access","pages":[{"title":"Prepare → Sign → Submit","href":"/staking/agentic/overview"},{"title":"Quickstart","href":"/staking/agentic/quickstart"},{"title":"API Reference","href":"/staking/agentic/reference"}]}]},{"group":"Singularity Cloud Network","pages":[{"title":"Singularity Cloud Network","href":"/cloud/introduction"},{"title":"Resources \u0026 Links","href":"/cloud/resources"},{"group":"Concepts","pages":[{"title":"Confidential Compute","href":"/cloud/concepts/confidential-compute"},{"title":"Billing — Credits \u0026 x402","href":"/cloud/concepts/billing"},{"title":"Wallet \u0026 Authentication","href":"/cloud/concepts/wallet-auth"}]},{"group":"SGL Grid","pages":[{"title":"SGL Grid — Overview","href":"/cloud/grid/overview"},{"title":"Models","href":"/cloud/grid/models"},{"title":"Multimodal embeddings","href":"/cloud/grid/embeddings"},{"title":"Speech-to-text transcription","href":"/cloud/grid/transcription"},{"title":"Image generation","href":"/cloud/grid/image"},{"title":"Image generation: content rules","href":"/cloud/grid/image-policy"},{"title":"Laya / System One","href":"/cloud/grid/systemone"},{"title":"Playground (Chat)","href":"/cloud/grid/playground"},{"title":"API (OpenAI-compatible)","href":"/cloud/grid/api"},{"title":"API (Anthropic-compatible)","href":"/cloud/grid/anthropic-api"},{"title":"Claude Code on the Grid","href":"/cloud/grid/claude-code"},{"title":"Confidential Inference","href":"/cloud/grid/confidential-inference"},{"title":"Pricing","href":"/cloud/grid/pricing"},{"title":"Staking metrics","openapi":"GET /grid/staking/metrics","href":"/api-reference/grid-staking-metrics"},{"title":"List nodes for a wallet","openapi":"GET /grid/nodes","href":"/api-reference/grid-nodes"},{"title":"Operator claimable rewards","openapi":"GET /grid/rewards/claimable","href":"/api-reference/grid-rewards-claimable"}]},{"group":"SGL Machines","pages":[{"title":"SGL Machines — Overview","href":"/cloud/machines/overview"},{"title":"Server Catalog","href":"/cloud/machines/catalog"},{"title":"Deploy a Machine","href":"/cloud/machines/deploy"},{"title":"AI Machines","href":"/cloud/machines/ai-machines"},{"title":"Manage Instances","href":"/cloud/machines/manage"}]},{"group":"Agent Pods","pages":[{"title":"Agent Pods — Overview","href":"/cloud/pods/overview"},{"title":"Deploy a Pod","href":"/cloud/pods/deploy"},{"title":"Pi pod","href":"/cloud/pods/pi"},{"title":"Manage a Pod","href":"/cloud/pods/manage"},{"title":"Models","href":"/cloud/pods/models"},{"title":"Pod Wallet","href":"/cloud/pods/wallet"},{"title":"Pod Memory","href":"/cloud/pods/memory"},{"title":"Pod Scheduler","href":"/cloud/pods/scheduler"},{"title":"OpenAI-compatible Access","href":"/cloud/pods/openai-adapter"},{"title":"Sandbox API","href":"/cloud/pods/sandbox"},{"title":"Coding sandbox from anywhere","href":"/cloud/pods/coding-sandbox"},{"title":"Coding sandboxes for your platform","href":"/cloud/pods/sandboxes-for-platforms"},{"title":"Pods API","href":"/cloud/pods/api"}]},{"group":"Agent Vault","pages":[{"title":"Agent Vault — Overview","href":"/cloud/vault/overview"},{"title":"Agent Vault — CLI","description":"Back up, restore, and migrate agents from the terminal with the agentvault CLI — browser wallet login, scheduled backups, safe restores.","href":"/cloud/vault/cli"},{"title":"Agent Vault — API \u0026 SDKs","href":"/cloud/vault/api-sdks"}]},{"group":"Datasets","pages":[{"title":"Datasets for agents (x402)","description":"Buy a synthetic fine-tuning dataset with a wallet and no account. Ask, get a 402 with the exact price, pay, poll, download. Base, Solana, Robinhood Chain and MegaETH.","href":"/cloud/datasets/agents"}]},{"group":"Training Lab","pages":[{"title":"Training Lab","href":"/cloud/training/overview"},{"title":"Training Lab API","href":"/cloud/training/api"},{"title":"Training over x402","href":"/cloud/training/agents"}]},{"group":"SGL Processors","pages":[{"title":"Overview","href":"/cloud/processors/overview"},{"title":"Quickstart","href":"/cloud/processors/quickstart"},{"title":"State and secrets","href":"/cloud/processors/state"},{"title":"Pricing","href":"/cloud/processors/pricing"},{"title":"From an agent (MCP)","href":"/cloud/processors/mcp"},{"title":"Webhooks","href":"/cloud/processors/webhooks"}]},{"group":"SDKs","pages":[{"title":"SDKs — Overview","href":"/cloud/sdk/overview"},{"title":"TypeScript SDK","href":"/cloud/sdk/typescript"},{"title":"Python SDK","href":"/cloud/sdk/python"}]},{"group":"Provide Compute","pages":[{"title":"Provide Compute — Overview","href":"/cloud/provide/overview"},{"title":"Requirements","href":"/cloud/provide/requirements"},{"title":"Node Setup","href":"/cloud/provide/node-setup"},{"title":"Singularity Node desktop app","href":"/cloud/provide/desktop-app"},{"title":"Node CLI Reference","href":"/cloud/provide/cli"},{"title":"Staking to Operate","href":"/cloud/provide/staking"},{"title":"Earnings \u0026 Payouts","href":"/cloud/provide/earnings"}]}]},{"group":"Contract Addresses","pages":[{"title":"Contract Addresses","href":"/on-chain/contract-addresses"}]},{"group":"ERC8004","pages":[{"title":"ERC-8004: Agent Identity","href":"/agentic-access/erc8004-registration"}]},{"group":"Skills","pages":[{"title":"Singularity Skill","href":"/agentic-access/singularity-skill"},{"title":"OpenClaw x402-Layer Skill","href":"/agentic-access/openclaw-skill"},{"title":"OpenClaw x402-Compute Skill","href":"/agentic-access/x402-compute"}]},{"group":"Singularity Payments","pages":[{"title":"Webhooks","href":"/payments/webhooks"},{"title":"SDK \u0026 Receipts","href":"/payments/sdk-receipts"}]},{"group":"Agentic Fundraisers","pages":[{"title":"Agentic Fundraisers","href":"/fundraisers/introduction"},{"title":"Token Launch","href":"/fundraisers/token-launch"},{"title":"Fee Distribution","href":"/fundraisers/fee-distribution"},{"title":"Fundraiser API Reference","href":"/fundraisers/api-reference"}]},{"group":"Enterprise","pages":[{"title":"Enterprise Partners","href":"/enterprise/introduction"},{"title":"Getting Started","href":"/enterprise/getting-started"},{"title":"Enterprise API Reference","href":"/enterprise/api-reference"},{"title":"Revenue Splits","href":"/enterprise/revenue-splits"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]}]},"basePath":"","title":"Agent Vault — API \u0026 SDKs - x402 Singularity Layer","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":[],"chunks":[]}