Skip to main content
Phala supports the OpenAI SDK’s Responses, Chat Completions, and Embeddings resources. Set the base URL to https://inference.phala.com/v1 and use an exact Phala model ID.
Changing only the base URL does not make the SDK a local ACI verifier.

Responses

Chat completions

Use Chat Completions when an existing application expects that API shape:
Pass stream=True in Python or stream: true in TypeScript for server-sent events. See Streaming and Function calling for complete loops.

Embeddings

Embedding models use a separate catalog:

Verified Node and Bun transport

Node 20.18.1+ and Bun 1.4.0+ can inject the same ACI runtime fetch:
The connection verifies the TDX quote, measured compose, identity expiry, hostname, and attested TLS SPKI before model traffic. verifyReceipt() checks the latest retained exchange, signed receipt, wire hashes, and cited session. See Release policy for compose allowlists and OS-image assurance.

Production checks

This endpoint rejects non-TEE models and requires verified upstream serving. Set timeouts and bounded retries, and do not expose raw upstream errors to users.