Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.phala.com/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

GET https://api.redpill.ai/v1/signature/{request_id}?model={model}&signing_algo={algo}
Use this endpoint after a chat completion request. The signature proves a specific response was signed by a TEE key. Bind that key to fresh attestation evidence before treating the response as fully verified.

Parameters

request_id
string
required
The id returned by POST /v1/chat/completions.
model
string
required
The model ID used for the original request.
signing_algo
string
Signature algorithm. Common values include ecdsa, ecdsa-p256, and rsa; use the algorithm supported by the model response.

Examples

RESPONSE=$(curl -s https://api.redpill.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API_KEY>" \
  -d '{"model":"phala/qwen3.5-27b","messages":[{"role":"user","content":"hello"}]}')

REQUEST_ID=$(echo "$RESPONSE" | jq -r '.id')

curl "https://api.redpill.ai/v1/signature/$REQUEST_ID?model=phala/qwen3.5-27b" \
  -H "Authorization: Bearer <API_KEY>"

Response

{
  "text": "phala/qwen3.5-27b:116478638341bd2b...:3d0b2a2df73dc93a...",
  "signature": "0xee817b30e13ec3c320997ec37076a600e194dc64...",
  "signing_address": "0x56d070df1c6be444b007839ef9cf67cec7c12b8b",
  "signing_algo": "ecdsa"
}

Response Fields

FieldDescription
textSigned text. Format is either request_hash:response_hash or model:request_hash:response_hash
signatureSignature over text
signing_addressTEE signing address or public key
signing_algoSignature algorithm used
When text has three colon-separated parts, the first part is the model name used inside the signing path. It may differ from the alias you sent if the gateway rewrote the model ID internally.

Bind to Attestation

For production verification, use the returned signing_address to fetch fresh attestation evidence:
NONCE=$(openssl rand -hex 32)

curl "https://api.redpill.ai/v1/attestation/report?model=phala/qwen3.5-27b&nonce=$NONCE&signing_address=$SIGNING_ADDRESS" \
  -H "Authorization: Bearer <API_KEY>"
The response is verified only when:
  1. The request and response hashes in text match the bytes you sent and received.
  2. The signature is valid for text.
  3. The attestation report binds the same signing_address to genuine TEE evidence and your fresh nonce.