api documentation
TEE inference API docs
TEE inference on CPUs, sealed from the host inside AMD SEV-SNP or Intel TDX. The API is OpenAI-compatible. This preview is not live.
Preview: the host api.cpuinference.ai is a placeholder and is not live. Code samples below will not run against a real model yet.
Planned: fetch an attestation report and verify it before you send a prompt. See the Attestation page. That flow is not live.
Getting Started
Get your API Key
Create an API key to authenticate your requests. Keep it secure and never expose it in client-side code.
Get API KeyChoose a Model
Browse our collection of models and find one that fits your use case. Each model has different capabilities and performance characteristics.
Browse ModelsMake your first API call
Send a request to start generating completions. Here is a quick example:
curl -X POST https://api.cpuinference.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "lfm3-1.7b",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 512
}'
Authentication
All API requests require authentication using a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Security Best Practices
Never expose API keys in client-side code or public repositories
Rotate keys regularly and revoke unused keys
Use environment variables to store keys securely
Single Unified Endpoint
Chat models use one OpenAI-compatible chat completions endpoint. Change the model parameter in your request body to switch between chat models. Embeddings, rerank, and speech to text are planned and are not live yet.
https://api.cpuinference.ai/v1/chat/completions
How it works: Specify which model to use via the model field in your JSON body. Example: "model": "lfm3-1.7b"
API Reference
Chat Completions
/v1/chat/completionsCreates a chat completion. This is the main endpoint for generating text responses.
Request Body Parameters
modelstringRequired. Model ID to use (e.g., lfm3-1.7b)messagesarrayRequired. Array of message objects with role and contentmax_tokensintegerMaximum number of tokens to generatetemperaturenumberSampling temperature between 0 and 2streambooleanEnable streaming responsestop_pnumberNucleus sampling parameterCode Examples
import requests
response = requests.post(
"https://api.cpuinference.ai/v1/chat/completions",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"model": "lfm3-1.7b",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 512
}
)
print(response.json()["choices"][0]["message"]["content"])
const response = await fetch("https://api.cpuinference.ai/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "lfm3-1.7b",
messages: [{ role: "user", content: "Hello!" }],
max_tokens: 512
})
});
const data = await response.json();
console.log(data.choices[0].message.content);
Available Models
Use these model IDs in the model field of your API request. Each one is tagged not live yet. Chat examples on this page use lfm3-1.7b. Context lengths are omitted until we confirm them from the model cards.
| Name | API id | Hugging Face id | Type | Size | License | Status |
|---|---|---|---|---|---|---|
| LFM3-1.7B | lfm3-1.7b | LiquidAI/LFM3-1.7B | Chat | 1.73B | LFM Open License | Not live yet |
| LFM2.5-8B-A1B | lfm2.5-8b-a1b | LiquidAI/LFM2.5-8B-A1B | Chat | 8.47B total, 1B-class active | LFM Open License | Not live yet |
| Qwen3.5-4B | qwen3.5-4b | Qwen/Qwen3.5-4B | Chat | 4.66B | Apache 2.0 | Not live yet |
| Qwen3-8B | qwen3-8b | Qwen/Qwen3-8B | Chat | 8.19B | Apache 2.0 | Not live yet |
| Gemma 4 E4B it | gemma-4-e4b-it | google/gemma-4-E4B-it | Chat | 4.5B effective, 8.0B with embeddings | Apache 2.0 | Not live yet |
| Llama 3.1 8B Instruct | llama-3.1-8b-instruct | meta-llama/Llama-3.1-8B-Instruct | Chat | 8.03B | Llama 3.1 Community License | Not live yet |
| gpt-oss-20b | gpt-oss-20b | openai/gpt-oss-20b | Chat | 21B total, 3.6B active | Apache 2.0 | Not live yet |
| Qwen3-Coder-30B-A3B Instruct | qwen3-coder-30b-a3b-instruct | Qwen/Qwen3-Coder-30B-A3B-Instruct | Coding | 30.5B total, 3B-class active | Apache 2.0 | Not live yet |
| BGE-M3 | bge-m3 | BAAI/bge-m3 | Embeddings | 567M | MIT | Not live yet |
| nomic-embed-text-v1.5 | nomic-embed-text-v1.5 | nomic-ai/nomic-embed-text-v1.5 | Embeddings | 137M | Apache 2.0 | Not live yet |
| BGE reranker v2 M3 | bge-reranker-v2-m3 | BAAI/bge-reranker-v2-m3 | Reranker | 0.57B | Apache 2.0 | Not live yet |
| Whisper large-v3-turbo | whisper-large-v3-turbo | openai/whisper-large-v3-turbo | Speech | 0.81B | MIT | Not live yet |
Streaming Responses
Enable streaming to receive responses as they are generated. This provides a better user experience for real-time applications and chat interfaces.
const response = await fetch("https://api.cpuinference.ai/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "lfm3-1.7b",
messages: [{ role: "user", content: "Write a story" }],
stream: true
})
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}
Rate Limits
Rate limits are TBD. We will publish them after we measure our own hardware. Nothing on this preview is live, so no limits are in effect.
Need Help?
Have questions or need assistance? Email us at [email protected].