Use the official TypeScript SDK to verify Phala Private AI attestation, pin the TLS channel, and audit signed response receipts.
@phala/aci-verifier is the official TypeScript implementation of the ACI
client checks. Node.js and Bun applications can use it to establish an
instance-scoped, SPKI-pinned connection before sending model traffic. The
package is ESM-only and supports Node.js 20.18.1 or newer and Bun 1.4.0 or
newer.
connectAci() verifies a fresh nonce-bound workload report and creates a
hostname-validated TLS transport pinned to the attested SPKI. Its scoped
fetch rejects non-HTTPS and cross-origin requests, expired workload
identities, TLS key mismatches, and missing receipt ids, and requires verified
serving in JSON inference requests.
The runtime records the exact request and response wire digests while the body
is consumed. Call verifyReceipt() after the response finishes to fetch and
verify the latest signed receipt, including its signature, request and response body_hash values,
verified upstream status, and cited session. Pass a receipt id returned by
aci.receipts() to audit another retained exchange.The default local history is the latest 32 receipt-bearing requests and exists
only for the current process. Gateway receipts and sessions follow the
deployment’s server-side retention policy.
The low-level SDK does not automatically call verifyReceipt() for every
response. Applications must make that call before accepting a result.
Private AI Proxy audits every receipt automatically after delivery.
The browser export can verify attestation and receipt documents, but browser
JavaScript cannot observe the server certificate SPKI. It therefore cannot
enforce the same pinned transport by itself. Use the Node.js or Bun runtime
export when the application must bind model traffic to the attested TLS key.
The SDK does not check whether the gateway runs a production or development
dstack OS image. For OS-image assurance, verify the same quote, event log, and
VM configuration with an independent dstack verifier
and require is_valid: true.Attestation proves which compose hash was measured, but not that your
organization reviewed that release. When you have an authenticated allowlist,
pass its hashes as policy.acceptedComposeHashes. Never copy a hash from the
endpoint and trust it on first use.Each production release of the gateway at inference.phala.com is published as a
gateway-prod-<date> release in
Dstack-TEE/private-ai-gateway.
It lists the compose hash, OS and KMS values, and TLS keys, and attaches the exact
measured app_compose.json so you can recompute the compose hash yourself. A change
to these values is published as a prerelease at least 3 days before the rollout,
or sooner for an urgent change, with the reason in the release.
KMS values are the exception: mr-kms is recorded when a replica boots and can
change without notice, so pin the KMS root key instead. The
release measurements page
lists the current values and the full notice policy.Without a compose allowlist, the client verifies that the measured compose ran
in a genuine TDX workload. It does not claim that Phala reviewed that release.
For a production security decision, pair compose appraisal with a dstack
verifier result for the same quote, event log, and VM configuration, and require
is_valid: true.For the complete API and security limits, see the
@phala/aci-verifier package documentation.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Phala","colors":{"primary":"#527a08","light":"#527a08","dark":"#cdfa50"},"logo":{"light":"https://mintcdn.com/phalanetwork-1606097b/Y2wR1-jOsoYpAL6q/images/phala-light.png?fit=max\u0026auto=format\u0026n=Y2wR1-jOsoYpAL6q\u0026q=85\u0026s=fb4f438a36865810867d188289681376","dark":"https://mintcdn.com/phalanetwork-1606097b/Y2wR1-jOsoYpAL6q/images/phala-dark.png?fit=max\u0026auto=format\u0026n=Y2wR1-jOsoYpAL6q\u0026q=85\u0026s=c80d03f4a9b6db1a9aa8f435a980a7a3"},"favicon":"https://mintcdn.com/phalanetwork-1606097b/RUscSf7Rplq7j02n/favicon.ico?fit=max\u0026auto=format\u0026n=RUscSf7Rplq7j02n\u0026q=85\u0026s=701b1391404cffa588fcc80dd945d79e","navbar":{"links":[{"href":"https://github.com/Phala-Network/phala-cloud","label":"GitHub"},{"href":"https://cloud.phala.com/login","label":"Log in"}],"primary":{"type":"button","label":"API Dashboard","href":"https://cloud.phala.com"}},"footer":{"socials":{"discord":"https://phala.com/discord","github":"https://phala.com/github","linkedin":"https://phala.com/linkedin","x":"https://phala.com/x"},"links":[{"header":"Phala Cloud","items":[{"label":"Getting Started","href":"https://docs.phala.network/phala-cloud/getting-started/overview"},{"label":"TEEs, Attestation \u0026 Zero Trust Security","href":"https://docs.phala.network/phala-cloud/attestation/overview"},{"label":"Phala Cloud User Guides","href":"https://docs.phala.network/phala-cloud/phala-cloud-user-guides/create-cvm/overview"},{"label":"Be Production Ready","href":"https://docs.phala.network/phala-cloud/be-production-ready/overview"},{"label":"Use Cases","href":"https://docs.phala.network/phala-cloud/use-cases/overview"},{"label":"References","href":"https://docs.phala.network/phala-cloud/references/overview"},{"label":"Private AI","href":"https://docs.phala.network/phala-cloud/gpu-tee/llm-in-tee"},{"label":"FAQs","href":"https://docs.phala.network/phala-cloud/faqs"}]},{"header":"dstack","items":[{"label":"Overview","href":"https://docs.phala.network/dstack/overview"},{"label":"Local Development","href":"https://docs.phala.network/dstack/local-development"},{"label":"Getting Started","href":"https://docs.phala.network/dstack/getting-started"},{"label":"Hardware Requirements","href":"https://docs.phala.network/dstack/hardware-requirements"},{"label":"Acknowledgement","href":"https://docs.phala.network/dstack/acknowledgement"},{"label":"FAQs","href":"https://docs.phala.network/dstack/faqs"},{"label":"Design Documents","href":"https://docs.phala.network/dstack/design-documents"},{"label":"Cloud Overview","href":"https://docs.phala.network/dstack-cloud/overview"},{"label":"Cloud Quick Start","href":"https://docs.phala.network/dstack-cloud/get-started"}]},{"header":"Private AI","items":[{"label":"LLM in GPU TEE","href":"https://docs.phala.network/phala-cloud/confidential-ai/overview"},{"label":"GPU TEE Inference API","href":"https://docs.phala.network/phala-cloud/confidential-ai/confidential-model/confidential-ai-api"},{"label":"Benchmark","href":"https://docs.phala.network/phala-cloud/confidential-ai/benchmark"},{"label":"FAQs","href":"https://docs.phala.network/phala-cloud/confidential-ai/faqs"}]},{"header":"Network","items":[{"label":"Overview","href":"https://docs.phala.network/network/index"},{"label":"Phala Network","href":"https://docs.phala.network/network/overview/phala-network"},{"label":"Staking","href":"https://docs.phala.network/network/overview/phala-staking"},{"label":"Compute Providers","href":"https://docs.phala.network/network/compute-providers/introduction"}]}]},"seo":{"metatags":{"author":"Phala Cloud","canonical":"https://docs.phala.com","category":"Technology","distribution":"global","keywords":"Phala Cloud, TEE, Trusted Execution Environment, Confidential Computing, Private AI, confidential AI, GPU TEE, Intel TDX, dstack, blockchain, privacy-preserving computing, secure cloud, attestation","language":"en","og:image":"https://raw.githubusercontent.com/Phala-Network/phala-docs/main/images/phala-docs-og.png","og:image:alt":"Phala Cloud — Confidential Computing \u0026 GPU TEE for AI","og:image:width":"1200","og:image:height":"630","og:site_name":"Phala Docs","og:type":"website","og:title":"Phala Cloud Documentation — Private AI on TEE","og:description":"Deploy confidential AI applications on Phala Cloud with hardware-level privacy via Intel TDX, NVIDIA H100 GPU TEE, and verifiable attestation.","robots":"index, follow","twitter:card":"summary_large_image","twitter:creator":"@PhalaNetwork","twitter:site":"@PhalaNetwork","twitter:image":"https://raw.githubusercontent.com/Phala-Network/phala-docs/main/images/phala-docs-og.png","twitter:title":"Phala Cloud Documentation — Private AI on TEE","twitter:description":"Deploy confidential AI applications on Phala Cloud with hardware-level privacy via Intel TDX, NVIDIA H100 GPU TEE, and verifiable attestation."},"indexing":"all"},"icons":{"library":"lucide"},"styling":{"codeblocks":"system","latex":true},"integrations":{"ga4":{"measurementId":"G-RHRW9RL5LG"},"gtm":{"tagId":"GTM-TX3VQZP"}},"errors":{"404":{"redirect":false}},"contextual":{"options":["copy","view","chatgpt","claude","mcp"],"display":"header"},"thumbnails":{"background":"https://mintcdn.com/phalanetwork-1606097b/Z_xV6g4Cdei2rfqm/images/phala-docs-og.png?fit=max\u0026auto=format\u0026n=Z_xV6g4Cdei2rfqm\u0026q=85\u0026s=e0d65106aa4afa7766452b497d5ec9ca"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"phalanetwork-1606097b","hasAudioNarration":false,"actualSubdomain":"phalanetwork-1606097b","customDomains":["docs.phala.com"],"gitSource":{"type":"github","owner":"phala-network","repo":"phala-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{},"buildId":"6aef6c6fd5518ba96e46813a","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"Phala Cloud","count":652},{"language":"default","tag":"API \u0026 SDK","count":163},{"language":"default","tag":"Phala Cloud API","count":110},{"language":"default","tag":"Private AI","count":100},{"language":"default","tag":"Phala Cloud CLI","count":85},{"language":"default","tag":"CVMs","count":54},{"language":"default","tag":"Resources","count":42},{"language":"default","tag":"dstack Cloud","count":22},{"language":"default","tag":"JavaScript SDK","count":22},{"language":"default","tag":"Apps","count":20}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","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":"llms-txt-v2","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":"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":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"fonts.css","content":"@font-face{font-family:\"ABCArizonaFlare\";src:url(\"/fonts/exa/ABCArizonaFlare-Regular.woff2\") format(\"woff2\");font-style:normal;font-weight:400 700;font-display:block}@font-face{font-family:\"ABCDiatype\";src:url(\"/fonts/exa/ABCDiatype-Regular.woff2\") format(\"woff2\");font-style:normal;font-weight:400 700;font-display:block}@font-face{font-family:\"SuisseIntlMono\";src:url(\"/fonts/exa/SuisseIntlMono-Regular-WebTrial.woff2\") format(\"woff2\");font-style:normal;font-weight:400 700;font-display:block}@font-face{font-family:\"ABCArizonaFlare Fallback\";src:local(\"Georgia\"), local(\"Times New Roman\");size-adjust:94%;ascent-override:95%;descent-override:22%;line-gap-override:0%}@font-face{font-family:\"ABCDiatype Fallback\";src:local(\"Trebuchet MS\"), local(\"Arial\");size-adjust:97%;ascent-override:92%;descent-override:23%;line-gap-override:0%}@font-face{font-family:\"SuisseIntlMono Fallback\";src:local(\"SFMono-Regular\"), local(\"Consolas\"), local(\"Menlo\"),\n local(\"Liberation Mono\");size-adjust:100%;ascent-override:90%;descent-override:22%;line-gap-override:0%}:root{--v3-heading: \"ABCArizonaFlare\", \"ABCArizonaFlare Fallback\", Georgia, serif;--v3-body: \"ABCDiatype\", \"ABCDiatype Fallback\", \"Trebuchet MS\", Arial,\n sans-serif;--v3-mono: \"SuisseIntlMono\", \"SuisseIntlMono Fallback\", \"SFMono-Regular\",\n Consolas, monospace}body,input,button,select,textarea{font-family:var(--v3-body)}h1,h2{font-family:var(--v3-heading);font-weight:400;letter-spacing:0}h3,h4,h5,h6{font-family:var(--v3-body);font-weight:600;letter-spacing:0}code,pre,kbd,samp,.font-mono{font-family:var(--v3-mono)}"},{"filePath":"style.css","content":":root{--base-50: oklch(0.983 0.0034 145.55);--base-100: oklch(0.9691 0.0037 146.57);--base-200: oklch(0.9258 0.0048 147.01);--base-300: oklch(0.869 0.0054 148);--base-400: oklch(0.7067 0.0061 149.29);--base-500: oklch(0.5535 0.0066 150.55);--base-600: oklch(0.4449 0.0065 151.33);--base-700: oklch(0.3731 0.0059 150.75);--base-800: oklch(0.2731 0.0051 150.35);--base-900: oklch(0.2123 0.0048 151.01);--base-950: oklch(0.1386 0.0044 150.49);--base-1000: oklch(0.0909 0.0041 150.95);--primary-300: #cdfa50;--primary-500: oklch(0.7708 0.2308 126.52);--primary-600: oklch(0.6514 0.1967 127.14);--primary-700: oklch(0.5343 0.1568 126.91);--phala-blue-50: #f0f2ff;--phala-blue-100: #d5dbf8;--phala-blue-200: #bfc8f0;--phala-blue-300: #aabbff;--phala-blue-500: #6b80cc;--phala-blue-900: #2d3250;--phala-purple-300: #b88fd0;--phala-purple-500: #7e3daf;--phala-orange-300: #f5902c;--surface-marketing: #f7f8f3;--surface-marketing-cool: #f0f1ec;--surface-marketing-light: #fbfcf8;--surface-trust-path: #070908;--surface-trust-card: #101310;--radius: 4px}button,a[role=\"button\"],.btn,[class*=\"button\"]{border-radius:4px!important}[class*=\"Card\"],[class*=\"Callout\"],[class*=\"Note\"],[class*=\"Warning\"],[class*=\"Tip\"],[class*=\"Info\"],[class*=\"Frame\"],[class*=\"Update\"],pre,.code,.callout,.card{border-radius:0!important}[class*=\"badge\"]:not([class*=\"dot\"]),[class*=\"Badge\"]:not([class*=\"Dot\"]),[class*=\"pill\"],[class*=\"Pill\"]{border-radius:4px!important}[class*=\"Card\"]:not([class*=\"card-group\"]),[class*=\"Callout\"],[class*=\"Note\"],[class*=\"Warning\"],[class*=\"Tip\"],[class*=\"Info\"],[class*=\"Frame\"],[class*=\"Update\"],.callout,.card{box-shadow:none!important;border-width:1px!important}.card-group,[class*=\"card-group\"]{border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;border-radius:0!important;gap:1px!important}a[role=\"button\"],.btn,button.button,button[data-component=\"button\"]{min-height:44px;padding-inline:1rem;border-radius:4px!important;box-shadow:none!important;font-family:var(--v3-body, \"ABCDiatype\", \"Trebuchet MS\", Arial, sans-serif);font-weight:500;letter-spacing:0;transition:opacity 150ms ease, background-color 150ms ease,\n border-color 150ms ease}a[role=\"button\"]:hover,.btn:hover,button.button:hover,button[data-component=\"button\"]:hover{opacity:0.9;box-shadow:none!important}button{border-radius:4px!important}@media (min-width: 1024px){#sidebar,aside[id=\"sidebar\"],aside.sidebar,[class*=\"sidebar-content\"]{padding-top:1rem!important}}.sidebar-group-header{font-family:var(--v3-body, \"ABCDiatype\", sans-serif)!important;font-size:14px!important;font-weight:600!important;letter-spacing:0!important;color:var(--base-800)!important;margin-top:1.75rem!important;margin-bottom:0.5rem!important}.sidebar-group-header:first-child{margin-top:0!important}.dark .sidebar-group-header,[data-theme=\"dark\"] .sidebar-group-header{color:var(--base-100)!important}li[id^=\"/\"]>a,li[data-title]>a,.sidebar-group li>a,.sidebar-group li>button{font-size:13.5px!important;font-weight:400!important;color:var(--base-600)!important;border-radius:4px!important;outline:0!important;outline-offset:0!important}li[id^=\"/\"]>a:hover,li[data-title]>a:hover,.sidebar-group li>a:hover,.sidebar-group li>button:hover{color:var(--primary-700)!important;background-color:rgba(0, 0, 0, 0.03)!important}li[id^=\"/\"]>a:hover svg,li[data-title]>a:hover svg,.sidebar-group li>a:hover svg,.sidebar-group li>button:hover svg{color:var(--primary-700)!important;background-color:var(--primary-700)!important}.dark li[id^=\"/\"]>a,.dark li[data-title]>a,[data-theme=\"dark\"] li[id^=\"/\"]>a{color:var(--base-400)!important}.dark li[id^=\"/\"]>a:hover,.dark li[data-title]>a:hover,[data-theme=\"dark\"] li[id^=\"/\"]>a:hover{color:var(--primary-300)!important;background-color:rgba(255, 255, 255, 0.05)!important}li[data-active=\"true\"]>a,a[aria-current=\"page\"]{background-color:var(--surface-marketing-cool)!important;background-image:none!important;color:var(--base-800)!important;font-weight:500!important;text-shadow:none!important;border-radius:4px!important;--tw-bg-opacity: 1 !important}li[data-active=\"true\"]>a:hover{background-color:var(--surface-marketing-cool)!important;color:var(--base-800)!important}.dark li[data-active=\"true\"]>a,.dark a[aria-current=\"page\"],[data-theme=\"dark\"] li[data-active=\"true\"]>a{background-color:rgba(255, 255, 255, 0.08)!important;color:var(--base-100)!important}.nav-tabs-item[data-active=\"true\"],a.nav-tabs-item[data-active=\"true\"]{color:var(--primary-700)!important}@media (min-width: 768px){#table-of-contents-layout{display:flex!important}}#table-of-contents-layout{border-left:1px solid var(--base-200);padding-left:1.25rem!important}.dark #table-of-contents-layout,[data-theme=\"dark\"] #table-of-contents-layout{border-left-color:var(--base-800)}#table-of-contents h2{font-size:14px!important;margin:0!important}#table-of-contents>button,#table-of-contents h2 button,#table-of-contents-layout #table-of-contents>:first-child:not(nav):not(ul):not(ol),#table-of-contents-layout>:first-child:not(:has(#table-of-contents)):not(nav):not(ul):not(ol),#table-of-contents-layout>:first-child>:first-child:not(#table-of-contents):not(nav):not(ul):not(ol){font-family:var(--font-sans, \"Inter\", system-ui, sans-serif)!important;font-size:14px!important;line-height:1.25rem!important;font-weight:500!important;letter-spacing:0!important;text-transform:none!important;color:var(--base-600)!important}#table-of-contents-layout #table-of-contents>:first-child:not(nav):not(ul):not(ol) :is(span,div,p,h2,h3,h4,h5,h6),#table-of-contents-layout>:first-child:not(:has(#table-of-contents)):not(nav):not(ul):not(ol) :is(span,div,p,h2,h3,h4,h5,h6),#table-of-contents-layout>:first-child>:first-child:not(#table-of-contents):not(nav):not(ul):not(ol) :is(span,div,p,h2,h3,h4,h5,h6){font:inherit!important;letter-spacing:inherit!important;text-transform:inherit!important;color:inherit!important;line-height:inherit!important}.toc-item>a{font-size:13px!important;letter-spacing:0!important;text-transform:none!important;font-family:var(--font-sans, \"Inter\", system-ui, sans-serif)!important;color:var(--base-600)!important}.toc-item>a:hover{color:var(--base-800)!important}.toc-item.is-active>a,.toc-item[data-active=\"true\"]>a,.toc a[aria-current=\"true\"]{color:var(--primary-700)!important;font-weight:500!important}.toc-item[data-depth=\"1\"]{padding-left:1rem}.dark .toc-item>a,[data-theme=\"dark\"] .toc-item>a{color:var(--base-400)!important}.eyebrow,.eyebrow.text-primary,[class*=\"eyebrow\"][class*=\"text-primary\"]{color:var(--primary-600)!important}.dark .eyebrow,.dark .eyebrow.text-primary,[data-theme=\"dark\"] .eyebrow{color:var(--primary-300)!important}article .text-primary,article [class~=\"text-primary\"],article [class*=\"text-primary\"]:not([class*=\"dark:\"]),main .text-primary,main [class~=\"text-primary\"]{color:var(--primary-700)!important}html:not(.dark) body:not(.dark) :is(main,article) [class*=\"cdfa50\"],html:not(.dark) body:not(.dark) :is(main,article) [style*=\"cdfa50\"i]{color:var(--primary-700)!important}article .bg-primary,article [class~=\"bg-primary\"],article [class*=\"bg-primary\"]:not([class*=\"dark:\"]),main .bg-primary,main [class~=\"bg-primary\"]{background-color:var(--primary-700)!important}.dark article .text-primary,.dark article [class~=\"text-primary\"],[data-theme=\"dark\"] article .text-primary,[data-theme=\"dark\"] article [class~=\"text-primary\"],.dark main .text-primary,[data-theme=\"dark\"] main .text-primary{color:var(--primary-300)!important}.dark article .bg-primary,.dark article [class~=\"bg-primary\"],[data-theme=\"dark\"] article .bg-primary,[data-theme=\"dark\"] article [class~=\"bg-primary\"],.dark main .bg-primary,[data-theme=\"dark\"] main .bg-primary{background-color:var(--primary-300)!important}main,article,[class*=\"content\"],[class*=\"Content\"]{max-width:100%}:is(main,article) h1{font-size:32px!important;line-height:1.16!important;font-weight:500!important;letter-spacing:0!important;margin-bottom:1rem!important}:is(main,article) h2{font-size:22px!important;line-height:1.26!important;font-weight:500!important;letter-spacing:0!important;margin-top:2.25rem!important;margin-bottom:0.85rem!important}:is(main,article) h3{font-size:18px!important;line-height:1.3!important;font-weight:600!important;letter-spacing:0!important;margin-top:1.75rem!important;margin-bottom:0.65rem!important}:is(main,article) h4,:is(main,article) h5,:is(main,article) h6{font-weight:600!important;letter-spacing:0!important}p,li{font-size:15px;line-height:1.65}:not(pre)>code{font-family:var(--v3-mono, \"SuisseIntlMono\", monospace);font-size:0.92em;border:1px solid var(--base-200);border-radius:2px;padding:1px 5px}pre{border-radius:0!important;font-family:var(--v3-mono, \"SuisseIntlMono\", monospace);font-size:13px;line-height:1.6}.code-block,div[class~=\"code-block\"],.code-group,div[class~=\"code-group\"]{border-radius:0!important;box-shadow:none!important;overflow:hidden!important}.code-block-background,[class*=\"code-block-background\"],.code-group{border-radius:0!important;box-shadow:none!important;background-color:var(--phala-blue-50)!important}.code-block-background,[class*=\"code-block-background\"]{border:0!important}.dark .code-block-background,.dark .code-group,[data-theme=\"dark\"] .code-block-background,[data-theme=\"dark\"] .code-group{background-color:var(--surface-trust-card)!important}.code-group [role=\"tab\"][data-state=\"active\"],.code-group [role=\"tab\"][aria-selected=\"true\"]{color:var(--primary-600)!important}.code-group [role=\"tab\"][data-state=\"active\"]>div:first-child{color:var(--primary-600)!important}.code-group [role=\"tab\"][data-state=\"active\"]>div.absolute,.code-group [role=\"tab\"][data-state=\"active\"]>div[class*=\"absolute\"][class*=\"bottom\"]{background-color:var(--primary-600)!important;border-radius:0!important}.dark .code-group [role=\"tab\"][data-state=\"active\"],[data-theme=\"dark\"] .code-group [role=\"tab\"][data-state=\"active\"]{color:var(--primary-300)!important}.dark .code-group [role=\"tab\"][data-state=\"active\"]>div.absolute,[data-theme=\"dark\"] .code-group [role=\"tab\"][data-state=\"active\"]>div.absolute{background-color:var(--primary-300)!important}[data-fade-overlay]{display:none!important}.card{border-radius:0!important;box-shadow:none!important;--tw-ring-shadow: 0 0 #0000 !important;--tw-ring-offset-shadow: 0 0 #0000 !important}.card:hover{box-shadow:none!important;border-color:var(--primary-600)!important}.card svg.bg-primary,.card svg[class*=\"bg-primary\"]:not([class*=\"primary-light\"]),.card .text-primary{background-color:var(--primary-600)!important;color:var(--primary-600)!important}.dark .card svg.bg-primary,.dark .card svg[class*=\"bg-primary\"],[data-theme=\"dark\"] .card svg.bg-primary{background-color:var(--primary-300)!important;color:var(--primary-300)!important}.callout{border-radius:0!important;background-color:var(--card, #ffffff)!important;border-width:0!important;border-left:4px solid var(--phala-blue-500)!important;padding:1rem 1.25rem!important;box-shadow:none!important}.callout[data-callout-type=\"warning\"]{border-left-color:var(--phala-orange-300)!important}.callout[data-callout-type=\"info\"]{border-left-color:var(--phala-blue-500)!important}.callout[data-callout-type=\"tip\"]{background-color:var(--phala-blue-300)!important;border-left-color:var(--phala-blue-500)!important}.callout [data-component-part=\"callout-content\"],.callout [data-component-part=\"callout-content\"] *{color:var(--base-800)!important}.callout [data-component-part=\"callout-content\"]>span:first-child>strong:only-child{font-family:var(--v3-mono, \"SuisseIntlMono\", monospace);font-size:11px;font-weight:400;letter-spacing:0.08em;text-transform:uppercase;display:block;margin-bottom:0.25rem;color:var(--base-600)!important}.callout[data-callout-type=\"warning\"] [data-component-part=\"callout-content\"] strong{font-weight:400}.callout [data-component-part=\"callout-icon\"] svg{color:var(--base-600)!important;opacity:0.7}a[href*=\"cloud.phala.com\"]>span.absolute,a[href*=\"cloud.phala.com\"]>span[class*=\"absolute\"][class*=\"inset-0\"]{background-color:var(--primary-300)!important;background-image:none!important;border-radius:4px!important;box-shadow:none!important}a[href*=\"cloud.phala.com\"] span[class*=\"text-white\"],a[href*=\"cloud.phala.com\"] .z-10{color:#000!important}a[href*=\"cloud.phala.com\"] span[class*=\"text-white\"]~svg,a[href*=\"cloud.phala.com\"] svg.text-white\\/90,a[href*=\"cloud.phala.com\"] svg[class*=\"text-white\"],a[href*=\"cloud.phala.com\"] svg path{color:#000!important;stroke:#000!important}a[href*=\"cloud.phala.com\"][target=\"_blank\"]{font-family:var(--v3-body, \"ABCDiatype\", sans-serif);font-weight:500;letter-spacing:0}a[href*=\"cloud.phala.com\"]:hover>span[class*=\"absolute\"]{opacity:0.9!important}[class*=\"Update\"] [class*=\"label\"],[class*=\"update\"] [class*=\"label\"],[class*=\"UpdateLabel\"],[class*=\"changelog\"] h2,[class*=\"Changelog\"] h2{font-family:var(--v3-mono, \"SuisseIntlMono\", monospace);font-size:12px;font-weight:400;letter-spacing:0.08em;text-transform:uppercase}table{border-collapse:collapse;border:1px solid var(--base-200)}th,td{border:1px solid var(--base-200);padding:8px 12px;font-size:14px}th{font-family:var(--v3-mono, \"SuisseIntlMono\", monospace);font-size:11px;font-weight:400;letter-spacing:0.08em;text-transform:uppercase}"}],"page":{"pagePath":"phala-cloud/confidential-ai/verify/typescript-sdk","slug":"/phala-cloud/confidential-ai/verify/typescript-sdk","pageMetadata":{"title":"TypeScript ACI Verifier","description":"Use the official TypeScript SDK to verify Phala Private AI attestation, pin the TLS channel, and audit signed response receipts.","href":"/phala-cloud/confidential-ai/verify/typescript-sdk"},"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: \"Use the official TypeScript SDK to verify Phala Private AI attestation, pin the TLS channel, and audit signed response receipts.\"\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`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Heading,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`@phala/aci-verifier`}),` is the official TypeScript implementation of the ACI\nclient checks. Node.js and Bun applications can use it to establish an\ninstance-scoped, SPKI-pinned connection before sending model traffic. The\npackage is ESM-only and supports Node.js 20.18.1 or newer and Bun 1.4.0 or\nnewer.`]}),`\n`,_jsx(Heading,{level:`2`,id:`install`,children:`Install`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @phala/aci-verifier`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` openai`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-verified-connection`,children:`Create a verified connection`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`35`,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:`35`,children:[_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\":`#9CDCFE`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"openai\"`}),_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\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`connectAci`}),_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:` \"@phala/aci-verifier/runtime\"`}),_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:` apiKey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`PHALA_AI_API_KEY`}),_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\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"PHALA_AI_API_KEY is required\"`}),_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:` aci`}),_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:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` connectAci`}),_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\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://inference.phala.com/v1\"`}),_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\":`#9CDCFE`},children:` serving:`}),_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\":`#9CDCFE`},children:` requireVerified:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_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\":`#9CDCFE`},children:` requireReceipt:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_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\":`#C586C0`},children:`try`}),_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:` client`}),_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:` OpenAI`}),_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\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` aci`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`baseURL`}),_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\":`#9CDCFE`},children:` apiKey`}),_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\":`#9CDCFE`},children:` fetch:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` aci`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` response`}),_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:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_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\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"z-ai/glm-5.3\"`}),_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\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Explain attestation.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_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:` audit`}),_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:` aci`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`verifyReceipt`}),_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\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`audit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`transcript`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`verdict`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`verified`}),_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\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`audit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`transcript`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`verdict`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`line`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_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\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_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:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`finally`}),_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\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` aci`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`close`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`connectAci()`}),` verifies a fresh nonce-bound workload report and creates a\nhostname-validated TLS transport pinned to the attested SPKI. Its scoped\n`,_jsx(_components.code,{children:`fetch`}),` rejects non-HTTPS and cross-origin requests, expired workload\nidentities, TLS key mismatches, and missing receipt ids, and requires verified\nserving in JSON inference requests.`]}),`\n`,_jsx(Heading,{level:`2`,id:`receipt-auditing`,children:`Receipt auditing`}),`\n`,_jsxs(_components.p,{children:[`The runtime records the exact request and response wire digests while the body\nis consumed. Call `,_jsx(_components.code,{children:`verifyReceipt()`}),` after the response finishes to fetch and\nverify the latest signed receipt, including its signature, request and response `,_jsx(_components.code,{children:`body_hash`}),` values,\nverified upstream status, and cited session. Pass a receipt id returned by\n`,_jsx(_components.code,{children:`aci.receipts()`}),` to audit another retained exchange.`]}),`\n`,_jsx(_components.p,{children:`The default local history is the latest 32 receipt-bearing requests and exists\nonly for the current process. Gateway receipts and sessions follow the\ndeployment’s server-side retention policy.`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The low-level SDK does not automatically call `,_jsx(_components.code,{children:`verifyReceipt()`}),` for every\nresponse. Applications must make that call before accepting a result.\nPrivate AI Proxy audits every receipt automatically after delivery.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`browser-use`,children:`Browser use`}),`\n`,_jsx(_components.p,{children:`The browser export can verify attestation and receipt documents, but browser\nJavaScript cannot observe the server certificate SPKI. It therefore cannot\nenforce the same pinned transport by itself. Use the Node.js or Bun runtime\nexport when the application must bind model traffic to the attested TLS key.`}),`\n`,_jsx(Heading,{level:`2`,id:`release-policy`,children:`Release policy`}),`\n`,_jsxs(_components.p,{children:[`The SDK does not check whether the gateway runs a production or development\ndstack OS image. For OS-image assurance, verify the same quote, event log, and\nVM configuration with an independent `,_jsx(_components.a,{href:`https://github.com/Dstack-TEE/dstack/tree/next/dstack/verifier`,children:`dstack verifier`}),`\nand require `,_jsx(_components.code,{children:`is_valid: true`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Attestation proves which compose hash was measured, but not that your\norganization reviewed that release. When you have an authenticated allowlist,\npass its hashes as `,_jsx(_components.code,{children:`policy.acceptedComposeHashes`}),`. Never copy a hash from the\nendpoint and trust it on first use.`]}),`\n`,_jsxs(_components.p,{children:[`Each production release of the gateway at `,_jsx(_components.code,{children:`inference.phala.com`}),` is published as a\n`,_jsx(_components.code,{children:`gateway-prod-\u003cdate>`}),` release in\n`,_jsx(_components.a,{href:`https://github.com/Dstack-TEE/private-ai-gateway/releases`,children:_jsx(_components.code,{children:`Dstack-TEE/private-ai-gateway`})}),`.\nIt lists the compose hash, OS and KMS values, and TLS keys, and attaches the exact\nmeasured `,_jsx(_components.code,{children:`app_compose.json`}),` so you can recompute the compose hash yourself. A change\nto these values is published as a prerelease at least 3 days before the rollout,\nor sooner for an urgent change, with the reason in the release.\nKMS values are the exception: `,_jsx(_components.code,{children:`mr-kms`}),` is recorded when a replica boots and can\nchange without notice, so pin the KMS root key instead. The\n`,_jsx(_components.a,{href:`https://docs.redpill.ai/guides/release-measurements`,children:`release measurements page`}),`\nlists the current values and the full notice policy.`]}),`\n`,_jsxs(_components.p,{children:[`Without a compose allowlist, the client verifies that the measured compose ran\nin a genuine TDX workload. It does not claim that Phala reviewed that release.\nFor a production security decision, pair compose appraisal with a dstack\nverifier result for the same quote, event log, and VM configuration, and require\n`,_jsx(_components.code,{children:`is_valid: true`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`For the complete API and security limits, see the\n`,_jsxs(_components.a,{href:`https://github.com/Dstack-TEE/private-ai-gateway/tree/main/clients/verifier-ts`,children:[_jsx(_components.code,{children:`@phala/aci-verifier`}),` package documentation`]}),`.`]}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{icon:`shield-check`,href:`/phala-cloud/confidential-ai/verify/verify-attestation`,title:`Verify Attestation`,arrow:`true`}),_jsx(Card,{icon:`receipt`,href:`/phala-cloud/confidential-ai/verify/verify-signature`,title:`Verify a Response`,arrow:`true`})]})]})}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":{"codeStyling":"system","config":{},"pageMetadata":{"title":"TypeScript ACI Verifier","description":"Use the official TypeScript SDK to verify Phala Private AI attestation, pin the TLS channel, and audit signed response receipts.","href":"/phala-cloud/confidential-ai/verify/typescript-sdk"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install","slug":"install","depth":2,"children":[]},{"title":"Create a verified connection","slug":"create-a-verified-connection","depth":2,"children":[]},{"title":"Receipt auditing","slug":"receipt-auditing","depth":2,"children":[]},{"title":"Browser use","slug":"browser-use","depth":2,"children":[]},{"title":"Release policy","slug":"release-policy","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/phalanetwork-1606097b/2c201375ed6be1da/scripts/generate-cli-docs.js"],"subdomain":"phalanetwork-1606097b","siteName":"Phala","title":"Phala Cloud Documentation — Private AI on TEE","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-05T01:13:30.817Z","originalFileLocation":"phala-cloud/confidential-ai/verify/typescript-sdk.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=\"Use the official TypeScript SDK to verify Phala Private AI attestation, pin the TLS channel, and audit signed response receipts.\">\u003cmeta data-mint-head name=\"keywords\" content=\"Phala Cloud, TEE, Trusted Execution Environment, Confidential Computing, Private AI, confidential AI, GPU TEE, Intel TDX, dstack, blockchain, privacy-preserving computing, secure cloud, attestation\">\u003cmeta data-mint-head name=\"application-name\" content=\"Phala\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_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/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_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/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_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/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_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/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_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/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_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/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_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/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Phala Cloud Documentation — Private AI on TEE\">\u003cmeta data-mint-head property=\"og:description\" content=\"Deploy confidential AI applications on Phala Cloud with hardware-level privacy via Intel TDX, NVIDIA H100 GPU TEE, and verifiable attestation.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Phala Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://raw.githubusercontent.com/Phala-Network/phala-docs/main/images/phala-docs-og.png\">\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=\"Phala Cloud Documentation — Private AI on TEE\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Deploy confidential AI applications on Phala Cloud with hardware-level privacy via Intel TDX, NVIDIA H100 GPU TEE, and verifiable attestation.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://raw.githubusercontent.com/Phala-Network/phala-docs/main/images/phala-docs-og.png\">\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/phalanetwork-1606097b/nl48Duk5fn7pmYeb/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Phala\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#527a08\">\u003cmeta data-mint-head name=\"author\" content=\"Phala Cloud\">\u003cmeta data-mint-head name=\"category\" content=\"Technology\">\u003cmeta data-mint-head name=\"distribution\" content=\"global\">\u003cmeta data-mint-head name=\"language\" content=\"en\">\u003cmeta data-mint-head name=\"og:image:alt\" content=\"Phala Cloud — Confidential Computing \u0026amp; GPU TEE for AI\">\u003cmeta data-mint-head name=\"twitter:creator\" content=\"@PhalaNetwork\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/phala-cloud/confidential-ai/verify/typescript-sdk.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.phala.com/#organization\",\"name\":\"Phala\",\"url\":\"https://docs.phala.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/phalanetwork-1606097b/Y2wR1-jOsoYpAL6q/images/phala-light.png?fit=max\u0026auto=format\u0026n=Y2wR1-jOsoYpAL6q\u0026q=85\u0026s=fb4f438a36865810867d188289681376\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.phala.com#website\",\"name\":\"Phala\",\"url\":\"https://docs.phala.com\",\"publisher\":{\"@id\":\"https://docs.phala.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk#webpage\",\"url\":\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk\",\"name\":\"TypeScript ACI Verifier\",\"description\":\"Use the official TypeScript SDK to verify Phala Private AI attestation, pin the TLS channel, and audit signed response receipts.\",\"dateModified\":\"2026-11-05T01:13:30.817Z\",\"isPartOf\":{\"@id\":\"https://docs.phala.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Private AI\",\"item\":\"https://docs.phala.com/phala-cloud/confidential-ai/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Verification\",\"item\":\"https://docs.phala.com/phala-cloud/confidential-ai/verify/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"TypeScript ACI Verifier\",\"item\":\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk#article\",\"headline\":\"TypeScript ACI Verifier\",\"name\":\"TypeScript ACI Verifier\",\"description\":\"Use the official TypeScript SDK to verify Phala Private AI attestation, pin the TLS channel, and audit signed response receipts.\",\"url\":\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk\",\"mainEntityOfPage\":{\"@id\":\"https://docs.phala.com/phala-cloud/confidential-ai/verify/typescript-sdk#webpage\"},\"image\":\"https://raw.githubusercontent.com/Phala-Network/phala-docs/main/images/phala-docs-og.png\",\"dateModified\":\"2026-11-05T01:13:30.817Z\",\"publisher\":{\"@id\":\"https://docs.phala.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.phala.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Phala\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Phala","nav":{"global":null,"tabs":[{"tab":"Phala Cloud","icon":"cloud","pages":[{"title":"Phala Cloud","href":"/phala-cloud/what-is/what-is-phala-cloud"}]},{"tab":"Private AI","icon":"shield-check","pages":[{"group":"Private AI","pages":[{"title":"Overview","href":"/phala-cloud/confidential-ai/overview"},{"group":"Getting Started","pages":[{"title":"On-demand API","href":"/phala-cloud/confidential-ai/confidential-model/confidential-ai-api"},{"title":"Playground","href":"/phala-cloud/confidential-ai/confidential-model/playground"},{"title":"Migration and Integrations","href":"/phala-cloud/confidential-ai/confidential-model/migration-and-integrations"},{"title":"Anthropic SDK","href":"/phala-cloud/confidential-ai/confidential-model/anthropic-sdk"}]},{"group":"Use in Agents","pages":[{"title":"Use in Agents","sidebarTitle":"Overview","href":"/phala-cloud/confidential-ai/agents/overview"},{"title":"Private AI Proxy","href":"/phala-cloud/confidential-ai/agents/private-ai-proxy"},{"title":"Claude Code","href":"/phala-cloud/confidential-ai/agents/claude-code"},{"title":"Codex CLI","href":"/phala-cloud/confidential-ai/agents/codex"},{"title":"OpenCode","href":"/phala-cloud/confidential-ai/agents/opencode"},{"title":"Pi","href":"/phala-cloud/confidential-ai/agents/pi"},{"title":"Hermes","href":"/phala-cloud/confidential-ai/agents/hermes"},{"title":"OpenClaw","href":"/phala-cloud/confidential-ai/agents/openclaw"},{"title":"Cline","href":"/phala-cloud/confidential-ai/agents/cline"},{"title":"Other Tools","href":"/phala-cloud/confidential-ai/agents/other-tools"}]},{"group":"API Reference","pages":[{"title":"Chat Completions","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/chat-completions"},{"title":"Responses","api":"POST /responses","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/responses"},{"title":"Messages","api":"POST /messages","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/messages"},{"title":"Completions","api":"POST /completions","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/completions"},{"title":"Images","api":"POST /images/generations","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/images"},{"title":"Audio Transcription","api":"POST /audio/transcriptions","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/audio"},{"title":"System One","api":"POST /systemone","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/systemone"},{"title":"List Models","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/models"},{"title":"Attestation report","api":"GET /aci/attestation","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/attestation"},{"title":"Receipt","api":"GET /aci/receipts/{id}","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/receipts"},{"title":"Session","api":"GET /aci/sessions/{session_id}","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/sessions"},{"title":"Signature","api":"GET /signature/{id}","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/signature"},{"title":"Embeddings","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/embeddings"},{"title":"List Embedding Models","href":"/phala-cloud/confidential-ai/confidential-model/api-reference/embedding-models"}]},{"group":"Guides","pages":[{"title":"Tool Calling","href":"/phala-cloud/confidential-ai/confidential-model/tool-calling"},{"title":"Images and Vision","href":"/phala-cloud/confidential-ai/confidential-model/images-and-vision"},{"title":"Structured Output","href":"/phala-cloud/confidential-ai/confidential-model/structured-output"},{"title":"Reasoning","href":"/phala-cloud/confidential-ai/confidential-model/reasoning"},{"title":"Prompt caching","href":"/phala-cloud/confidential-ai/confidential-model/prompt-caching"},{"title":"Streaming","href":"/phala-cloud/confidential-ai/confidential-model/streaming"},{"title":"Attested Routing","href":"/phala-cloud/confidential-ai/confidential-model/attested-routing"},{"title":"Zero Data Retention","href":"/phala-cloud/confidential-ai/confidential-model/zero-data-retention"},{"title":"Error Handling","href":"/phala-cloud/confidential-ai/confidential-model/error-handling"}]},{"group":"Verification","pages":[{"title":"Overview","description":"Verify Phala gateway attestation, pinned TLS, signed receipts, and upstream evidence.","href":"/phala-cloud/confidential-ai/verify/overview"},{"title":"TypeScript ACI Verifier","href":"/phala-cloud/confidential-ai/verify/typescript-sdk"},{"title":"Attestation","description":"Verify the Phala gateway's TDX evidence, nonce-bound keyset, expiry, and measured compose.","href":"/phala-cloud/confidential-ai/verify/verify-attestation"},{"title":"Verify a Response","href":"/phala-cloud/confidential-ai/verify/verify-signature"},{"title":"Receipts and Sessions","href":"/phala-cloud/confidential-ai/confidential-model/receipts-and-sessions"},{"title":"TCB and Claims","href":"/phala-cloud/confidential-ai/confidential-model/tcb-and-claims"}]},{"group":"Security Model","pages":[{"title":"Trust Boundary","href":"/phala-cloud/confidential-ai/confidential-model/trust-boundary"},{"title":"Channel Binding","href":"/phala-cloud/confidential-ai/confidential-model/channel-binding"},{"title":"Provider Verification","href":"/phala-cloud/confidential-ai/confidential-model/providers"},{"title":"End-to-End Encryption","href":"/phala-cloud/confidential-ai/confidential-model/e2ee-encryption"},{"title":"Compliance and Open Source","href":"/phala-cloud/confidential-ai/confidential-model/compliance-and-open-source"}]},{"title":"FAQs","href":"/phala-cloud/confidential-ai/faqs"}]}]},{"tab":"dstack","icon":"terminal","pages":[{"title":"dstack","href":"/dstack/overview"}]},{"tab":"dstack Cloud","icon":"server","pages":[{"title":"dstack Cloud","href":"/dstack-cloud/overview"}]},{"tab":"Network","icon":"network","pages":[{"title":"Network","href":"/network"}]}]},"basePath":"","title":"Phala Cloud Documentation — Private AI on TEE","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":[],"chunks":[]}