Skip to main content

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 key
  • PCH_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pathcourse_sdk-0.2.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pathcourse_sdk-0.2.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file pathcourse_sdk-0.2.1.tar.gz.

File metadata

  • Download URL: pathcourse_sdk-0.2.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for pathcourse_sdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cf7877dd5e048c539ac63629f2fb0f15ab949979f54cd89e59db15e141e89b88
MD5 0a48fcdbfb652ac8c81d24ad59be3851
BLAKE2b-256 8c531a1a7e6f46da1b09acd76a1f50fc545b87d238df664334708204175c8ab5

See more details on using hashes here.

File details

Details for the file pathcourse_sdk-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pathcourse_sdk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for pathcourse_sdk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a0de562e1de1115a6ad3a32a456db877f319533a0dde1983728442634ab0a9b
MD5 f6883716908baaa0cb68d615ec6a86bc
BLAKE2b-256 30e3e8fd57089162145124f34243825d6fea3b7d6c96b47b4e82a54714d9eca2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page