Attesta

Attesta API Docs

Drop-in OpenAI-compatible inference with cryptographic attestation on every request.

Quickstart

Attesta is a drop-in replacement for OpenAI. Change the base_url and your API key.

import openai

client = openai.OpenAI(
    api_key="sk-attesta-your-key-here",
    base_url="https://api.attesta.sh/v1"
)

response = client.chat.completions.create(
    model="attesta-qwen2.5-1.5b",
    messages=[{"role": "user", "content": "Explain differential privacy."}]
)

print(response.choices[0].message.content)

# Verify the TEE attestation receipt
print(response.attestation.maa_token)

Or with curl:

curl https://api.attesta.sh/v1/chat/completions \
  -H "Authorization: Bearer sk-attesta-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "attesta-qwen2.5-1.5b",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Authentication

All requests require a Bearer token in the Authorization header. Create API keys in the dashboard.

Authorization: Bearer sk-attesta-xxxxxxxxxxxx

Invalid or revoked keys return 401 with an OpenAI-compatible error body.

Chat Completions

POST /v1/chat/completions — identical to OpenAI's endpoint, with one addition: a attestation object in every response.

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1718000000,
  "model": "attesta-qwen2.5-1.5b",
  "choices": [{
    "index": 0,
    "message": { "role": "assistant", "content": "..." },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 87,
    "total_tokens": 99
  },
  "attestation": {
    "maa_token": "eyJ0eXAiOiJKV1Qi...",
    "maa_endpoint": "https://sharedeus2.eus2.attest.azure.net",
    "verified": false,
    "status": "affirming",
    "claims": {
      "eat_profile": "tag:github.com,2024:confidential-containers/Trustee",
      "submods": {
        "cpu0": {
          "ear.status": "affirming",
          "ear.trustworthiness-vector": { "hardware": 2, "executables": 3, "configuration": 2 }
        }
      }
    }
  }
}

Attestation Verification

The receipt is a Confidential Containers Trustee EAR (Entity Attestation Result), a signed ES256 JWT — not an Azure MAA token. Verify it yourself; no Attesta infrastructure needed.

# 1. Read the trust status (decode without signature verification first)
python3 -c "
import jwt
token = 'eyJ0eXAi...'  # from attestation.maa_token
claims = jwt.decode(token, options={'verify_signature': False})
status = claims['submods']['cpu0']['ear.status']
print('status:', status)  # 'affirming' = genuine, attested SEV-SNP TEE with an approved measurement
"

# 2. Verify the EAR signature against the attestation service's key.
#    The signing JWK is in the JWT header (alg ES256); pin it out-of-band for production.
python3 -c "
import jwt
from jwt import algorithms
token = 'eyJ0eXAi...'
hdr = jwt.get_unverified_header(token)          # contains the 'jwk'
key = algorithms.ECAlgorithm.from_jwk(__import__('json').dumps(hdr['jwk']))
claims = jwt.decode(token, key, algorithms=['ES256'])
assert claims['submods']['cpu0']['ear.status'] == 'affirming'
print('EAR verified')
"

# 3. Or use the Attesta verify endpoint (returns the decoded claims + status)
curl 'https://api.attesta.sh/v1/attestation/verify?token=eyJ0eXAi...'

Models

Model IDContextStatus
attesta-qwen2.5-1.5b32KAvailable
meta-llama/Llama-3.1-70B-Instruct128KComing soon

Rate Limits

PlanRequests/minTokens/month
Free10100K/mo
Pro60Unlimited
EnterpriseCustomUnlimited

Rate limit exceeded returns 429 with a Retry-After header.

API Reference

POST/v1/chat/completionsOpenAI-compatible chat endpoint + attestation
POST/v1/completionsLegacy completions endpoint
GET/v1/modelsList available models
GET/v1/attestation/verifyVerify an attestation receipt (Trustee EAR / MAA)
POST/v1/keysCreate an API key
GET/v1/keysList API keys
DELETE/v1/keys/{id}Revoke an API key
GET/v1/usageToken usage summary
GET/v1/compliance/exportDownload evidence bundle (Pro+)