LangChain integration for JarvisClaw AI API (x402 USDC payments supported)
Project description
langchain-jarvisclaw
LangChain integration for JarvisClaw AI API — 40+ models, pay-per-request with USDC via x402.
Install
pip install langchain-jarvisclaw
Usage
Mode 1: API Key (pre-paid balance)
from langchain_jarvisclaw import ChatJarvisClaw
chat = ChatJarvisClaw(api_key="sk-...", model="gpt-5.4")
response = chat.invoke("Explain quantum computing in one sentence")
print(response.content)
Mode 2: x402 Wallet Payment (no account needed)
Pay per request with USDC on Base. No signup, no API key — just a wallet.
from langchain_jarvisclaw import ChatJarvisClaw
chat = ChatJarvisClaw(
wallet_private_key="0x...", # Your EVM wallet private key
model="anthropic/claude-sonnet-4.6",
)
response = chat.invoke("Write a haiku about AI agents")
print(response.content)
Discover Models & Pricing (no auth)
from langchain_jarvisclaw import ChatJarvisClaw
# List all models with USD pricing
models = ChatJarvisClaw.list_models()
for m in models[:5]:
print(f"{m['model']}: ${m['input_per_m_token_usd']}/M input tokens")
# Find free models to test quality
free = ChatJarvisClaw.free_models()
print(f"Free models: {[m['model'] for m in free['free']]}")
# Check platform health
health = ChatJarvisClaw.health()
print(f"Status: {health['status']}, Models: {health['data']['total_models']}")
Use with LangChain chains
from langchain_core.prompts import ChatPromptTemplate
from langchain_jarvisclaw import ChatJarvisClaw
chat = ChatJarvisClaw(api_key="sk-...", model="gpt-5.4")
prompt = ChatPromptTemplate.from_messages([
("system", "You are a helpful coding assistant."),
("human", "{question}"),
])
chain = prompt | chat
response = chain.invoke({"question": "How do I reverse a linked list in Go?"})
Streaming
chat = ChatJarvisClaw(api_key="sk-...", model="gpt-5.4", streaming=True)
for chunk in chat.stream("Tell me a story"):
print(chunk.content, end="", flush=True)
Supported Models
40+ models including:
- OpenAI: gpt-5.5, gpt-5.4, gpt-5.4-mini, o3, o1
- Anthropic: claude-opus-4.7, claude-sonnet-4.6, claude-haiku-4.5
- Google: gemini-3.1-pro, gemini-2.5-flash
- DeepSeek: deepseek-chat, deepseek-reasoner
- And many more — call
ChatJarvisClaw.list_models()for the full list
Payment Networks
- Base (EVM): USDC on Base mainnet (default)
- Solana: USDC on Solana (install with
pip install langchain-jarvisclaw[solana])
License
MIT
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 langchain_jarvisclaw-0.1.0.tar.gz.
File metadata
- Download URL: langchain_jarvisclaw-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7a4a9da027ec1b8c146db2e6e6225ce32c23505942bebe568081fa73d42190a
|
|
| MD5 |
8a2c8fa4bacdb106edbc65fceb2b9fd0
|
|
| BLAKE2b-256 |
19faaa5826a6aa8075c698dfdd68790336125ebf797a55c1a1e988ba5fd9626f
|
File details
Details for the file langchain_jarvisclaw-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_jarvisclaw-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
918ada58ff681bc6a3c16a52110b3ee156191ac4210c4a213647d9926779d902
|
|
| MD5 |
1c59ca010d5b676c8645ff8cecb865a3
|
|
| BLAKE2b-256 |
6d6aeb3d7b12d9f10ac254dfd044fa24f0f12ec80ffedb5a1265631a30a6d9b3
|