AI Client Integration

Integrate ARCP into your LLM application, RAG pipeline, or AI assistant to access verified publisher content with proper attribution.

Installation

npm install @arcp/client

Basic query

import { ArcpClient } from "@arcp/client";

const arcp = new ArcpClient({
  apiKey: process.env.ARCP_API_KEY,
  clientId: "my-ai-app",
  routerUrl: "https://router.arcp-protocol.com", // optional
});

const result = await arcp.query({
  query: "user's question here",
  publishers: ["allreviews", "sportsball", "eighty"],
  userId: "user-id-for-receipts", // optional
});

// Use in your LLM context
const context = result.envelopes.flatMap(env =>
  env.items.map(item => ({
    title: item.title,
    summary: item.summary,
    source: item.source_url,
  }))
);

Using render tokens for attribution

Render tokens are signed JWTs that prove a user has the right to view content. Include render links in your AI responses:

// result.envelopes[].render_tokens[] contains render links
const renderLink = result.envelopes[0].render_tokens[0].render_url;

// When user clicks the link, ARCP tracks the open:
await arcp.trackRenderOpened({
  publisherId: "allreviews",
  contentId: "ar-smartphones-2026",
  userId: "user-123",
});

Direct REST API

No client library required:

curl -X POST https://router.arcp-protocol.com/v1/router/query \
  -H "Authorization: Bearer $ARCP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: my-app/1.0" \
  -d '{
    "query": "best laptops for developers",
    "publishers": ["allreviews"],
    "client_id": "my-app",
    "user_id": "user-123"
  }'

Discover available publishers

curl https://registry.arcp-protocol.com/v1/publishers

Best practices