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.1.0.tar.gz (8.1 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.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pathcourse_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 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.1.0.tar.gz
Algorithm Hash digest
SHA256 2d30831aa480f8701694b01fe598c813d28f847e7d17dc750544bfa61102c3f1
MD5 5304c178d99e41300ccda44b0fd24156
BLAKE2b-256 dcb514f73b59c2502dd167e8aa5a13a530400c912bdd2cec1768ea083e1a90f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pathcourse_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09cef4e14e07a89a9e7830f20aa47f584d9a0279b28b01fadab0ffb5fdf66705
MD5 44b30cada795a41b116155b84cc4e569
BLAKE2b-256 1f1c72b4b07781be4c9b655d8c744b8bd5d45661925258b2f8bd456512044ea2

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