Skip to content

Commit 6d76def

Browse files
feat: add DeepSeek and Qwen generated resources
1 parent a2a62f4 commit 6d76def

5 files changed

Lines changed: 97 additions & 3 deletions

File tree

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Typed Python SDK for [claw402.ai](https://claw402.ai) — pay-per-call data APIs via [x402](https://www.x402.org/) micropayments.
77

8-
**200+ endpoints** covering crypto market data, US stocks, China A-shares, forex, global time-series, and AI (OpenAI/Anthropic). No API key, no signup, no subscription — just a Base wallet with USDC.
8+
**200+ endpoints** covering crypto market data, US stocks, China A-shares, forex, global time-series, and AI (OpenAI/Anthropic/DeepSeek/Qwen). No API key, no signup, no subscription — just a Base wallet with USDC.
99

1010
## Install
1111

@@ -53,7 +53,7 @@ print(resp)
5353

5454
- **Typed methods** — every endpoint has a dedicated Python method with keyword arguments
5555
- **Automatic x402 payment** — signs EIP-3009 USDC transfers locally, never sends your key
56-
- **9 provider groups** — crypto, US stocks, China stocks, forex, global data, and AI
56+
- **11 provider groups** — crypto, US stocks, China stocks, forex, global data, and AI
5757
- **Context manager**`with Claw402(...) as client:` for automatic cleanup
5858
- **Zero config** — just a private key, no API keys or registration
5959
- **Base mainnet** — pays USDC per call on Coinbase L2
@@ -246,6 +246,30 @@ resp = client.anthropic.anthropic.messages({
246246
})
247247
```
248248

249+
#### DeepSeek
250+
251+
| Resource | Methods | Description |
252+
|----------|---------|-------------|
253+
| `deepseek.deepseek` | `chat`, `chat_reasoner`, `completions`, `models` | DeepSeek chat, reasoning, beta completions, model listing — $0.001–0.005/call |
254+
255+
```python
256+
resp = client.deepseek.deepseek.chat({
257+
"messages": [{"role": "user", "content": "Explain BTC basis trade"}]
258+
})
259+
```
260+
261+
#### Qwen
262+
263+
| Resource | Methods | Description |
264+
|----------|---------|-------------|
265+
| `qwen.qwen` | `chat_max`, `chat_plus`, `chat_turbo`, `chat_flash`, `chat_coder`, `chat_vl` | Qwen chat, coder, and vision models — $0.002–0.01/call |
266+
267+
```python
268+
resp = client.qwen.qwen.chat_max({
269+
"messages": [{"role": "user", "content": "Write a Go HTTP middleware"}]
270+
})
271+
```
272+
249273
## Configuration
250274

251275
```python

claw402/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
from .generated.alphavantage import AlphavantageResource
1212
from .generated.anthropic import AnthropicResource
1313
from .generated.coinank import CoinankResource
14+
from .generated.deepseek import DeepseekResource
1415
from .generated.nofxos import NofxosResource
1516
from .generated.openai import OpenaiResource
1617
from .generated.polygon import PolygonResource
18+
from .generated.qwen import QwenResource
1719
from .generated.tushare import TushareResource
1820
from .generated.twelvedata import TwelvedataResource
1921

@@ -101,6 +103,8 @@ def __init__(self, private_key: str, base_url: str = "https://claw402.ai"):
101103
# AI model providers
102104
self.openai = OpenaiResource(self)
103105
self.anthropic = AnthropicResource(self)
106+
self.deepseek = DeepseekResource(self)
107+
self.qwen = QwenResource(self)
104108

105109
def close(self):
106110
"""Close the underlying HTTP session."""

claw402/generated/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
from .alphavantage import AlphavantageResource
44
from .anthropic import AnthropicResource
55
from .coinank import CoinankResource
6+
from .deepseek import DeepseekResource
67
from .nofxos import NofxosResource
78
from .openai import OpenaiResource
89
from .polygon import PolygonResource
10+
from .qwen import QwenResource
911
from .tushare import TushareResource
1012
from .twelvedata import TwelvedataResource
1113

12-
__all__ = ["AlpacaResource", "AlphavantageResource", "AnthropicResource", "CoinankResource", "NofxosResource", "OpenaiResource", "PolygonResource", "TushareResource", "TwelvedataResource"]
14+
__all__ = ["AlpacaResource", "AlphavantageResource", "AnthropicResource", "CoinankResource", "DeepseekResource", "NofxosResource", "OpenaiResource", "PolygonResource", "QwenResource", "TushareResource", "TwelvedataResource"]

claw402/generated/deepseek.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Auto-generated by claw402 codegen — DO NOT EDIT
2+
# Provider: DeepSeek (deepseek)
3+
4+
class DeepseekDeepseek:
5+
def __init__(self, client):
6+
self._client = client
7+
8+
def chat(self, body: dict):
9+
"""Chat completions with DeepSeek-Chat (V3.2, general tasks) — $0.003/call"""
10+
return self._client._post("/api/v1/ai/deepseek/chat", body)
11+
12+
def chat_reasoner(self, body: dict):
13+
"""Chat completions with DeepSeek-Reasoner (chain-of-thought reasoning) — $0.005/call"""
14+
return self._client._post("/api/v1/ai/deepseek/chat/reasoner", body)
15+
16+
def completions(self, body: dict):
17+
"""DeepSeek beta completions API (FIM / non-chat completions) — $0.003/call"""
18+
return self._client._post("/api/v1/ai/deepseek/completions", body)
19+
20+
def models(self):
21+
"""List available DeepSeek models — $0.001/call"""
22+
return self._client._get("/api/v1/ai/deepseek/models", None)
23+
24+
25+
class DeepseekResource:
26+
def __init__(self, client):
27+
self._client = client
28+
self.deepseek = DeepseekDeepseek(client)

claw402/generated/qwen.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Auto-generated by claw402 codegen — DO NOT EDIT
2+
# Provider: Qwen (通义千问) (qwen)
3+
4+
class QwenQwen:
5+
def __init__(self, client):
6+
self._client = client
7+
8+
def chat_max(self, body: dict):
9+
"""Chat completions with Qwen3-Max (flagship, most powerful) — $0.01/call"""
10+
return self._client._post("/api/v1/ai/qwen/chat/max", body)
11+
12+
def chat_plus(self, body: dict):
13+
"""Chat completions with Qwen-Plus (best value) — $0.005/call"""
14+
return self._client._post("/api/v1/ai/qwen/chat/plus", body)
15+
16+
def chat_turbo(self, body: dict):
17+
"""Chat completions with Qwen-Turbo (fast response) — $0.002/call"""
18+
return self._client._post("/api/v1/ai/qwen/chat/turbo", body)
19+
20+
def chat_flash(self, body: dict):
21+
"""Chat completions with Qwen-Flash (ultra-low latency, cheapest) — $0.002/call"""
22+
return self._client._post("/api/v1/ai/qwen/chat/flash", body)
23+
24+
def chat_coder(self, body: dict):
25+
"""Code generation with Qwen3-Coder-Plus — $0.005/call"""
26+
return self._client._post("/api/v1/ai/qwen/chat/coder", body)
27+
28+
def chat_vl(self, body: dict):
29+
"""Multimodal vision understanding with Qwen-VL-Plus (image + text) — $0.005/call"""
30+
return self._client._post("/api/v1/ai/qwen/chat/vl", body)
31+
32+
33+
class QwenResource:
34+
def __init__(self, client):
35+
self._client = client
36+
self.qwen = QwenQwen(client)

0 commit comments

Comments
 (0)