Skip to main content
The API is OpenAI-compatible. Point an OpenAI client at https://inference.phala.com/v1, or an Anthropic client at https://inference.phala.com (its SDK appends /v1/messages), and send your key as a bearer token.

Base URL

This host rejects non-TEE models with 404 and requires verified upstream serving. See Endpoint policy.

Authentication

Send an API key as a bearer token for inference and private artifacts:
Create keys in the dashboard. Read the key from an environment variable or a secret manager, call the API from a backend rather than from browser or mobile code, and revoke a key in the dashboard if it is exposed. The model catalog and gateway attestation are public.

Endpoints

Inference

Each model has an is_tee boolean: is_tee: true means it can be served confidentially. The receipt’s upstream.verified event confirms a specific response was. See Models.

Verification

To verify a response: fetch the attestation report with a fresh nonce, read the x-receipt-id header on your response, fetch its signed receipt, then check the receipt signature under the attested keyset and compare the request and response hashes. See Verify a response.

Legacy

Legacy endpoints kept for backward compatibility with earlier API clients. New integrations should use the canonical endpoints above. The Phala endpoint always requires verified upstream serving. See Endpoint policy.

Request format

Most POST requests use JSON. Audio transcriptions use multipart/form-data.

Response format

Response headers

Inference responses include verification headers: To select a model, set the model field in the request body. For end-to-end encryption, send the X-E2EE-* request headers from the E2EE guide.

Errors

Errors return a JSON body with an appropriate HTTP status. /v1/messages uses the Anthropic error envelope, with top-level type: "error", an error object, and a request_id. Other endpoints use the OpenAI-compatible shape shown here:
See Error handling.

Using existing client libraries

The API follows the OpenAI request and response format, so OpenAI client libraries work by pointing the base URL at the gateway and using your API key:
See OpenAI SDK and the other SDK guides.