
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@pathcourse/sdk
Advanced tools
Official JavaScript SDK for the PCH AI gateway. Autonomous API key provisioning, pay-per-inference billing in USDC on Base L2, and agent certification—no human signup required.
Official JavaScript SDK for the PathCourse Health AI gateway.
Official JavaScript SDK for the PCH AI gateway. Autonomous API key provisioning, pay-per-inference billing in USDC on Base L2, and agent certification—no human signup required.
npm install @pathcourse/sdk
PathCourse is built for autonomous agents. You don't sign up. There's no dashboard. You fund an on-chain wallet, claim an API key, and make inference calls — all programmatically.
claimKey({ txHash, wallet }) to retrieve your API key.new PathCourseClient({ apiKey }) and make inference calls.client.getBalance().No credit card. No KYC. No human in the loop.
Requirements: a Base L2 wallet and at least 25 USDC in it. Treasury wallet address is published at gateway.pathcoursehealth.com/.well-known/agent.json under payment.treasury_wallet.
import { claimKey, PathCourseClient } from '@pathcourse/sdk';
// Step 1: You've already sent >= 25 USDC to the PCH treasury wallet on Base.
// Capture the tx_hash and the wallet address you sent from.
// Step 2: Claim your API key. Polls up to ~3 minutes while the deposit
// confirms and your account provisions.
const result = await claimKey({
txHash: '0xYourDepositTxHash',
wallet: '0xYourSendingWallet',
});
console.log(result.api_key); // pch_prod_b_...
console.log(result.tier); // uncertified | bronze | silver | gold
console.log(result.balance_usdc); // e.g. "25.00000000"
// Store result.api_key securely. It won't be shown again via this endpoint.
Set the key as an environment variable for future runs:
export PCH_API_KEY="pch_prod_b_..."
import { PathCourseClient, PCH_FAST } from '@pathcourse/sdk';
const client = new PathCourseClient(); // reads PCH_API_KEY from env
await client.verifyKey(); // confirms the key works (cheap, no billing)
const response = await client.chat({
model: PCH_FAST,
messages: [{ role: 'user', content: 'Explain x402 micropayments in one paragraph.' }],
});
console.log(response.text);
const emb = await client.embed({ input: 'The quick brown fox jumps over the lazy dog.' });
console.log(emb.embeddings[0].length); // embedding dimension
const fr = await client.translate({ text: 'Hello world', targetLanguage: 'fr' });
console.log(fr.translated_text); // "Bonjour le monde"
const ranked = await client.rerank({
query: 'how does x402 work?',
documents: ['USDC is a stablecoin...', 'x402 is an HTTP status code...', 'Base is an L2...'],
topN: 2,
});
// Current balance + top-up instructions
const bal = await client.getBalance();
console.log(bal.balance_usdc, bal.low_balance);
// Spend history from the on-chain ledger
const usage = await client.getUsage({ limit: 20 });
console.log(usage.summary.total_spend_usdc);
// Days of service at current burn rate
const runway = await client.getRunway();
console.log(runway.runway_days, runway.status);
// Server-side daily spend cap (resets at UTC midnight; pass 0 to remove)
await client.setBudget({ dailyLimitUsdc: 10.00 });
// Webhook alerts when balance drops below threshold
await client.registerWebhook({
url: 'https://my-agent.example.com/pch-events',
thresholdUsdc: 25.00,
});
| Constant | Model | Use Case | Price |
|---|---|---|---|
PCH_FAST | pch-fast | Fast reasoning, classification, routing | $0.44/M tokens |
PCH_PRO | pch-pro | Deep reasoning, multi-step planning | $1.96/M tokens |
PCH_CODER | pch-coder | Code generation, debugging | $3.50/M tokens |
PCH_IMAGE | pch-image | Text-to-image generation | $0.028/image |
PCH_AUDIO | pch-audio | Text-to-speech (standard) | $1.85/M chars |
PCH_AUDIO_PREMIUM | pch-audio-premium | Text-to-speech (premium) | $37.00/M chars |
PCH_DOCUMENTS | pch-documents | Document parsing, OCR | $0.26 in / $1.48 out per M tokens |
PCH_TALK | pch-talk | Voice conversation | $0.001/min |
CLAUDE_HAIKU | claude-haiku | Third-party (Silver+) | Markup over provider cost |
CLAUDE_SONNET | claude-sonnet | Third-party (Gold) | Markup over provider cost |
PCH_EMBED | pch-embed | Text embeddings | $0.015/M tokens |
PCH_TRANSCRIBE | pch-transcribe | Speech-to-text | $0.0008/min |
PCH_TRANSLATE | pch-translate | Translation | $0.08/M chars |
PCH_EXTRACT | pch-extract | Zero-shot entity extraction | $0.012/M tokens |
PCH_RERANK | pch-rerank | Retrieval reranking | $0.025/M tokens |
Machine-readable rate sheet: gateway.pathcoursehealth.com/v1/pricing.
PCH_API_KEY — your PathCourse API keyPCH_BASE_URL — override gateway URL (default: https://gateway.pathcoursehealth.com)import {
PathCourseClient,
InsufficientBalanceError, AuthenticationError,
ModelNotInTierError, InferenceUnavailableError,
} from '@pathcourse/sdk';
const client = new PathCourseClient();
try {
await client.chat({ model: 'pch-pro', messages: [{ role: 'user', content: 'hi' }] });
} catch (err) {
if (err instanceof InsufficientBalanceError) {
// balance hit the $10 floor — top up via the treasury_wallet
} else if (err instanceof AuthenticationError) {
// key is invalid or the service is suspended
} else if (err instanceof ModelNotInTierError) {
// this tier can't access the requested model — upgrade cert or pick another
} else {
throw err;
}
}
All billing is in USDC on Base L2 (chain_id 8453) via the x402 payment protocol. USDC contract: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913. No accounts, no credit cards, no KYC.
FAQs
Official JavaScript SDK for the PCH AI gateway. Autonomous API key provisioning, pay-per-inference billing in USDC on Base L2, and agent certification—no human signup required.
The npm package @pathcourse/sdk receives a total of 2 weekly downloads. As such, @pathcourse/sdk popularity was classified as not popular.
We found that @pathcourse/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.