Preview. Nothing is live yet: no inference, no accounts, no billing.

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

01

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 Key
02

Choose a Model

Browse our collection of models and find one that fits your use case. Each model has different capabilities and performance characteristics.

Browse Models
03

Make 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.

POST Chat completions 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

POST /v1/chat/completions

Creates 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 content
max_tokensintegerMaximum number of tokens to generate
temperaturenumberSampling temperature between 0 and 2
streambooleanEnable streaming responses
top_pnumberNucleus sampling parameter

Code 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"])

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.

NameAPI idHugging Face idTypeSizeLicenseStatus
LFM3-1.7Blfm3-1.7bLiquidAI/LFM3-1.7BChat1.73BLFM Open LicenseNot live yet
LFM2.5-8B-A1Blfm2.5-8b-a1bLiquidAI/LFM2.5-8B-A1BChat8.47B total, 1B-class activeLFM Open LicenseNot live yet
Qwen3.5-4Bqwen3.5-4bQwen/Qwen3.5-4BChat4.66BApache 2.0Not live yet
Qwen3-8Bqwen3-8bQwen/Qwen3-8BChat8.19BApache 2.0Not live yet
Gemma 4 E4B itgemma-4-e4b-itgoogle/gemma-4-E4B-itChat4.5B effective, 8.0B with embeddingsApache 2.0Not live yet
Llama 3.1 8B Instructllama-3.1-8b-instructmeta-llama/Llama-3.1-8B-InstructChat8.03BLlama 3.1 Community LicenseNot live yet
gpt-oss-20bgpt-oss-20bopenai/gpt-oss-20bChat21B total, 3.6B activeApache 2.0Not live yet
Qwen3-Coder-30B-A3B Instructqwen3-coder-30b-a3b-instructQwen/Qwen3-Coder-30B-A3B-InstructCoding30.5B total, 3B-class activeApache 2.0Not live yet
BGE-M3bge-m3BAAI/bge-m3Embeddings567MMITNot live yet
nomic-embed-text-v1.5nomic-embed-text-v1.5nomic-ai/nomic-embed-text-v1.5Embeddings137MApache 2.0Not live yet
BGE reranker v2 M3bge-reranker-v2-m3BAAI/bge-reranker-v2-m3Reranker0.57BApache 2.0Not live yet
Whisper large-v3-turbowhisper-large-v3-turboopenai/whisper-large-v3-turboSpeech0.81BMITNot 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].

Create an account Manage API Keys