langchain-pathcourse
PathCourse Health integration for LangChain. Autonomous agent inference with USDC billing on Base L2 — no accounts, no credit cards, no KYC.
Install
pip install langchain-pathcourse
Quick Start
from langchain_pathcourse import ChatPathCourse
from langchain_core.prompts import ChatPromptTemplate
llm = ChatPathCourse(model="pch-fast") # set PCH_API_KEY env var
prompt = ChatPromptTemplate.from_template("Explain {topic} in one paragraph.")
chain = prompt | llm
print(chain.invoke({"topic": "autonomous agent billing"}))
Drop-in replacement for ChatOpenAI
ChatPathCourse extends ChatOpenAI. Anywhere you use ChatOpenAI in LangChain — chains,
agents, tools, memory, callbacks — just swap in ChatPathCourse and your code keeps working.
# Before
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o-mini")
# After
from langchain_pathcourse import ChatPathCourse
llm = ChatPathCourse(model="pch-fast")
Embeddings
from langchain_pathcourse import PathCourseEmbeddings
from langchain_community.vectorstores import FAISS
embeddings = PathCourseEmbeddings()
store = FAISS.from_texts(["hello world", "goodbye world"], embeddings)
results = store.similarity_search("greeting")
Models
| Model | Rate | Notes |
|---|---|---|
| Model | Rate | Min tier |
| --- | --- | --- |
pch-fast |
$0.44 / M tokens | uncertified |
pch-coder |
$3.50 / M tokens | uncertified |
pch-embed |
$0.015 / M tokens | uncertified |
pch-translate |
$0.08 / M chars | uncertified |
pch-pro |
$1.96 / M tokens | bronze |
pch-audio |
$1.85 / M chars | bronze |
pch-documents |
$0.26 in / $1.48 out per M tokens | bronze |
pch-transcribe |
$0.0008 / minute | bronze |
pch-extract |
$0.012 / M tokens | bronze |
pch-rerank |
$0.025 / M tokens | bronze |
pch-image |
$0.028 / image | silver |
pch-audio-premium |
$37.00 / M chars | silver |
pch-talk |
$0.001 / minute | silver |
claude-haiku |
Common rate | silver |
claude-sonnet |
Common rate | gold |
The full list above shows what's reachable through the gateway. ChatPathCourse and the embeddings class only operate on chat-completion and embedding shapes — for image, audio, transcription, etc., use the PCH Python SDK directly. The token-counting models all share one OpenAI-compatible endpoint, so the same ChatPathCourse instance works for any of them by changing the model= argument.
Choosing a chat model:
- Fast response, simple task →
pch-fast - Complex reasoning, multi-step →
pch-pro - Writing or reviewing code →
pch-coder - Long context or premium reasoning →
claude-sonnet(Gold tier)
List all models programmatically:
ChatPathCourse.list_models()
Authentication
Set PCH_API_KEY in your environment, or pass pch_api_key= to the constructor.
export PCH_API_KEY=pch_prod_b_...
Developer access — $5 USDC. Send $5+ USDC on Base (chain ID 8453) to the PCH treasury wallet, then call pathcourse.claim_key(tx_hash, wallet) to retrieve your key. No accounts, no credit card, no KYC. $5 buys thousands of pch-fast calls — enough to verify any integration. Top up to $25 lifetime and your account auto-upgrades to Uncertified with pch-coder access. Treasury address: see payment.treasury_wallet in /.well-known/agent.json.
Links
- Platform: pathcoursehealth.com
- Python SDK: pypi.org/project/pathcourse-sdk
- JS SDK: npmjs.com/package/@pathcourse/sdk
- Integration examples: github.com/pathcourse-health/pch-integration-examples
License
MIT
Metadata
Release files for langchain-pathcourse 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_pathcourse-0.1.2.tar.gz | 5.4 kB | Without provenance | Details for langchain_pathcourse-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_pathcourse-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for langchain_pathcourse-0.1.2-py3-none-any.whl |
Total release size: 11.9 kB
Release files / langchain_pathcourse-0.1.2.tar.gz
| Download URL | langchain_pathcourse-0.1.2.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd85c8ff631ff98301864012b70c2cd0ad0c553ead9048f5973f23f8313c1d8e
|
|
BLAKE2b-256 checksum How to use checksums |
17793890e13c2f1a1246d4e8867fd79aa6bc0e28f17c0e1110c880effdf01aa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.3
|
Release files / langchain_pathcourse-0.1.2-py3-none-any.whl
| Download URL | langchain_pathcourse-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d781bcaf6f0090d34427d829593084139cbef71e678e7b0a6fc172fe1d51607
|
|
BLAKE2b-256 checksum How to use checksums |
ac63debe9077fbbc5bd6ca8e42db5191dcf2fc6a7557b80652074a0875c4de13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.3
|
Security for langchain-pathcourse 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.