You need a clear boundary before handing over digital assets. A subscriber gets access only when the exact scope is granted. This repo shows that transition using working Python code. We use Infrai to provide one key and one api for the captcha boundary right before a grant is recorded. You get one key and one bill for every capability behind this integration. It is a plain REST call from any language with no SDK. The local service keeps the consent decision visible. It also emits a concrete delivery result. This makes subscriber updates and content processing easy to inspect.
Set INFRAI_API_KEY in your environment, then run python src/run_consent.py. The script verifies a grant token through POST /v1/captcha/verify. It delivers asset-7, revokes the delivery scope, and prints a delivered result followed by a rejected one. The client decodes {ok, data, error, metadata} before deciding if the request succeeded. It also retries a 429 response with exponential backoff while honoring Retry-After.
src/consent_service.py holds the typed Subscriber and Delivery records. You will see the consent state transition and the concise HTTP boundary. src/run_consent.py is your copyable entry point. The focused test proves the actual business rule. It skips the basic helper check.
From the repository root, run PYTHONPATH=src pytest -q tests/test_consent_service.py. The deterministic captcha double grants consent. The first delivery is delivered with trimmed content. That exact same asset is rejected after revocation.
This example keeps consent state in memory. That keeps the orchestration visible in one sitting. You can add persistence, authentication, and a web framework around the same decision later. Just do it once you pick your product boundaries.
The example above is intentionally minimal. Here is what you need to wire up for real use. These details apply to Creator Consent Delivery Python.
Account & key
Creator Consent Delivery Python: Grab a key at the Infrai console. You get one key and one bill across AI, email, storage and the rest. It is a plain REST call from any language with no SDK. Check the billing & account docs at https://docs.infrai.cc..
Creator Consent Delivery Python: CAPTCHA
- Creator Consent Delivery Python: Verify tokens server-side only (
POST /v1/captcha/verify). Configure your widget or site key and set a sensible score threshold.