Build with Enclave42 model APIs.
Use one OpenAI-compatible endpoint to call secure model inference, track usage, and manage wallet-based billing from the Enclave42 dashboard.
Quickstart
Create an API key from the dashboard, assign it to an allowed model, then call the chat completions endpoint from your backend.
curl https://api.enclave42.com/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-235b-thinking",
"messages": [
{
"role": "user",
"content": "Reply with a short product summary."
}
]
}'Authentication
API requests require a bearer token. Keep your API key server-side and never expose it in a browser, mobile app, public repository, or client-side bundle.
| Header | Authorization: Bearer <YOUR_API_KEY> |
|---|---|
| Content type | Content-Type: application/json |
| Base URL | https://api.enclave42.com |
Chat completions
The primary endpoint follows an OpenAI-compatible chat completions format.
/v1/chat/completionsExample response
{
"id": "chatcmpl_...",
"object": "chat.completion",
"model": "qwen3-235b-thinking",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is a concise product summary..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 18,
"total_tokens": 42
}
}Confidential inference
Confidential-compute models use the exact same endpoint, POST /v1/chat/completions. They do not use the ordinary JSON Quickstart above.
Calling a Confidential-compute model requires the Enclave42 Confidential client lifecycle: session creation, evidence retrieval, local verification of that evidence, local encryption of the request, encrypted dispatch, and local decryption of the response. The encrypted dispatch itself is sent to the same /v1/chat/completions endpoint, with:
| Content type | Content-Type: application/octet-stream |
|---|
Sending Content-Type: application/json to a Confidential-compute model is rejected before any inference is dispatched:
| 403 | model_requires_confidential_pipeline |
|---|
A successful Confidential execution produces a signed Security Receipt. Classic JSON inference never produces a Confidential Security Receipt.
Confidential client
The Enclave42 Confidential client handles the session, evidence, local verification, local encryption, encrypted dispatch, and local decryption for you -- your code only sends a prompt and reads back a response and a receipt id.
from enclave42 import Enclave42
client = Enclave42(api_key="<YOUR_API_KEY>")
result = client.confidential.chat(
model="glm-5-1-tee",
prompt="Explain this in one sentence."
)
print(result.text)
print(result.receipt_id)enclave42 0.1.2 is published on PyPI: python -m pip install "enclave42==0.1.2". Validated environment for this release: Linux x86-64 (Ubuntu 24.04), Python 3.12 -- the published 0.1.2 wheel is Linux x86-64 only; other operating systems are not yet validated for this distribution.
Client journey: create an API key, pick a Confidential-eligible model such as glm-5-1-tee, confirm your account has inference credit available, then run client.confidential.chat(...) as shown above. result.text and result.receipt_id give you the response and the Security Receipt id. You can verify that receipt any time, without logging in, at /security/verify-receipt.
The Playground lets you try models in the browser, but it does not run the local, SDK-side session and evidence handling the Confidential client performs -- it is not a substitute for this attested path.
Models
Use the exact technical Model ID displayed in the Models page or API Keys page. Model access depends on the customer plan and the model assigned to the API key.
Wallet billing
Subscription controls platform access and model tiers. Wallet balance pays for actual inference consumption. Each successful request creates a usage record and a wallet debit.
Error responses
| Error | Meaning |
|---|---|
401 unauthorized | Missing or invalid API key. |
402 insufficient_wallet_balance | Wallet balance is not sufficient for paid inference. |
403 customer_suspended | Customer account has been suspended by admin controls. |
403 model_not_allowed | The API key or plan does not allow this model. |
429 rate_limited | Request limit exceeded. Retry after a short delay. |
Need help?
For onboarding, enterprise access, custom workloads, or account support, contact the Enclave42 team.
Contact support