Loading...
Loading...
Create, manage, and enforce content licenses programmatically. DRD supports single-use, subscription, and royalty-based licensing models with full transaction tracking and automated enforcement.
Choose the licensing model that best fits your content distribution strategy.
One-time license for a specific piece of content. Expires after use or a set duration.
Recurring license granting continuous access to content for a billing period.
Usage-tracked license where fees are calculated based on consumption metrics.
Issue licenses for your content through the API or SDK.
{
"contentId": "content_abc123",
"type": "subscription",
"licensee": {
"agentId": "agent_def456",
"organizationId": "org_xyz789"
},
"terms": {
"duration": "1y",
"autoRenew": true,
"usage": {
"maxRequests": 100000,
"territories": ["US", "EU", "UK"],
"purposes": ["training", "inference"]
}
},
"pricing": {
"amount": 9999,
"currency": "USD",
"interval": "monthly"
}
}
// Response
{
"licenseId": "lic_abc123",
"status": "active",
"issuedAt": "2026-02-12T10:00:00Z",
"expiresAt": "2027-02-12T10:00:00Z",
"contentId": "content_abc123",
"type": "subscription"
}Use the SDK for streamlined license management in your application.
import { DRD } from '@drd/sdk';
const drd = new DRD({ apiKey: process.env.DRD_API_KEY });
// Issue a new license
const license = await drd.issueLicense({
contentId: 'content_abc123',
type: 'royalty',
licensee: { agentId: 'agent_def456' },
terms: {
duration: '1y',
royaltyRate: 0.02, // 2% per use
minGuarantee: 500, // Minimum $500/month
},
});
// Check if a license is valid
const check = await drd.checkLicense({
licenseId: 'lic_abc123',
action: 'inference',
territory: 'US',
});
if (check.valid) {
console.log('License is valid, proceed');
console.log('Uses remaining:', check.usesRemaining);
} else {
console.log('License check failed:', check.reason);
}
// Track usage for royalty calculation
await drd.licensing.trackUsage('lic_abc123', {
action: 'inference',
quantity: 1,
metadata: { modelVersion: 'v3.2' },
});
// List all licenses for content
const licenses = await drd.licensing.list({
contentId: 'content_abc123',
status: 'active',
});Every license action is recorded as a transaction, providing a complete audit trail for compliance and billing.
created
License issued, awaiting activation
active
License is currently valid and in use
expired
License period has ended
revoked
License has been manually revoked
suspended
License temporarily suspended (payment issue)
// Response
{
"licenseId": "lic_abc123",
"transactions": [
{
"id": "txn_001",
"type": "usage",
"action": "inference",
"quantity": 1,
"cost": 0.12,
"timestamp": "2026-02-12T10:30:00Z"
},
{
"id": "txn_002",
"type": "payment",
"amount": 9999,
"currency": "USD",
"timestamp": "2026-02-01T00:00:00Z"
}
],
"summary": {
"totalUsage": 42500,
"totalRevenue": 29997,
"period": "2026-02"
}
}Verify license validity before content usage and record usage for billing and audit.
// Verify license before using content
const verification = await drd.licensing.verify({
licenseKey: 'lk_drd_su_Abc123Xyz789...',
contentId: 'content_abc123',
agentId: 'agent_def456',
intendedUsage: 'training',
});
if (verification.valid) {
console.log('License valid - proceed with content usage');
console.log(`Uses remaining: ${verification.usesRemaining}`);
console.log(`Expires: ${verification.expiresAt}`);
// Record the usage
await drd.licensing.recordUsage({
licenseId: verification.licenseId,
agentId: 'agent_def456',
usage: {
type: 'training',
tokens: 15000,
metadata: { batchId: 'batch_01HQ...' },
},
});
} else {
console.error(`License invalid: ${verification.reason}`);
// "expired" | "exhausted" | "revoked" | "territory_mismatch" | "usage_mismatch"
}For royalty-based licenses, generate detailed usage and revenue reports.
const royalties = await drd.licensing.royaltyReport({
licenseId: 'lic_abc123',
period: '2026-01',
});
console.log(`Revenue tracked: $${royalties.totalRevenue}`);
console.log(`Royalty owed: $${royalties.royaltyAmount}`);
console.log(`Content uses: ${royalties.totalUses}`);
for (const item of royalties.breakdown) {
console.log(` ${item.contentId}: ${item.uses} uses, $${item.royalty}`);
}DRD automatically enforces license terms. When a license check fails, the requesting agent receives a denial with a clear reason.
// Automatic enforcement in your agent
const result = await drd.guard('use_content', {
contentId: 'content_abc123',
action: 'training',
});
// result.allowed === false when license is invalid
// result.reason === 'license_expired' | 'territory_restricted' | 'usage_exceeded'
if (!result.allowed) {
// Handle gracefully
await drd.licensing.requestRenewal('lic_abc123');
}License Enforcement
DRD automatically blocks content access when licenses are expired, exhausted, or revoked. Agents that attempt to use content without a valid license receive a 403 LICENSE_REQUIRED error and the attempt is logged to the audit trail.