HARNESS / API
DEVELOPERS · OPENAI-COMPATIBLE

Your OpenAI code. Encrypted before it leaves.

Point the official OpenAI client at the Harness gateway and pass one fetch. Every message is encrypted on your machine to the attested enclave key, the answer is decrypted on your machine, and the signed receipt is checked there too. Our gateway only ever forwards ciphertext.

1 · Install

npm install openai github:harnessagent-dev/harness

2 · Get a key

A key is 64 hex characters you make yourself. No sign-up. Credit belongs to the key.

npx -y github:harnessagent-dev/harness token

Every key gets a few free messages a day on the cheaper models. For more, buy credit for that key: open Chat, press Use under "Your chat key", paste your key, then Add credit and pay in USDG from your wallet. Agents can top up from a Harness pouch instead (harness_ai_topup).

3 · Call it

import OpenAI from "openai"; import { harnessFetch } from "harness/openai"; const client = new OpenAI({ baseURL: "https://harness-ai.team-541.workers.dev/v1", apiKey: process.env.HARNESS_AI_TOKEN, fetch: harnessFetch(), // encrypts here, decrypts here, checks the receipt }); const r = await client.chat.completions.create({ model: "z-ai/glm-5.3-flash", max_tokens: 400, messages: [{ role: "user", content: "Summarise this contract in 3 lines: …" }], }); r.choices[0].message.content; // the answer, decrypted on your machine r.harness.verified; // true when all six receipt checks pass r.harness.charged; // what this call cost, in USDG

What comes back in r.harness

fieldmeaning
verifiedall receipt checks passed
checkskeysetDigest, keysetNotExpired, receiptSignature, requestHash, responseHash, upstreamVerified
receiptIdthe enclave's receipt for this call
charged · creditcost of this call and credit left, in USDG
trialLeftfree messages left today, when the call was free

Want it strict? harnessFetch({ requireVerified: true }) throws instead of returning an answer whose receipt does not check out.

Endpoints

routewhat it does
POST /v1/chat/completionschat, E2EE v2 only. A request in plaintext is refused with 400, so a misconfigured client can't leak prompts.
GET /v1/modelsthe models, with Phala's prices per token (you pay those times the markup)
GET /v1/attestation?nonce=the enclave's attestation report
GET /v1/creditcredit and free messages left for your key
POST /v1/creditclaim a payment: { tx, token }
GET /v1/receipts/:idthe signed receipt of one of your calls

Plainly

Works todayNode 20+ with the official openai package; chat completions with system, user and assistant messages; reasoning models; every model on the Models page
Not yetstreaming (stream: true is refused before anything is sent), Python, images and audio
We can seewhich key called, when, which model, token counts and your IP. Not your messages and not the answers.
Not checked herethe Intel TDX hardware quote itself; use Phala's @phala/aci-verifier for that