Skip to main content

Base URL

https://api.redpill.ai/v1

Authentication

Send your API key as a bearer token:
Authorization: Bearer YOUR_API_KEY
See Authentication for key management.

Endpoints

Inference

EndpointMethodDescription
/v1/chat/completionsPOSTCreate a chat completion.
/v1/responsesPOSTCreate a response (Responses API format).
/v1/messagesPOSTCreate a message (Anthropic Messages format).
/v1/embeddingsPOSTCreate text embeddings.
/v1/modelsGETList models with providers, context windows, and pricing.
Each model has an is_tee boolean: is_tee: true means it can be served confidentially, on a verified TEE provider. The receipt’s upstream.verified event confirms a specific response was. See Confidential models.

Verification

EndpointMethodDescription
/v1/aci/attestationGETFresh TEE attestation report, bound to a caller-supplied nonce.
/v1/aci/receipts/{id}GETSigned receipt for a response, by receipt id or chat id.
/v1/aci/sessions/{id}GETAttested-session record referenced by a receipt.
/v1/aci/sessionsGETList a provider’s attested sessions (?provider=&model=).
To verify a response: fetch the attestation report with a fresh nonce, read the x-receipt-id header on your response, fetch its signed receipt, then check the receipt signature under the attested keyset and compare the request and response hashes. See Verify a response.

Legacy

Legacy endpoints kept for backward compatibility with earlier API clients. New integrations should use the canonical endpoints above.
EndpointMethodCanonical replacement
/v1/completionsPOST/v1/chat/completions
/v1/signature/{id}GET/v1/aci/receipts/{id}
/v1/attestation/reportGET/v1/aci/attestation

Request format

POST requests use JSON:
curl https://api.redpill.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "qwen/qwen3-30b-a3b-instruct-2507",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Response format

{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "qwen/qwen3-30b-a3b-instruct-2507",
  "choices": [{
    "index": 0,
    "message": { "role": "assistant", "content": "Hello! How can I help you?" },
    "finish_reason": "stop"
  }],
  "usage": { "prompt_tokens": 9, "completion_tokens": 12, "total_tokens": 21 }
}

Response headers

Inference responses include verification headers:
HeaderDescription
x-receipt-idId of the signed receipt for the response.
x-aci-identityThe attested workload identity that served the request.
x-aci-keyset-digestDigest of the workload’s published keyset.
x-aci-versionACI version, for example aci/1.
To select a model, set the model field in the request body. For end-to-end encryption, send the X-E2EE-* request headers from the E2EE guide.

Errors

Errors return a JSON body with an appropriate HTTP status:
{
  "error": {
    "message": "Invalid API key",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}
CodeMeaning
200Success
400Bad request (invalid parameters)
401Unauthorized (invalid API key)
403Forbidden (insufficient credits)
404Endpoint or model not found
429Rate limit exceeded
500Server error
503Service unavailable
See Error handling. Rate limits depend on your account tier; check the dashboard.

Using existing client libraries

The API follows the OpenAI request and response format, so OpenAI client libraries work by pointing the base URL at the gateway and using your API key:
from openai import OpenAI

client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.redpill.ai/v1")
resp = client.chat.completions.create(
    model="qwen/qwen3-30b-a3b-instruct-2507",
    messages=[{"role": "user", "content": "Hello"}],
)
See Integrations for SDKs and tools.