Skip to content

Commit 93bf02f

Browse files
feat: add Gemini, Grok, Kimi, RootData provider support
Register GeminiResource, GrokResource, KimiResource, and RootdataResource in the client constructor. Add generated SDK files for all four providers.
1 parent c4f82f2 commit 93bf02f

6 files changed

Lines changed: 107 additions & 20 deletions

File tree

claw402/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212
from .generated.anthropic import AnthropicResource
1313
from .generated.coinank import CoinankResource
1414
from .generated.deepseek import DeepseekResource
15+
from .generated.gemini import GeminiResource
16+
from .generated.grok import GrokResource
17+
from .generated.kimi import KimiResource
1518
from .generated.nofxos import NofxosResource
1619
from .generated.openai import OpenaiResource
1720
from .generated.polygon import PolygonResource
1821
from .generated.qwen import QwenResource
22+
from .generated.rootdata import RootdataResource
1923
from .generated.tushare import TushareResource
2024
from .generated.twelvedata import TwelvedataResource
2125

@@ -105,6 +109,11 @@ def __init__(self, private_key: str, base_url: str = "https://claw402.ai"):
105109
self.anthropic = AnthropicResource(self)
106110
self.deepseek = DeepseekResource(self)
107111
self.qwen = QwenResource(self)
112+
self.gemini = GeminiResource(self)
113+
self.grok = GrokResource(self)
114+
self.kimi = KimiResource(self)
115+
# Web3 intelligence
116+
self.rootdata = RootdataResource(self)
108117

109118
def close(self):
110119
"""Close the underlying HTTP session."""

claw402/generated/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
from .coinank import CoinankResource
66
from .coinmarketcap import CoinmarketcapResource
77
from .deepseek import DeepseekResource
8+
from .gemini import GeminiResource
9+
from .grok import GrokResource
10+
from .kimi import KimiResource
811
from .nofxos import NofxosResource
912
from .openai import OpenaiResource
1013
from .polygon import PolygonResource
@@ -13,4 +16,4 @@
1316
from .tushare import TushareResource
1417
from .twelvedata import TwelvedataResource
1518

16-
__all__ = ["AlpacaResource", "AlphavantageResource", "AnthropicResource", "CoinankResource", "CoinmarketcapResource", "DeepseekResource", "NofxosResource", "OpenaiResource", "PolygonResource", "QwenResource", "RootdataResource", "TushareResource", "TwelvedataResource"]
19+
__all__ = ["AlpacaResource", "AlphavantageResource", "AnthropicResource", "CoinankResource", "CoinmarketcapResource", "DeepseekResource", "GeminiResource", "GrokResource", "KimiResource", "NofxosResource", "OpenaiResource", "PolygonResource", "QwenResource", "RootdataResource", "TushareResource", "TwelvedataResource"]

claw402/generated/gemini.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Auto-generated by claw402 codegen — DO NOT EDIT
2+
# Provider: Gemini (Google) (gemini)
3+
4+
class GeminiGemini:
5+
def __init__(self, client):
6+
self._client = client
7+
8+
def chat25_pro(self, body: dict):
9+
"""Chat completions with Gemini 2.5 Pro (most powerful, 1M context) — $0.02/call"""
10+
return self._client._post("/api/v1/ai/gemini/chat/2.5-pro", body)
11+
12+
def chat25_flash(self, body: dict):
13+
"""Chat completions with Gemini 2.5 Flash (best value) — $0.003/call"""
14+
return self._client._post("/api/v1/ai/gemini/chat/2.5-flash", body)
15+
16+
def chat25_flash_lite(self, body: dict):
17+
"""Chat completions with Gemini 2.5 Flash-Lite (fastest, cheapest) — $0.002/call"""
18+
return self._client._post("/api/v1/ai/gemini/chat/2.5-flash-lite", body)
19+
20+
def models(self):
21+
"""List available Gemini models — $0.001/call"""
22+
return self._client._get("/api/v1/ai/gemini/models", None)
23+
24+
25+
class GeminiResource:
26+
def __init__(self, client):
27+
self._client = client
28+
self.gemini = GeminiGemini(client)
29+

claw402/generated/grok.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Auto-generated by claw402 codegen — DO NOT EDIT
2+
# Provider: Grok (xAI) (grok)
3+
4+
class GrokGrok:
5+
def __init__(self, client):
6+
self._client = client
7+
8+
def chat4(self, body: dict):
9+
"""Chat completions with Grok-4 (flagship, 256K context) — $0.05/call"""
10+
return self._client._post("/api/v1/ai/grok/chat/4", body)
11+
12+
def chat3_mini(self, body: dict):
13+
"""Chat completions with Grok-3-mini (fast, great value) — $0.003/call"""
14+
return self._client._post("/api/v1/ai/grok/chat/3-mini", body)
15+
16+
def models(self):
17+
"""List available Grok models — $0.001/call"""
18+
return self._client._get("/api/v1/ai/grok/models", None)
19+
20+
21+
class GrokResource:
22+
def __init__(self, client):
23+
self._client = client
24+
self.grok = GrokGrok(client)
25+

claw402/generated/kimi.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Auto-generated by claw402 codegen — DO NOT EDIT
2+
# Provider: Kimi (Moonshot AI) (kimi)
3+
4+
class KimiKimi:
5+
def __init__(self, client):
6+
self._client = client
7+
8+
def chat_k2(self, body: dict):
9+
"""Chat completions with Kimi K2 (1T MoE model, 256K context, excels at coding and reasoning) — $0.005/call"""
10+
return self._client._post("/api/v1/ai/kimi/chat/k2", body)
11+
12+
def models(self):
13+
"""List available Kimi models — $0.001/call"""
14+
return self._client._get("/api/v1/ai/kimi/models", None)
15+
16+
17+
class KimiResource:
18+
def __init__(self, client):
19+
self._client = client
20+
self.kimi = KimiKimi(client)
21+

claw402/generated/rootdata.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,79 +6,79 @@ def __init__(self, client):
66
self._client = client
77

88
def search(self, body: dict):
9-
"""Search projects, organizations, and people by keyword — $0.002/call"""
9+
"""Search projects, VCs, and people by keyword. Body: {query: string, precise_x_search?: bool}. Default query: Bitcoin — $0.001/call"""
1010
return self._client._post("/api/v1/crypto/rootdata/search", body)
1111

1212
def project(self, body: dict):
13-
"""Fetch detailed project info — funding rounds, team, tags. Required: project_id (int) OR contract_address (string) — $0.005/call"""
13+
"""Get project details. Body: {project_id: int} OR {contract_address: string}. Optional: include_team, include_investors (bool). Find IDs via /search or /id-map — $0.001/call"""
1414
return self._client._post("/api/v1/crypto/rootdata/project", body)
1515

1616
def org(self, body: dict):
17-
"""Fetch organization / VC details. Required: org_id (int) — $0.005/call"""
17+
"""Get VC/org details. Body: {org_id: int}. Optional: include_team, include_investments (bool). Find IDs via /search or /id-map — $0.001/call"""
1818
return self._client._post("/api/v1/crypto/rootdata/org", body)
1919

2020
def people(self, body: dict):
21-
"""Get individual person profile — career history, investments. Required: people_id (int) — $0.005/call"""
21+
"""Get person profile with X metrics. Body: {people_id: int}. Find IDs via /search or /id-map — $0.001/call"""
2222
return self._client._post("/api/v1/crypto/rootdata/people", body)
2323

2424
def investors(self, body: dict):
25-
"""Batch retrieve investor information. Optional: page, page_size — $0.008/call"""
25+
"""Batch list investors. Body: {page?: int, page_size?: int (max 100)}. Defaults: page=1, page_size=10 — $0.001/call"""
2626
return self._client._post("/api/v1/crypto/rootdata/investors", body)
2727

2828
def funding(self, body: dict):
29-
"""Batch fetch funding round information. Optional: page, page_size — $0.008/call"""
29+
"""Batch list funding rounds. Optional filters: start_time, end_time (unix sec), min_amount, max_amount (USD), project_id (int), page, page_size — $0.001/call"""
3030
return self._client._post("/api/v1/crypto/rootdata/funding", body)
3131

3232
def changes(self, body: dict):
33-
"""Sync data updates within a time range. Required: start_time (unix timestamp, seconds). Optional: end_time — $0.005/call"""
33+
"""Sync recent data changes. Body: {begin_time: int (unix seconds)}. Optional: end_time. Note: param is begin_time (not start_time) — $0.001/call"""
3434
return self._client._post("/api/v1/crypto/rootdata/changes", body)
3535

3636
def hot(self, body: dict):
37-
"""Top 100 trending crypto projects. Required: days (1=24h, 7=7d) — $0.010/call"""
37+
"""Top 100 trending projects. Body: {days: int}. Values: 1 = 24h ranking, 7 = 7-day ranking — $0.001/call"""
3838
return self._client._post("/api/v1/crypto/rootdata/hot", body)
3939

4040
def hot_x(self, body: dict):
41-
"""Trending crypto projects on X (Twitter). Required: heat, influence, followers (bool filters) — $0.010/call"""
41+
"""Trending crypto projects on X. Body: {heat: bool, influence: bool, followers: bool}. Set at least one to true — $0.001/call"""
4242
return self._client._post("/api/v1/crypto/rootdata/hot-x", body)
4343

4444
def kol(self, body: dict):
45-
"""Leading crypto figures on X (Twitter). Required: rank_type (heat|influence). Optional: page, page_size — $0.010/call"""
45+
"""Crypto KOL rankings on X. Body: {rank_type: 'heat' or 'influence'}. Optional: page, page_size — $0.001/call"""
4646
return self._client._post("/api/v1/crypto/rootdata/kol", body)
4747

4848
def job_changes(self, body: dict):
49-
"""Crypto industry personnel movement. Required: recent_joinees (bool), recent_resignations (bool) — $0.010/call"""
49+
"""Crypto personnel movements. Body: {recent_joinees: bool, recent_resignations: bool}. Set at least one to true — $0.001/call"""
5050
return self._client._post("/api/v1/crypto/rootdata/job-changes", body)
5151

5252
def new_tokens(self, body: dict):
53-
"""Recently launched token projects. Optional: page, page_size — $0.010/call"""
53+
"""Recently launched token projects. Optional: page, page_size — $0.001/call"""
5454
return self._client._post("/api/v1/crypto/rootdata/new-tokens", body)
5555

5656
def id_map(self, body: dict):
57-
"""Retrieve ID list. Required: type (1=projects, 2=organizations, 3=people) — $0.020/call"""
57+
"""Get all entity IDs. Body: {type: int}. Values: 1=projects, 2=VCs, 3=people — $0.001/call"""
5858
return self._client._post("/api/v1/crypto/rootdata/id-map", body)
5959

6060
def ecosystem_map(self, body: dict):
61-
"""Retrieve full ecosystem directory. No required parameters. — $0.020/call"""
61+
"""Get all ecosystem IDs and project counts. No parameters required — $0.001/call"""
6262
return self._client._post("/api/v1/crypto/rootdata/ecosystem-map", body)
6363

6464
def tag_map(self, body: dict):
65-
"""Access full tag / category mapping. No required parameters. — $0.020/call"""
65+
"""Get all tag/category IDs. No parameters required — $0.001/call"""
6666
return self._client._post("/api/v1/crypto/rootdata/tag-map", body)
6767

6868
def projects_by_ecosystem(self, body: dict):
69-
"""Query projects by ecosystem IDs. Required: ecosystem_ids (string, comma-separated). Optional: page, page_size — $0.015/call"""
69+
"""Projects by ecosystem. Body: {ecosystem_ids: string (comma-separated)}. Get IDs from /ecosystem-map first — $0.001/call"""
7070
return self._client._post("/api/v1/crypto/rootdata/projects-by-ecosystem", body)
7171

7272
def projects_by_tag(self, body: dict):
73-
"""Query projects by tag IDs. Required: tag_ids (string, comma-separated). Optional: page, page_size — $0.015/call"""
73+
"""Projects by tag. Body: {tag_ids: string (comma-separated)}. Get IDs from /tag-map first — $0.001/call"""
7474
return self._client._post("/api/v1/crypto/rootdata/projects-by-tag", body)
7575

7676
def twitter_map(self, body: dict):
77-
"""Bulk export X / Twitter data. Required: type (1=projects, 2=organizations, 3=people) — $0.030/call"""
77+
"""Bulk export X/Twitter data. Body: {type: int}. Values: 1=projects, 2=VCs, 3=people — $0.001/call"""
7878
return self._client._post("/api/v1/crypto/rootdata/twitter-map", body)
7979

8080
def credits(self, body: dict):
81-
"""Check remaining API credits balance. No required parameters. — $0.001/call"""
81+
"""Check API credits balance. No parameters required — $0.001/call"""
8282
return self._client._post("/api/v1/crypto/rootdata/credits", body)
8383

8484

0 commit comments

Comments
 (0)