Skip to content

Commit a65c9f9

Browse files
feat: add Gemini, Grok, Kimi, RootData provider support
Register GeminiResource, GrokResource, KimiResource, and RootdataResource in the Client struct and New() constructor. Add generated SDK files for all four providers.
1 parent 341ed67 commit a65c9f9

5 files changed

Lines changed: 170 additions & 22 deletions

File tree

client.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ type Client struct {
7070
Anthropic *AnthropicResource
7171
Deepseek *DeepseekResource
7272
Qwen *QwenResource
73+
Gemini *GeminiResource
74+
Grok *GrokResource
75+
Kimi *KimiResource
76+
// Web3 intelligence
77+
Rootdata *RootdataResource
7378
}
7479

7580
// New creates a new claw402 client with the given private key.
@@ -112,6 +117,11 @@ func New(privateKey string, opts ...Option) (*Client, error) {
112117
c.Anthropic = newAnthropicResource(c)
113118
c.Deepseek = newDeepseekResource(c)
114119
c.Qwen = newQwenResource(c)
120+
c.Gemini = newGeminiResource(c)
121+
c.Grok = newGrokResource(c)
122+
c.Kimi = newKimiResource(c)
123+
// Web3 intelligence
124+
c.Rootdata = newRootdataResource(c)
115125
return c, nil
116126
}
117127

gemini.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Auto-generated by claw402 codegen — DO NOT EDIT
2+
// Provider: Gemini (Google) (gemini)
3+
4+
package claw402
5+
6+
import (
7+
"context"
8+
"encoding/json"
9+
)
10+
11+
// GeminiGemini provides methods for Gemini gemini endpoints.
12+
type GeminiGemini struct {
13+
client *Client
14+
}
15+
16+
// Chat completions with Gemini 2.5 Pro (most powerful, 1M context) — $0.02/call
17+
func (r *GeminiGemini) Chat25Pro(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
18+
return r.client.post(ctx, "/api/v1/ai/gemini/chat/2.5-pro", body)
19+
}
20+
21+
// Chat completions with Gemini 2.5 Flash (best value) — $0.003/call
22+
func (r *GeminiGemini) Chat25Flash(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
23+
return r.client.post(ctx, "/api/v1/ai/gemini/chat/2.5-flash", body)
24+
}
25+
26+
// Chat completions with Gemini 2.5 Flash-Lite (fastest, cheapest) — $0.002/call
27+
func (r *GeminiGemini) Chat25FlashLite(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
28+
return r.client.post(ctx, "/api/v1/ai/gemini/chat/2.5-flash-lite", body)
29+
}
30+
31+
// List available Gemini models — $0.001/call
32+
func (r *GeminiGemini) Models(ctx context.Context) (json.RawMessage, error) {
33+
return r.client.get(ctx, "/api/v1/ai/gemini/models", nil)
34+
}
35+
36+
// GeminiResource provides access to all Gemini (Google) API endpoints.
37+
type GeminiResource struct {
38+
client *Client
39+
Gemini *GeminiGemini
40+
}
41+
42+
func newGeminiResource(c *Client) *GeminiResource {
43+
return &GeminiResource{
44+
client: c,
45+
Gemini: &GeminiGemini{client: c},
46+
}
47+
}
48+
49+

grok.go

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Auto-generated by claw402 codegen — DO NOT EDIT
2+
// Provider: Grok (xAI) (grok)
3+
4+
package claw402
5+
6+
import (
7+
"context"
8+
"encoding/json"
9+
)
10+
11+
// GrokGrok provides methods for Grok grok endpoints.
12+
type GrokGrok struct {
13+
client *Client
14+
}
15+
16+
// Chat completions with Grok-4 (flagship, 256K context) — $0.05/call
17+
func (r *GrokGrok) Chat4(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
18+
return r.client.post(ctx, "/api/v1/ai/grok/chat/4", body)
19+
}
20+
21+
// Chat completions with Grok-3-mini (fast, great value) — $0.003/call
22+
func (r *GrokGrok) Chat3Mini(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
23+
return r.client.post(ctx, "/api/v1/ai/grok/chat/3-mini", body)
24+
}
25+
26+
// List available Grok models — $0.001/call
27+
func (r *GrokGrok) Models(ctx context.Context) (json.RawMessage, error) {
28+
return r.client.get(ctx, "/api/v1/ai/grok/models", nil)
29+
}
30+
31+
// GrokResource provides access to all Grok (xAI) API endpoints.
32+
type GrokResource struct {
33+
client *Client
34+
Grok *GrokGrok
35+
}
36+
37+
func newGrokResource(c *Client) *GrokResource {
38+
return &GrokResource{
39+
client: c,
40+
Grok: &GrokGrok{client: c},
41+
}
42+
}
43+
44+

kimi.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Auto-generated by claw402 codegen — DO NOT EDIT
2+
// Provider: Kimi (Moonshot AI) (kimi)
3+
4+
package claw402
5+
6+
import (
7+
"context"
8+
"encoding/json"
9+
)
10+
11+
// KimiKimi provides methods for Kimi kimi endpoints.
12+
type KimiKimi struct {
13+
client *Client
14+
}
15+
16+
// Chat completions with Kimi K2 (1T MoE model, 256K context, excels at coding and reasoning) — $0.005/call
17+
func (r *KimiKimi) ChatK2(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
18+
return r.client.post(ctx, "/api/v1/ai/kimi/chat/k2", body)
19+
}
20+
21+
// List available Kimi models — $0.001/call
22+
func (r *KimiKimi) Models(ctx context.Context) (json.RawMessage, error) {
23+
return r.client.get(ctx, "/api/v1/ai/kimi/models", nil)
24+
}
25+
26+
// KimiResource provides access to all Kimi (Moonshot AI) API endpoints.
27+
type KimiResource struct {
28+
client *Client
29+
Kimi *KimiKimi
30+
}
31+
32+
func newKimiResource(c *Client) *KimiResource {
33+
return &KimiResource{
34+
client: c,
35+
Kimi: &KimiKimi{client: c},
36+
}
37+
}
38+
39+

rootdata.go

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ type RootdataRootdata struct {
1616
// RootdataRootdataSearchParams are the query parameters for Search.
1717
type RootdataRootdataSearchParams struct {
1818
Query string `json:"query,omitempty"`
19-
Page string `json:"page,omitempty"`
20-
PageSize string `json:"page_size,omitempty"`
19+
PreciseXSearch string `json:"precise_x_search,omitempty"`
2120
}
2221

23-
// Search projects, organizations, and people by keyword — $0.002/call
22+
// Search projects, VCs, and people by keyword. Body: {query: string, precise_x_search?: bool}. Default query: Bitcoin — $0.001/call
2423
func (r *RootdataRootdata) Search(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
2524
return r.client.post(ctx, "/api/v1/crypto/rootdata/search", body)
2625
}
@@ -33,17 +32,19 @@ type RootdataRootdataProjectParams struct {
3332
IncludeInvestors string `json:"include_investors,omitempty"`
3433
}
3534

36-
// Fetch detailed project info — funding rounds, team, tags. Required: project_id (int) OR contract_address (string) — $0.005/call
35+
// 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
3736
func (r *RootdataRootdata) Project(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
3837
return r.client.post(ctx, "/api/v1/crypto/rootdata/project", body)
3938
}
4039

4140
// RootdataRootdataOrgParams are the query parameters for Org.
4241
type RootdataRootdataOrgParams struct {
4342
OrgId string `json:"org_id,omitempty"`
43+
IncludeTeam string `json:"include_team,omitempty"`
44+
IncludeInvestments string `json:"include_investments,omitempty"`
4445
}
4546

46-
// Fetch organization / VC details. Required: org_id (int) — $0.005/call
47+
// Get VC/org details. Body: {org_id: int}. Optional: include_team, include_investments (bool). Find IDs via /search or /id-map — $0.001/call
4748
func (r *RootdataRootdata) Org(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
4849
return r.client.post(ctx, "/api/v1/crypto/rootdata/org", body)
4950
}
@@ -53,7 +54,7 @@ type RootdataRootdataPeopleParams struct {
5354
PeopleId string `json:"people_id,omitempty"`
5455
}
5556

56-
// Get individual person profile — career history, investments. Required: people_id (int) — $0.005/call
57+
// Get person profile with X metrics. Body: {people_id: int}. Find IDs via /search or /id-map — $0.001/call
5758
func (r *RootdataRootdata) People(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
5859
return r.client.post(ctx, "/api/v1/crypto/rootdata/people", body)
5960
}
@@ -64,7 +65,7 @@ type RootdataRootdataInvestorsParams struct {
6465
PageSize string `json:"page_size,omitempty"`
6566
}
6667

67-
// Batch retrieve investor information. Optional: page, page_size — $0.008/call
68+
// Batch list investors. Body: {page?: int, page_size?: int (max 100)}. Defaults: page=1, page_size=10 — $0.001/call
6869
func (r *RootdataRootdata) Investors(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
6970
return r.client.post(ctx, "/api/v1/crypto/rootdata/investors", body)
7071
}
@@ -73,20 +74,25 @@ func (r *RootdataRootdata) Investors(ctx context.Context, body map[string]interf
7374
type RootdataRootdataFundingParams struct {
7475
Page string `json:"page,omitempty"`
7576
PageSize string `json:"page_size,omitempty"`
77+
StartTime string `json:"start_time,omitempty"`
78+
EndTime string `json:"end_time,omitempty"`
79+
MinAmount string `json:"min_amount,omitempty"`
80+
MaxAmount string `json:"max_amount,omitempty"`
81+
ProjectId string `json:"project_id,omitempty"`
7682
}
7783

78-
// Batch fetch funding round information. Optional: page, page_size — $0.008/call
84+
// 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
7985
func (r *RootdataRootdata) Funding(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
8086
return r.client.post(ctx, "/api/v1/crypto/rootdata/funding", body)
8187
}
8288

8389
// RootdataRootdataChangesParams are the query parameters for Changes.
8490
type RootdataRootdataChangesParams struct {
85-
StartTime string `json:"start_time,omitempty"`
91+
BeginTime string `json:"begin_time,omitempty"`
8692
EndTime string `json:"end_time,omitempty"`
8793
}
8894

89-
// Sync data updates within a time range. Required: start_time (unix timestamp, seconds). Optional: end_time — $0.005/call
95+
// Sync recent data changes. Body: {begin_time: int (unix seconds)}. Optional: end_time. Note: param is begin_time (not start_time) — $0.001/call
9096
func (r *RootdataRootdata) Changes(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
9197
return r.client.post(ctx, "/api/v1/crypto/rootdata/changes", body)
9298
}
@@ -96,7 +102,7 @@ type RootdataRootdataHotParams struct {
96102
Days string `json:"days,omitempty"`
97103
}
98104

99-
// Top 100 trending crypto projects. Required: days (1=24h, 7=7d) — $0.010/call
105+
// Top 100 trending projects. Body: {days: int}. Values: 1 = 24h ranking, 7 = 7-day ranking — $0.001/call
100106
func (r *RootdataRootdata) Hot(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
101107
return r.client.post(ctx, "/api/v1/crypto/rootdata/hot", body)
102108
}
@@ -108,7 +114,7 @@ type RootdataRootdataHotXParams struct {
108114
Followers string `json:"followers,omitempty"`
109115
}
110116

111-
// Trending crypto projects on X (Twitter). Required: heat, influence, followers (bool filters) — $0.010/call
117+
// Trending crypto projects on X. Body: {heat: bool, influence: bool, followers: bool}. Set at least one to true — $0.001/call
112118
func (r *RootdataRootdata) HotX(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
113119
return r.client.post(ctx, "/api/v1/crypto/rootdata/hot-x", body)
114120
}
@@ -120,7 +126,7 @@ type RootdataRootdataKolParams struct {
120126
PageSize string `json:"page_size,omitempty"`
121127
}
122128

123-
// Leading crypto figures on X (Twitter). Required: rank_type (heat|influence). Optional: page, page_size — $0.010/call
129+
// Crypto KOL rankings on X. Body: {rank_type: 'heat' or 'influence'}. Optional: page, page_size — $0.001/call
124130
func (r *RootdataRootdata) Kol(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
125131
return r.client.post(ctx, "/api/v1/crypto/rootdata/kol", body)
126132
}
@@ -131,7 +137,7 @@ type RootdataRootdataJobChangesParams struct {
131137
RecentResignations string `json:"recent_resignations,omitempty"`
132138
}
133139

134-
// Crypto industry personnel movement. Required: recent_joinees (bool), recent_resignations (bool) — $0.010/call
140+
// Crypto personnel movements. Body: {recent_joinees: bool, recent_resignations: bool}. Set at least one to true — $0.001/call
135141
func (r *RootdataRootdata) JobChanges(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
136142
return r.client.post(ctx, "/api/v1/crypto/rootdata/job-changes", body)
137143
}
@@ -142,7 +148,7 @@ type RootdataRootdataNewTokensParams struct {
142148
PageSize string `json:"page_size,omitempty"`
143149
}
144150

145-
// Recently launched token projects. Optional: page, page_size — $0.010/call
151+
// Recently launched token projects. Optional: page, page_size — $0.001/call
146152
func (r *RootdataRootdata) NewTokens(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
147153
return r.client.post(ctx, "/api/v1/crypto/rootdata/new-tokens", body)
148154
}
@@ -152,17 +158,17 @@ type RootdataRootdataIdMapParams struct {
152158
Type string `json:"type,omitempty"`
153159
}
154160

155-
// Retrieve ID list. Required: type (1=projects, 2=organizations, 3=people) — $0.020/call
161+
// Get all entity IDs. Body: {type: int}. Values: 1=projects, 2=VCs, 3=people — $0.001/call
156162
func (r *RootdataRootdata) IdMap(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
157163
return r.client.post(ctx, "/api/v1/crypto/rootdata/id-map", body)
158164
}
159165

160-
// Retrieve full ecosystem directory. No required parameters. — $0.020/call
166+
// Get all ecosystem IDs and project counts. No parameters required — $0.001/call
161167
func (r *RootdataRootdata) EcosystemMap(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
162168
return r.client.post(ctx, "/api/v1/crypto/rootdata/ecosystem-map", body)
163169
}
164170

165-
// Access full tag / category mapping. No required parameters. — $0.020/call
171+
// Get all tag/category IDs. No parameters required — $0.001/call
166172
func (r *RootdataRootdata) TagMap(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
167173
return r.client.post(ctx, "/api/v1/crypto/rootdata/tag-map", body)
168174
}
@@ -174,7 +180,7 @@ type RootdataRootdataProjectsByEcosystemParams struct {
174180
PageSize string `json:"page_size,omitempty"`
175181
}
176182

177-
// Query projects by ecosystem IDs. Required: ecosystem_ids (string, comma-separated). Optional: page, page_size — $0.015/call
183+
// Projects by ecosystem. Body: {ecosystem_ids: string (comma-separated)}. Get IDs from /ecosystem-map first — $0.001/call
178184
func (r *RootdataRootdata) ProjectsByEcosystem(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
179185
return r.client.post(ctx, "/api/v1/crypto/rootdata/projects-by-ecosystem", body)
180186
}
@@ -186,7 +192,7 @@ type RootdataRootdataProjectsByTagParams struct {
186192
PageSize string `json:"page_size,omitempty"`
187193
}
188194

189-
// Query projects by tag IDs. Required: tag_ids (string, comma-separated). Optional: page, page_size — $0.015/call
195+
// Projects by tag. Body: {tag_ids: string (comma-separated)}. Get IDs from /tag-map first — $0.001/call
190196
func (r *RootdataRootdata) ProjectsByTag(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
191197
return r.client.post(ctx, "/api/v1/crypto/rootdata/projects-by-tag", body)
192198
}
@@ -196,12 +202,12 @@ type RootdataRootdataTwitterMapParams struct {
196202
Type string `json:"type,omitempty"`
197203
}
198204

199-
// Bulk export X / Twitter data. Required: type (1=projects, 2=organizations, 3=people) — $0.030/call
205+
// Bulk export X/Twitter data. Body: {type: int}. Values: 1=projects, 2=VCs, 3=people — $0.001/call
200206
func (r *RootdataRootdata) TwitterMap(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
201207
return r.client.post(ctx, "/api/v1/crypto/rootdata/twitter-map", body)
202208
}
203209

204-
// Check remaining API credits balance. No required parameters. — $0.001/call
210+
// Check API credits balance. No parameters required — $0.001/call
205211
func (r *RootdataRootdata) Credits(ctx context.Context, body map[string]interface{}) (json.RawMessage, error) {
206212
return r.client.post(ctx, "/api/v1/crypto/rootdata/credits", body)
207213
}

0 commit comments

Comments
 (0)