Developers
5 minutes to first API call

Quickstart

Go from zero to verifying content authenticity in five steps. Total: under 100 lines of code.

1

Install the SDK

Add the OP Protocol SDK to your project.

bash
npm install @op-protocol/sdk
2

Create a client

Initialize the client with your base URL and optional API key.

typescript
import { createClient } from '@op-protocol/sdk';

const op = createClient({
  baseUrl: 'https://originalpictures.cc',
  apiKey: 'op_beta_...' // optional, increases rate limits
});
3

Sign a file

Add Content Credentials to any image, video, or 3D file.

typescript
const file = new File([buffer], 'photo.jpg', { type: 'image/jpeg' });
const signed = await op.signMedia(file);

console.log(signed.signedFileUrl);
// "/api/v1/download/abc123" - download within 1 hour
console.log(signed.manifest.claimGenerator);
// "OP/0.1"
4

Verify a file

Check if a file has valid C2PA provenance and get its trust tier.

typescript
const result = await op.verifyMedia(file);

console.log(result.trust.tier);
// "verified" | "signed" | "recovered" | "unknown" | "unsigned" | "broken"
console.log(result.trust.confidence);
// "high" | "medium" | "low" | "none"
console.log(result.verifyId);
// "v_abc123" - use for badge and trust lookup
5

Embed a badge

Generate an embeddable trust badge URL for any verified file.

typescript
const badgeUrl = op.getBadgeUrl(result.verifyId, {
  format: 'svg',
  theme: 'light',
  size: 'md'
});

// Use in HTML: <img src={badgeUrl} alt="Trust Badge" />
// Or embed as HTML: format: 'html'

Ready to go deeper?

Explore the full API reference or test calls live in the playground.