Use RedPill through the OpenAI SDK, with optional local ACI verification on Node and Bun.
RedPill supports the OpenAI SDK’s Responses, Chat Completions, and Embeddings resources. Set the
base URL to https://api.redpill.ai/v1 and use an exact RedPill model ID.
Changing only the base URL does not make the SDK a local ACI verifier.
pip install openai
npm install openai
export REDPILL_AI_API_KEY="YOUR_API_KEY"
Responses
import osfrom openai import OpenAIclient = OpenAI( api_key=os.environ["REDPILL_AI_API_KEY"], base_url="https://api.redpill.ai/v1",)response = client.responses.create( model="z-ai/glm-5.3", input="Explain attestation in one sentence.",)print(response.output_text)
import OpenAI from "openai";const apiKey = process.env.REDPILL_AI_API_KEY;if (!apiKey) throw new Error("REDPILL_AI_API_KEY is required");const client = new OpenAI({ apiKey, baseURL: "https://api.redpill.ai/v1",});const response = await client.responses.create({ model: "z-ai/glm-5.3", input: "Explain attestation in one sentence.",});console.log(response.output_text);
Chat completions
Use Chat Completions when an existing application expects that API shape:
response = client.embeddings.create( model="qwen/qwen3-embedding-8b", input="Receipts bind requests and responses to the serving path.",)embedding = response.data[0].embedding
Verified Node and Bun transport
Node 20.18+ and Bun 1.4+ 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
Use https://tee.redpill.ai/v1 only with an is_tee: true model when standard upstreams must be
rejected. Set timeouts and bounded retries, and do not expose raw upstream errors to users.