{"title":"PathCourse Health — Developer Integration Guide","version":"2.1.0","overview":"PCH is an AI token gateway and agent commerce infrastructure. Pay USDC on Base, get an API key, make inference requests using a standard REST API.","quick_start":{"steps":["1. Send POST to /v1/chat/completions — you’ll get a 402 with payment instructions","2. Send 25+ USDC on Base to the treasury wallet","3. Resend your request with X-PAYMENT-PROOF header","4. Receive your API key in X-API-KEY header + inference response","5. Use the API key for all future requests"]},"endpoints":{"inference":{"url":"https://gateway.pathcoursehealth.com/v1/chat/completions","method":"POST","auth":"Bearer {api_key}","body":{"model":"pch-fast | pch-coder | pch-pro | pch-image | pch-audio | pch-audio-premium | pch-documents | pch-talk | claude-haiku | claude-sonnet","messages":[{"role":"user","content":"your prompt"}],"max_tokens":500},"response_headers":{"X-PCH-Routed-Model":"model that handled the request","X-PCH-Tier":"your certification tier","X-PCH-Balance-Remaining":"your USDC balance"}},"payment_402":{"description":"Returned when no API key is present","status":402,"fields":{"pay_to":"treasury wallet address","amount_usdc":"minimum deposit (25)","payment_context_id":"unique ID for this payment session","chain_id":8453,"network":"base","asset":"USDC"}},"handshake":{"url":"https://agents.pathcoursehealth.com/negotiator/handshake","method":"POST","body":{"agent_id":"your-agent-id","endpoint":"https://your-agent.com"}},"capabilities":"https://agents.pathcoursehealth.com/registry/capabilities","certification":"https://gateway.pathcoursehealth.com/v1/cert/submit","agent_card":"https://gateway.pathcoursehealth.com/.well-known/agent.json","mcp_server":"https://gateway.pathcoursehealth.com/mcp"},"pricing":{"billing_model":"two_path","owned_models":{"pch-fast":{"rate":"$0.44 per million tokens","latency_ms":"400-800","description":"Best for high-volume, low-complexity tasks like classification, summarization, routing decisions, and quick agent responses where speed and cost matter most."},"pch-coder":{"rate":"$3.50 per million tokens","latency_ms":"1000-3000","description":"Best for agentic coding tasks, repository-scale code generation, function calling, browser automation, and any workload where the agent is writing, debugging, or analyzing code."},"pch-pro":{"rate":"$1.96 per million tokens","latency_ms":"800-2000","description":"Best for general-purpose autonomous agent reasoning, multi-step planning, tool use, and production workloads that require strong instruction following and reliable output quality."},"pch-image":{"rate":"$0.028 per image","latency_ms":"500-1200","description":"Text-to-image generation. Sub-second at 1024x1024. Supports text-to-image and image editing."},"pch-audio":{"rate":"$1.85 per million characters","latency_ms":"150-200","description":"Text-to-speech, standard tier. <200ms first audio. Supports emotion tags and zero-shot voice cloning."},"pch-audio-premium":{"rate":"$37.00 per million characters","latency_ms":"97-150","description":"Text-to-speech, premium tier. 97ms first-byte latency. 10-language support, voice cloning, natural language emotion control."},"pch-documents":{"rate":"$0.26 in / $1.48 out per million tokens","latency_ms":"800-2000 per page","description":"Document parsing and OCR. 109 languages, tables, formulas, charts. Split input/output billing."},"pch-talk":{"rate":"$0.001 per minute","latency_ms":"1500-4000","description":"End-to-end voice conversation. Audio in, audio out. One endpoint, one billing event."}},"third_party":{"rate":"Common rate","models":["claude-haiku","claude-sonnet"]},"uncertified_surcharge":"15% on all requests","notice":"PCH model tiers are powered by third-party inference infrastructure. The underlying model configuration is proprietary to PathCourse Health and subject to change without notice."},"additional_endpoints":{"image_generation":{"url":"https://gateway.pathcoursehealth.com/v1/images/generations","method":"POST","auth":"Bearer {api_key}","body":{"model":"pch-image","prompt":"your image description","size":"1024x1024"},"min_tier":"silver"},"text_to_speech":{"url":"https://gateway.pathcoursehealth.com/v1/audio/speech","method":"POST","auth":"Bearer {api_key}","body":{"model":"pch-audio | pch-audio-premium","input":"text to speak","voice":"default"},"min_tier":"bronze (pch-audio) / silver (pch-audio-premium)"},"voice_conversation":{"url":"https://gateway.pathcoursehealth.com/v1/audio/conversation","method":"POST","auth":"Bearer {api_key}","body":{"model":"pch-talk","audio":"base64-encoded audio input"},"min_tier":"silver"}},"certification_tiers":[{"tier":"uncertified","deposit":25,"models":["pch-fast","pch-coder"]},{"tier":"bronze","deposit":75,"models":["pch-fast","pch-coder","pch-pro","pch-audio","pch-documents"]},{"tier":"silver","deposit":250,"models":["pch-fast","pch-coder","pch-pro","pch-audio","pch-audio-premium","pch-documents","pch-image","pch-talk","claude-haiku"]},{"tier":"gold","deposit":750,"models":["pch-fast","pch-coder","pch-pro","pch-audio","pch-audio-premium","pch-documents","pch-image","pch-talk","claude-haiku","claude-sonnet"]}],"code_examples":{"python":"https://github.com/pathcourse-health/pch-integration-examples/blob/main/python/pch_client.py","javascript":"https://github.com/pathcourse-health/pch-integration-examples/blob/main/javascript/pch_client.js"},"payment_proof_format":{"header":"X-PAYMENT-PROOF","accepts":["base64-encoded JSON","plain JSON"],"fields":{"payment_context_id":"from the 402 response","tx_hash":"your USDC transfer transaction hash","buyer_wallet":"your wallet address"},"example":"{\"payment_context_id\":\"abc-123\",\"tx_hash\":\"0x...\",\"buyer_wallet\":\"0x...\"}"}}