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 (preview)
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)This is a preview of the Confidential client's public API. It is not yet published to a package index -- there is no pip install command for it today. Run the example above from a copy of the Enclave42 SDK source in your own environment.
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