@outrik/ai-buffer-sdk
v1.0.5
Published
OUTRIK AI Buffer Ads SDK for developer agent thinking loops
Maintainers
Readme
@outrik/ai-buffer-sdk
OUTRIK AI Buffer Ads SDK — Monetize your AI agent's thinking loops with zero-latency, developer-friendly ads.
What is AI Buffer Ads?
When an AI coding agent (Claude, Cursor, GitHub Copilot, etc.) enters a thinking loop, there's a natural pause in the developer's workflow. OUTRIK monetizes this dead-time by displaying a single, non-intrusive, text-only ad line in the terminal or IDE output channel — directly above the spinner.
No pop-ups. No banner images. No interruptions.
The ad disappears the moment the thinking loop ends, and the entire integration adds < 400ms to your tool's response time (enforced hard timeout).
How It Works
[AI Agent Starts Thinking]
⠙ Ads by Outrik · Sponsored: Try Zed — The fastest code editor. (learn more: aibfr.outrik.com/r/zed1)
[AI Agent Finishes Thinking]
→ Spinner clears, response appears normallyRevenue is split: 52% to you (the publisher), 48% to OUTRIK. Billing is per 10 views = ₹0.01 INR (batched, settled daily).
Installation
npm install @outrik/ai-buffer-sdkQuick Start
Step 1 — Register your CLI tool on the Publisher Portal
- Go to publisher.outrik.com
- Log in and navigate to Assets → Add CLI Asset
- Select your platform (e.g.,
vscode,cursor,antigravity_cli, etc.) - Copy your Asset Token after approval
Step 2 — Link your token
npx @outrik/ai-buffer-sdk link --token <YOUR_ASSET_TOKEN>This saves your config to .outrik/config.json (automatically added to .gitignore).
Step 2 — Wrap your AI tool
Use the wrap command to run any existing AI tool (like Aider, Claude Code, or any other CLI). The SDK will automatically detect its thinking loop and display ads while you wait!
npx @outrik/ai-buffer-sdk wrap -- claude
# or
npx @outrik/ai-buffer-sdk wrap -- aiderThat's it! Every time your AI tool enters a "thinking" state, you earn revenue from the displayed ads.
Alternative: Programmatic SDK Integration
If you are a CLI developer building your own AI tool, you can integrate the SDK directly into your source code:
import { AIBufferAds } from '@outrik/ai-buffer-sdk';
const ads = new AIBufferAds({
agentType: 'my_ai_agent', // Identifies your agent type for targeting
platform: 'vscode' // Your registered platform type
});
// Before AI processing begins
await ads.start();
// ... your AI processing / inference call ...
// When AI processing completes
await ads.stop();API Reference
new AIBufferAds(options)
| Option | Type | Required | Description |
|---|---|---|---|
| agentType | string | ✅ | Identifies your agent (e.g., 'claude_agent', 'coding_assistant'). Used for targeting. |
| platform | string | ✅ | Your registered platform type (e.g., 'vscode', 'cursor', 'cli_tool'). |
| rendererType | 'terminal' \| 'vscode' | ❌ | Defaults to 'terminal'. Use 'vscode' for VS Code Output Channel integrations. |
ads.start(): Promise<void>
Begins the thinking session. Shows the spinner + fetches and renders an ad within 400ms.
ads.stop(): Promise<void>
Ends the thinking session. Clears the ad, submits final view telemetry.
ads.reportWindowActivity(): void
IDE plugin integrations only. Call when the host editor window gains focus. Improves HIP (Human Interaction Proof) score, leading to higher revenue.
ads.reportStdinActivity(): void
IDE plugin integrations only. Call when user input is detected. Improves HIP score.
Safe Environments
The SDK automatically bypasses ad rendering in:
- CI/CD environments (
GITHUB_ACTIONS,GITLAB_CI,CIRCLECI,TRAVIS,JENKINS_URL) - Non-TTY environments (piped output, log files)
No configuration needed — it's handled transparently.
VS Code Extension Integration
import { AIBufferAds } from '@outrik/ai-buffer-sdk';
const ads = new AIBufferAds({
agentType: 'my_extension',
platform: 'vscode',
rendererType: 'vscode' // No carriage-return tricks, clean output channel text
});
// Report focus events for better HIP scoring (= more revenue)
vscode.window.onDidChangeActiveTextEditor(() => ads.reportWindowActivity());
await ads.start();
// ... AI call ...
await ads.stop();Revenue & Earnings
| Metric | Value | |---|---| | Publisher Revenue Share | 52% | | Platform Commission | 48% | | Billing Unit | 10 views = ₹0.01 INR | | Payment Cycle | Daily rollup, monthly payout | | Minimum Payout | ₹500 INR |
Track your earnings at publisher.outrik.com/dashboard/ai-buffer-earnings.
Supported Platforms
| Platform | platform value |
|---|---|
| Visual Studio Code | vscode |
| Cursor | cursor |
| Windsurf | windsurf |
| JetBrains IDEs | jetbrains |
| Neovim | neovim |
| Antigravity CLI | antigravity_cli |
| Claude Code CLI | claude_code_cli |
| OpenCode CLI | opencode_cli |
| Kimi Code CLI | kimi_code_cli |
| GitHub Copilot CLI | github_copilot_cli |
| Aider | aider_cli |
| Continue.dev | continue_dev |
| Cline | cline |
| Other CLI tool | other_cli |
Privacy & Consent
When you run npx @outrik/ai-buffer-sdk link, you'll be asked for optional profiling consent.
If granted, OUTRIK collects anonymous project metadata (programming language, project type from directory structure) to serve higher-paying, more relevant ads. No personal data, no code, no file contents are ever collected.
You can revoke consent at any time by editing .outrik/config.json:
{
"asset_token": "your_token",
"has_profile_consent": false
}License
MIT © OUTRIK
