// Basic file upload
const { cid } = await pk.file(imageBuffer, {
entity: { id: "user:alice", role: "human" },
resourceType: "image",
});
// AI-generated content with ext:ai@1.0.0
const { cid, onchain } = await pk.file(textBuffer, {
entity: { id: "app:my-service", role: "organization" },
action: {
type: "create",
extensions: {
"ext:ai@1.0.0": {
provider: "openai",
model: "gpt-4o",
autonomyLevel: "autonomous",
tokensUsed: 1500,
},
},
},
resourceType: "text",
sessionId: "session-abc123",
});
// Derivative work (remix) — inputs are previous CIDs
const { cid } = await pk.file(remixBuffer, {
entity: { id: "user:bob", role: "human" },
action: {
type: "transform",
inputCids: [originalCid, sourceCid],
},
resourceType: "image",
});