POST receipts/countersign
POST /api/v1/receipts/countersign
POST /api/v1/receipts/countersign. Accepts a desktop_receipt with device pairing fields, or a self-contained v3 receipt envelope; returns a gateway-countersigned envelope.
Authenticate with an API key or a portal session token.
Request body
application/json any
One of
- object
desktop_receiptobject requiredsignaturestring requiredsigned_fieldsobject requiredJSON object describing the desktop receipt fields covered by its signature. The gateway checks that security-relevant receipt fields are included; other field names and values are not schema-validated.
Any keys are accepted.
device_idstring (uuid) requiredgateway_claimsobjectOptional JSON object. The endpoint reads request_id, provider, model, input_tokens, and output_tokens when those values have the expected scalar types; other fields are passed through without schema validation.
Any keys are accepted.
hash_upstream_responsestring requiredPattern:^[a-f0-9]{64}$
- object
claimsobject requiredJSON object from the OpenReceipt v3 envelope. The endpoint reads tokenization.tier and selected provider, model, tokens_in, and tokens_out values; other claim fields are retained as receipt payload.
Any keys are accepted.
sigstring requiredvinteger required
Generated sample
{
"desktop_receipt": {
"signature": "string",
"signed_fields": {}
},
"device_id": "00000000-0000-4000-8000-000000000000",
"gateway_claims": {},
"hash_upstream_response": "string"
}Responses
200 Successful response.
application/json ReceiptsCountersignResponse
receiptOpenReceiptEnvelope required
Generated sample
{
"receipt": {
"alg": "ecdsa-p256-sha256",
"chain": {
"chain_id": "string",
"prev_hash": "string",
"seq": 0
},
"claims": {
"egress_attestation": {
"attester": "desktop",
"attester_build_hash": "string",
"zero_payload_proof": {}
},
"routing_decision": {
"model": "string",
"provider_id": "string",
"provider_region": "string",
"reason": "user-selected"
},
"tokenisation": {
"detectors": [
{
"count": 0,
"fingerprint_hmac": "string",
"id": "string",
"version": "string"
}
],
"input_hash": "string",
"level": "tokenise-reversible",
"output_hash": "string",
"tokeniser_binary_hash": "string"
},
"x-cloakapi-detection": {
"basis": "client_declared",
"coverage": "rules_only",
"engine_identity": "not_declared"
}
},
"exp": 0,
"iat": 0,
"iss": "https://example.com",
"jti": "string",
"kid": "string",
"nbf": 0,
"sig": "string",
"sub": "string",
"v": "v1"
}
}401 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
403 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
413 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
415 Error response.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
422 The request failed validation.
application/json ReceiptsCountersignError
detailsarray of stringerrorstring requiredmessagestringrefstring
429 The route throttle limit was exceeded.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string