Skip to main content
GET
/
signature
/
{request_id}
Request Signature
curl --request GET \
  --url https://api.redpill.ai/v1/signature/{request_id} \
  --header 'Authorization: Bearer <token>'

Documentation Index

Fetch the complete documentation index at: https://docs.redpill.ai/llms.txt

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

Get Request Signature

Returns a cryptographic signature for a specific chat completion response. Use it with /v1/attestation/report to prove the response was signed by a key bound to a genuine TEE instance.
GET https://api.redpill.ai/v1/signature/{request_id}?model={model}&signing_algo={algo}
Try it now! To test in the playground:
  1. First make a chat completion request to get a request_id (use the ID from the response)
  2. Add your API key when prompted
  3. Fill in the request_id path parameter
  4. The model query parameter is pre-filled with phala/qwen-2.5-7b-instruct

Parameters

request_id
string
required
Request ID from the chat completion responseExample: chatcmpl-abc123xyz
model
string
default:"phala/qwen-2.5-7b-instruct"
required
Model ID that was used for the requestExamples: phala/qwen3.5-27b, phala/qwen-2.5-7b-instruct, openai/gpt-oss-120b
signing_algo
string
Signature algorithm to useOptions: ecdsa (default), ecdsa-p256, rsa

Example

# 1. Make request
RESPONSE=$(curl -s https://api.redpill.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"model":"phala/qwen-2.5-7b-instruct","messages":[{"role":"user","content":"test"}]}')

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

# 2. Get signature
curl "https://api.redpill.ai/v1/signature/$REQUEST_ID?model=phala/qwen-2.5-7b-instruct" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "text": "openai/gpt-oss-120b:116478638341bd2b...:3d0b2a2df73dc93a...",
  "signature": "0xee817b30e13ec3c320997ec37076a600e194dc64...",
  "signing_address": "0x56d070df1c6be444b007839ef9cf67cec7c12b8b",
  "signing_algo": "ecdsa"
}

Response Fields

FieldTypeDescription
textstringSigned message in format model:request_hash:response_hash or request_hash:response_hash
signaturestringECDSA signature (hex-encoded, EIP-191 format)
signing_addressstringEthereum address of the TEE signing key
signing_algostringSignature algorithm: "ecdsa"
Signature text format: The text field may contain 2 or 3 colon-separated parts. When 3 parts, the format is model:request_hash:response_hash (the model name may differ from what you sent because the TEE gateway rewrites it internally). The request/response hashes are SHA-256 of the raw bodies.

Verify Signature

import { verify } from '@redpill-ai/verifier'

// One-liner: verify the chat response
const proof = await verify(chatId, { model: 'phala/gpt-oss-120b', apiKey: 'sk-xxx' })
console.log(proof.signature.valid) // true

Bind Signature to TEE Attestation

After verifying the request and response hashes, fetch fresh attestation for the same signer:
NONCE=$(openssl rand -hex 32)
curl "https://api.redpill.ai/v1/attestation/report?model=phala/qwen-2.5-7b-instruct&nonce=$NONCE&signing_address=$SIGNING_ADDRESS" \
  -H "Authorization: Bearer YOUR_API_KEY"
The full verification succeeds only when the signature is valid and the attestation report data binds the same signing_address plus your fresh nonce.

Verification Guide

Learn how to verify signatures →