Get Receipt
curl --request GET \
--url https://api.example.com/aci/receipts/{id}import requests
url = "https://api.example.com/aci/receipts/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/aci/receipts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/aci/receipts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/aci/receipts/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/aci/receipts/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/aci/receipts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAPI Reference
Get Receipt
Fetch the signed receipt for a response, including the transparency event log.
GET
/
aci
/
receipts
/
{id}
Get Receipt
curl --request GET \
--url https://api.example.com/aci/receipts/{id}import requests
url = "https://api.example.com/aci/receipts/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/aci/receipts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/aci/receipts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/aci/receipts/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/aci/receipts/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/aci/receipts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyEndpoint
GET https://inference.phala.com/v1/aci/receipts/{id}
x-receipt-id header from an inference response, or use the response id.
Parameters
string
required
Receipt id (
rcpt-...) or response id from POST /v1/chat/completions.Example
curl "https://inference.phala.com/v1/aci/receipts/$RECEIPT_ID" \
-H "Authorization: Bearer <API_KEY>"
Response
| Field | Type | Description |
|---|---|---|
api_version | string | ACI version token, for example aci/1. |
receipt_id | string | Receipt id. |
chat_id | string | Chat or response id. |
workload_id | string | Must match the attestation report you verified. |
workload_keyset_digest | string | Must match the attestation report you verified. |
endpoint | string | Route served, for example /v1/chat/completions. |
method | string | HTTP method. |
served_at | number | Unix timestamp. |
event_log | array | Ordered transparency events. |
signature | string | Signature over the receipt by a key in the attested keyset. |
event_log entries
| Event | Key fields |
|---|---|
request.received | body_hash |
middleware.forwarded | body_hash |
route.selected | target_route_id |
request.forwarded | body_hash |
transparency.request_modified | Present when forwarded body differs from the received body. |
upstream.verified | provider, model_id, result, required, session_id, channel_bindings, claims |
response.received | cleartext_hash |
transparency.response_modified | Present when returned body differs from the provider response. |
response.returned | cleartext_hash, wire_hash |
{
"api_version": "aci/1",
"receipt_id": "rcpt-e0eefe63b3673e2a5984951f",
"chat_id": "d3ad808b20a444c29e798db35f112033",
"workload_id": "sha256:3def476b...",
"workload_keyset_digest": "sha256:3eff0836...",
"endpoint": "/v1/chat/completions",
"method": "POST",
"served_at": 1781588857,
"event_log": [
{ "seq": 0, "type": "request.received", "body_hash": "sha256:111d08a5..." },
{ "seq": 2, "type": "route.selected", "target_route_id": "z-ai/glm-5.2" },
{
"seq": 5,
"type": "upstream.verified",
"provider": "phala",
"model_id": "z-ai/glm-5.2",
"result": "verified",
"required": true,
"session_id": "as_3681736b..."
},
{ "seq": 7, "type": "response.returned", "wire_hash": "sha256:07703fb4..." }
],
"signature": "..."
}
Verifying the Receipt
- Fetch and verify a fresh Attestation Report.
- Confirm
workload_idandworkload_keyset_digestmatch the attestation report. - Verify
signatureunder areceipt_signing_keysentry from the attested keyset. - Confirm
request.received.body_hashmatches the request body you sent. - Confirm
response.returned.wire_hashmatches the response bytes you received. - Read
upstream.verified. For a confidential response,resultisverified,requiredistrue, andsession_idpoints to an attested session.
Legacy Alias
GET /v1/signature/{id} returns this same receipt inside a compatibility envelope for older clients.
Related
Attestation Report
Get Session
Was this page helpful?

