Overview
The on-demand Private AI API provides an OpenAI-compatible interface for confidential inference. Requests go through Phala’s ACI gateway athttps://inference.phala.com/v1. The gateway runs in a TEE, publishes an attestation report, and signs a per-response receipt that you can verify.
Prerequisites
Private AI is paid from your workspace Balance, the same Balance that pays for CVMs and GPU instances. There is no separate top-up and no minimum: if your Balance has money, the API works. Gifted credits do not pay for Private AI. In the dashboard, go to Private AI → API Keys and create your first API key. Click the key to copy it.
Make Your First Request
Replace<API_KEY> with your actual API key. The examples below use z-ai/glm-5.3; use List Models to choose a model for your workload.
Inspect the Response Receipt
Fetch the receipt with thex-receipt-id header:
result: verified and required: true; a failed required check refuses forwarding. This command only inspects the receipt. Ordinary SDK clients and cURL do not verify the gateway or each response. For client-side verification, use the TypeScript ACI verifier or Private AI Proxy.
Choose a Model
The live catalog is authoritative; query it before hardcoding model IDs:GET /v1/embeddings/models.
Every model served at this Phala endpoint uses the TEE-only policy. Provider evidence covers different boundaries; inspect the cited session and apply the claims your policy requires. The catalog describes capabilities, while a verified receipt and session bind a specific exchange.
Confidential inference and zero data retention are separate properties.
is_tee constrains who can read memory during execution. zdr constrains whether the upstream stores prompt or completion content after serving. Use GET /v1/models?zdr=true and provider: {"zdr": true} when retention is part of your policy.Verify Your AI is Running Securely
The verification client checks a fresh attestation report, recomputes the JCS keyset digest, checks its expiry and measured compose, and pins TLS before traffic. After the response it checks the receipt signature,workload_keyset_digest, exact request/response body_hash values, and cited upstream session. See Verify a Response.
The legacy Signature endpoint remains available for older clients, but new integrations should use GET /v1/aci/receipts/{id}.
Billing
Private AI usage is charged to your workspace Balance. The response’susage.cost reports the request charge in USD when present. Token prices are published in the live catalog. Cached input tokens are charged at pricing.input_cache_read when a model exposes that rate, otherwise at its normal prompt rate; see Prompt Caching.
Image generation is charged per returned image at the catalog’s pricing.image_generation rate in USD per image. Audio transcription is charged per started second of input audio at pricing.audio_transcription in USD per second: 2.965 seconds is billed as 3 seconds. Zero token counts do not imply that image or audio requests are free.
Next Steps
Use the API reference and feature guides for the next step:- Chat Completions documents the core request and response shape.
- List Models shows how to discover models programmatically.
- Get Receipt documents the canonical per-response proof.
- Embeddings covers embedding model calls.
- Tool Calling helps you call tools from your AI models.
- Images and Vision helps you use image-capable models.
- Structured Output helps you get JSON responses.
- Streaming helps you consume streaming responses.
- Zero Data Retention helps you route requests only to serving routes that do not retain prompt or completion content.
- Playground helps you test models in a private environment.

