Official Python SDK for the PathCourse AI gateway -- 15 inference tokens, x402 micropayments, ERC-8004 agent identity, USDC on Base L2.
Project description
pathcourse-sdk
Official Python SDK for the PathCourse Health AI gateway.
15 inference tokens. USDC micropayments on Base L2 via x402. ERC-8004 agent identity. No accounts required.
Install
pip install pathcourse-sdk
Quick Start
from pathcourse import PathCourseClient, PCH_FAST, PCH_PRO
client = PathCourseClient(api_key="your-pch-api-key")
response = client.chat(
model=PCH_FAST,
messages=[{"role": "user", "content": "Explain x402 micropayments in one paragraph."}]
)
print(response.text)
Embeddings
from pathcourse import PathCourseClient, PCH_EMBED
client = PathCourseClient(api_key="your-pch-api-key")
result = client.embed("The quick brown fox jumps over the lazy dog.")
print(f"Embedding dimension: {len(result.embeddings[0])}")
Translation
result = client.translate("Bonjour le monde", target_language="en")
print(result["translated_text"]) # "Hello world"
Models
| 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/$1.48 per M tokens |
PCH_TALK |
pch-talk | Voice conversation | $0.001/min |
CLAUDE_HAIKU |
claude-haiku | Third-party (Silver+ tier) | Markup over provider cost |
CLAUDE_SONNET |
claude-sonnet | Third-party (Gold tier) | 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 (109 languages) | $0.08/M chars |
PCH_EXTRACT |
pch-extract | Named entity extraction (zero-shot) | $0.012/M tokens |
PCH_RERANK |
pch-rerank | Retrieval reranking | $0.025/M tokens |
Environment Variables
PCH_API_KEY-- Your PathCourse API keyPCH_BASE_URL-- Override gateway URL (default:https://gateway.pathcoursehealth.com)
Settlement
All billing is in USDC on Base L2 (chain_id 8453) via the x402 payment protocol. Deposit USDC to the PCH treasury wallet to receive an API key. No accounts, no credit cards, no KYC.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pathcourse_sdk-0.2.0.tar.gz.
File metadata
- Download URL: pathcourse_sdk-0.2.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ca99508d8eda88bcdb03b7cca1d5925a0df5502cea7145e0cfab8f1c38ac4ca
|
|
| MD5 |
6f811afb420c64001ea5bb7c75a2cb3d
|
|
| BLAKE2b-256 |
1a58e0bff612376309b7d1be7ec1bd746f4fb2502bc28b5486a4f5b8b6035b96
|
File details
Details for the file pathcourse_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pathcourse_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bb9c567e2ed11dc3ba3a7221175344d0a025273114cfa3e8ef24e60ac5eb29c
|
|
| MD5 |
6277e7270e041bb479946297abf10f85
|
|
| BLAKE2b-256 |
4b43a7de0e303c3a59dba431bb505473b823be38f8b87d237bbef1c5dc227fcd
|