SDKs & integration
The SDKs implement the full three-call flow — detect, verify, prove — including signature verification against the rotating operator key set and the canonical subject matcher. Both SDKs ship identical matching semantics and replay the same byte-level test vectors.
Python
pip install prampta
from prampta import Prampta
pg = Prampta(
base_url="https://api2.prampta.com",
provider_id="your-provider-id",
licensee_id="your-licensee-id",
token="pair-token",
)
hits = pg.match_subjects(user_prompt)
for h in hits:
pg.assert_allowed(h["subject_id"], prompt=user_prompt, modality="image")
# no exception → all matched subjects authorized, proceed with generation
assert_allowed raises on any refusal, exposing the structured
PG_* code — see Refusal codes for how to
react to each class. An async client (AsyncPrampta) mirrors the sync API.
TypeScript
npm install @prampta/sdk
import { Prampta } from "@prampta/sdk";
const pg = new Prampta({
baseUrl: "https://api2.prampta.com",
providerId: "your-provider-id",
licenseeId: "your-licensee-id",
token: process.env.PRAMPTA_TOKEN,
});
const hits = await pg.matchSubjects(userPrompt);
for (const h of hits) {
await pg.assertAllowed(h.subject_id, { prompt: userPrompt, modality: "image" });
}
Getting credentials
Provider credentials — a provider id and pair tokens — are issued through prampta.com, the protocol’s first commercial registry. Rights-holder subjects live there too; the sandbox tier verifies against synthetic test subjects only, so you can integrate before touching real licenses.
Why integrate
- One call, court-ready proof — every decision is Ed25519-signed and written to a tamper-evident audit chain. Store it and you can show you had permission.
- Refusals are structured — machine-readable codes with hard/soft classification, so your product can offer a license flow, block, or rephrase.
- Free to integrate — a few lines before your model runs. The specification and SDKs are Apache-2.0.
API contract
The full wire contract is published as OpenAPI 3.1 in the SDK repository, alongside an integration guide and runnable examples for both languages.
