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

# Signature

> Use the legacy receipt wrapper for older Confidential AI clients.

`GET /v1/signature/{id}` is a legacy compatibility endpoint. It returns the same proof as the canonical [Get Receipt](/phala-cloud/confidential-ai/confidential-model/api-reference/receipts) endpoint, but wrapped in the older `text`, `signature`, and `signing_address` envelope.

New integrations should use `GET /v1/aci/receipts/{id}`.

## Endpoint

```bash theme={"system"}
GET https://inference.phala.com/v1/signature/{id}
```

## Parameters

<ParamField path="id" type="string" required>
  Receipt id (`rcpt-...`) or response id from `POST /v1/chat/completions`.
</ParamField>

## Example

```bash theme={"system"}
curl "https://inference.phala.com/v1/signature/$RECEIPT_OR_RESPONSE_ID" \
  -H "Authorization: Bearer <API_KEY>"
```

## Response

| Field             | Description                                                                       |
| ----------------- | --------------------------------------------------------------------------------- |
| `api_version`     | ACI version token, for example `aci/1`.                                           |
| `signing_algo`    | Signature algorithm, for example `ecdsa`.                                         |
| `signing_address` | Address that signed `text`.                                                       |
| `text`            | `"<request body hash>:<response hash>"`.                                          |
| `signature`       | Signature over `text`.                                                            |
| `receipt`         | Full receipt object, identical to the canonical `/v1/aci/receipts/{id}` response. |

```json theme={"system"}
{
  "api_version": "aci/1",
  "signing_algo": "ecdsa",
  "signing_address": "0xffb22d95...",
  "text": "111d08a5...:07703fb4...",
  "signature": "0xd0cd266a...",
  "receipt": {
    "receipt_id": "rcpt-...",
    "event_log": ["..."],
    "signature": "..."
  }
}
```

## Verification

For new clients, verify the `receipt` object directly:

1. Fetch a fresh [Attestation Report](/phala-cloud/confidential-ai/confidential-model/api-reference/attestation).
2. Confirm `receipt.workload_id` and `receipt.workload_keyset_digest` match the report.
3. Verify `receipt.signature` under a `receipt_signing_keys` entry from the attested keyset.
4. Confirm the request and response hashes in `receipt.event_log` match the bytes you sent and received.

For legacy clients that verify the wrapper, also verify `signature` over `text`, then bind `signing_address` back to a fresh attestation report.

## Related

<CardGroup cols={2}>
  <Card title="Get Receipt" icon="receipt" href="/phala-cloud/confidential-ai/confidential-model/api-reference/receipts" />

  <Card title="Verify a Response" icon="circle-check" href="/phala-cloud/confidential-ai/verify/verify-signature" />
</CardGroup>
