Skip to main content
Phala Confidential AI is OpenAI-compatible. Most integrations require changing only the base URL and API key:
After migration, responses can be verified with x-receipt-id, Attestation Report, and Get Receipt.

Migrate from OpenAI

Everything else stays familiar: chat completions, streaming, tool calling, vision, structured output, and embeddings use OpenAI-compatible request shapes.

Migrate from OpenRouter

Model ids use the provider/model format returned by /v1/models. Use is_tee: true to find models that can be served confidentially, then verify the actual response receipt.

OpenAI SDK

LangChain

Vercel AI SDK

Langfuse

Observability tools may store prompts, responses, metadata, or traces. For sensitive data, configure redaction or self-hosting before sending production traffic.
For custom Node.js or Bun applications, use the TypeScript ACI Verifier to inject a pinned fetch and audit signed receipts in code.

Verified Coding Agents

Pi and OpenCode can use native Phala Cloud providers that verify the ACI workload and TLS channel before model traffic is sent, then verify each signed response receipt before the agent finishes the turn.

Pi

Install the provider through Pi’s package manager:
Start Pi and use its native login and model picker:
Pi stores the credential, model catalog, and saved default through its native persistence. PHALA_AI_API_KEY is also supported for the current process.

OpenCode

Install the provider through OpenCode’s plugin command:
Restart OpenCode, then use its native provider and model pickers:
OpenCode stores the plugin configuration and credential in its native stores. Do not add a separate provider.phala block. PHALA_AI_API_KEY is also supported for the current process. Both providers expose /phala-attestation, /phala-receipts, /phala-receipt, and /phala-session for inspecting verified evidence. These commands are optional: connection and response verification already fail closed automatically.
Changing only an OpenAI-compatible base URL does not inject ACI’s attested TLS transport. Base-URL clients can call the API and verify receipts separately; use the native Pi or OpenCode provider when verification must be enforced inside the agent.

Coding Assistants and Desktop Clients

For tools that support an OpenAI-compatible provider, use: This works for tools such as Continue, Cline-compatible assistants, Cherry Studio, and other clients that let you set an OpenAI-compatible base URL.

Migration Checklist

  • Create a Phala API key.
  • Change the base URL to https://inference.phala.com/v1.
  • List models with GET /v1/models.
  • Use is_tee: true for confidential-capable models.
  • Capture x-receipt-id in raw HTTP responses when you need verification.
  • Verify one representative response before production rollout.

On-demand API

Error Handling