creatorriver 0.6.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,6 +22,8 @@ Behind a proxy, set `HTTPS_PROXY` (and `NO_PROXY` for hosts to reach directly).
22
22
 
23
23
  ```bash
24
24
  creatorriver account
25
+ creatorriver pricing --charged-only
26
+ creatorriver credits --days 30
25
27
  creatorriver campaigns create --brief "Skincare brand looking for US beauty creators" --status active
26
28
  creatorriver creators search --query "US beauty creators reviewing skincare" --platforms youtube,tiktok --campaign-id <campaign-id>
27
29
  creatorriver searches expand --search-id <search-id> --limit 40
@@ -30,15 +32,25 @@ creatorriver creators browse --campaign-id <campaign-id> --limit 20
30
32
  creatorriver creators find --reference "Marques Brownlee"
31
33
  creatorriver trends videos --platform tiktok --window 24h
32
34
  creatorriver trends hashtags --platform tiktok
35
+ creatorriver lists create --name "Q4 Skincare Shortlist"
36
+ creatorriver lists add --list-id <list-id> --creator-ids <first-id>,<second-id>
37
+ creatorriver exports preview --list-id <list-id>
38
+ creatorriver exports prepare --creator-ids <first-id>,<second-id>
39
+ creatorriver lists export --list-id <list-id>
40
+ creatorriver campaigns export --campaign-id <campaign-id> --no-include-email
33
41
  creatorriver contacts reveal --campaign-id <campaign-id> --creator-id <creator-id>
34
- creatorriver contacts reveal-batch --campaign-id <campaign-id> --creator-ids <first-id>,<second-id>
42
+ creatorriver contacts reveal-batch --campaign-id <campaign-id> --creator-ids <first-id>,<second-id> --dry-run
35
43
  creatorriver emails send --campaign-id <campaign-id> --creator-id <creator-id> --subject "Partnership" --body "Hi! ..."
36
44
  creatorriver conversations get --campaign-id <campaign-id> --creator-id <creator-id>
37
45
  creatorriver campaigns status --campaign-id <campaign-id>
38
46
  ```
39
47
 
40
- To find new prospects, pass `--exclude-contacted` to `creators search`, `creators browse` or `creators similar`. Use `--exclude-exported` or `--exclude-uploaded` to also omit past exports or the list uploaded on the website, and `--has-recent-viral` to narrow `creators search` or `creators browse` to creators with a 10x+ breakout video in the last 30 days. Filtered browsing counts toward the search allowance shown by `account` (paging the same filtered list that day with `--offset`, or expanding a same-day search with `searches expand`, uses no extra allowance). Unpaid accounts with less than 0.5 credits drop to 5 searches a day until any purchase. For a follow-up in an existing conversation you can omit `--subject`.
48
+ Call `creatorriver pricing` to inspect unit credit prices, plans, daily limits and the structured cost of every operation before spending; call `creatorriver credits` to review recent spend and bounce refunds. Every credit-spending command (`creators unlock`, `campaigns add`, `contacts reveal`, `contacts reveal-batch`, `exports prepare`, `emails send`) returns a `credits` receipt (`charged`, `balance`, `breakdown`) and supports `--dry-run` to preview the request and estimated maximum credit cost without calling the API.
41
49
 
42
- Every command prints one line of JSON: `{"ok":true,"data":...}` on stdout, or `{"ok":false,"error":{"code","message","requestId"}}` on stderr with an exit code per error: 1 internal, 2 invalid_input, 3 unauthorized, 4 not_found, 5 conflict, 6 insufficient_credits, 7 rate_limited, 8 network_error, 9 login_pending. Each command's `--help` lists its flags, what it costs and what it needs first. `--input-json '{...}'` passes the whole input as JSON.
50
+ Saving creators to custom lists (`lists create`, `lists add`, `creators save`) is free; handles, profile links and emails stay hidden until unlocked or revealed. Use `exports preview` to inspect exact unlock and email costs, `exports prepare` (up to 10 creators per call) to unlock profiles and optionally reveal emails, and `searches export`, `lists export` or `campaigns export` to download CSV (pass `--no-include-email` on any export or prepare command to omit emails and unlock profiles only).
51
+
52
+ To find new prospects, pass `--exclude-contacted` to `creators search`, `creators browse` or `creators similar`. Use `--exclude-exported` or `--exclude-uploaded` to also omit past exports or the list uploaded on the website, and `--has-recent-viral` to narrow `creators search` or `creators browse` to creators with a 10x+ breakout video in the last 30 days. Filtered browsing counts toward the search allowance shown by `account` (paging the same filtered list that day with `--offset`, or expanding a same-day search with `searches expand`, uses no extra allowance). Unpaid accounts with less than 0.5 credits drop to 5 searches a day until any purchase. Free and one-time credit-pack accounts can send up to 100 free outreach emails/day; active Pro subscriptions allow up to 200/day (emails 101-200 cost 0.1 credits each). For a follow-up in an existing conversation you can omit `--subject`. Boolean flags also accept `--no-<flag>` (e.g. `--no-include-email`, `--no-archived`).
53
+
54
+ Every command prints one line of JSON: `{"ok":true,"data":...}` on stdout, or `{"ok":false,"error":{"code","message","requestId"}}` on stderr with an exit code per error: 1 internal, 2 invalid_input, 3 unauthorized, 4 not_found, 5 conflict, 6 insufficient_credits, 7 rate_limited, 8 network_error, 9 login_pending. Each command's `--help` lists its flags, what it costs and what it needs first. `--input-json '{...}'` passes the whole input as JSON, and `--dry-run` previews the request and upper-bound credit cost locally.
43
55
 
44
56
  The same operations are available as an MCP server at `https://www.creatorriver.com/api/mcp` and as a REST API at `https://www.creatorriver.com/api/v1`, both with `Authorization: Bearer <key>`.
@@ -78,6 +78,21 @@ import { z as z2 } from "zod";
78
78
  function defineOperation(spec) {
79
79
  return spec;
80
80
  }
81
+ function estimateMaxOperationCredits(operation, input = {}) {
82
+ const { cost } = operation;
83
+ if (cost.model === "free" || cost.model === "quota") {
84
+ return 0;
85
+ }
86
+ const perUnit = operation.name === "prepare_export" && input.includeEmail === false ? 0.5 : cost.maxCreditsPerUnit ?? 0;
87
+ if (perUnit <= 0) {
88
+ return 0;
89
+ }
90
+ const count2 = Array.isArray(input.creatorIds) ? new Set(
91
+ input.creatorIds.filter((item) => typeof item === "string").map((item) => item.trim()).filter(Boolean)
92
+ ).size : 1;
93
+ const boundedCount = cost.maxUnitsPerCall ? Math.min(count2, cost.maxUnitsPerCall) : count2;
94
+ return Math.round(perUnit * boundedCount * 10) / 10;
95
+ }
81
96
 
82
97
  // ../contract/src/path.ts
83
98
  var PARAM = /^\{(\w+)\}$/;
@@ -102,11 +117,98 @@ function fillPath(template, input) {
102
117
 
103
118
  // ../contract/src/operations.ts
104
119
  import { z as z3 } from "zod";
120
+ var FREE_COST = {
121
+ model: "free",
122
+ label: "Free"
123
+ };
124
+ var SEARCH_QUOTA_COST = {
125
+ model: "quota",
126
+ label: "Free (daily search quota)",
127
+ quota: "daily_search",
128
+ note: "0 credits; counts toward the daily search allowance (20/day unpaid, 5/day unpaid with < 0.5 credits, 500/day after any purchase). Same-day repeat queries use no extra allowance."
129
+ };
130
+ var BROWSE_QUOTA_COST = {
131
+ model: "quota",
132
+ label: "Free (filtered lists use daily search quota)",
133
+ quota: "daily_search",
134
+ note: "0 credits; default unfiltered browse and same-day paging use no allowance. Filtered lists count once per day against the daily search allowance."
135
+ };
136
+ var EXPAND_QUOTA_COST = {
137
+ model: "quota",
138
+ label: "Free (older searches use daily search quota)",
139
+ quota: "daily_search",
140
+ note: "0 credits; expanding a search from today uses no extra allowance, while expanding an older search counts as one daily search."
141
+ };
142
+ var UNLOCK_COST = {
143
+ model: "per_item",
144
+ label: "0.5 credits (first time)",
145
+ actions: ["creator_unlock"],
146
+ unit: "creator",
147
+ maxCreditsPerUnit: 0.5,
148
+ maxUnitsPerCall: 1,
149
+ idempotent: true,
150
+ note: "Charged once per account and creator; repeat unlocks are free."
151
+ };
152
+ var ADD_CREATOR_COST = {
153
+ model: "per_item",
154
+ label: "0.5 credits (first unlock)",
155
+ actions: ["creator_unlock"],
156
+ unit: "creator",
157
+ maxCreditsPerUnit: 0.5,
158
+ maxUnitsPerCall: 1,
159
+ idempotent: true,
160
+ note: "Unlocks the creator if not yet unlocked (0 credits if already unlocked). Use add_to_list to shortlist for free."
161
+ };
162
+ var REVEAL_CONTACT_COST = {
163
+ model: "per_item",
164
+ label: "Up to 0.7 credits (0.5 unlock + 0.2 email)",
165
+ actions: ["creator_unlock", "contact_reveal"],
166
+ unit: "creator",
167
+ maxCreditsPerUnit: 0.7,
168
+ maxUnitsPerCall: 1,
169
+ idempotent: true,
170
+ note: "0.5 first unlock + 0.2 first email reveal (0 if already paid; skipped with 0 charge when no email exists). Bounced or dropped emails refund 0.2 credits."
171
+ };
172
+ var REVEAL_CONTACTS_COST = {
173
+ model: "per_item",
174
+ label: "Up to 0.7 credits/creator (max 10)",
175
+ actions: ["creator_unlock", "contact_reveal"],
176
+ unit: "creator",
177
+ maxCreditsPerUnit: 0.7,
178
+ maxUnitsPerCall: 10,
179
+ idempotent: true,
180
+ note: "Per available creator: 0.5 first unlock + 0.2 first email reveal. Creators with no email are skipped before charging. Call preview_export with creatorIds first for an exact quote."
181
+ };
182
+ var PREPARE_EXPORT_COST = {
183
+ model: "per_item",
184
+ label: "Up to 0.7 credits/creator (0.5 without email; max 10)",
185
+ actions: ["creator_unlock", "contact_reveal"],
186
+ unit: "creator",
187
+ maxCreditsPerUnit: 0.7,
188
+ maxUnitsPerCall: 10,
189
+ idempotent: true,
190
+ note: "0.5 first unlock + optional 0.2 first email reveal when includeEmail is true (default). Call preview_export first for an exact quote."
191
+ };
192
+ var SEND_EMAIL_COST = {
193
+ model: "overage",
194
+ label: "First 100/day free, then 0.1 credits/email",
195
+ actions: ["outreach_email"],
196
+ unit: "email",
197
+ maxCreditsPerUnit: 0.1,
198
+ maxUnitsPerCall: 1,
199
+ idempotent: true,
200
+ quota: "daily_outreach",
201
+ note: "First 100 emails/day free (free and credit-pack accounts cap at 100/day; active Pro subscriptions allow up to 200/day at 0.1 credits each past 100). Failed or bounced emails refund usage and credits."
202
+ };
105
203
  var searchId = z3.string().trim().min(1).describe(
106
204
  "Search id, from search_creators, find_similar_creators or list_searches"
107
205
  );
108
206
  var creatorId = z3.string().trim().min(1).describe("Creator id, from search_creators results");
109
207
  var campaignId = z3.string().trim().min(1).describe("Campaign id, from list_campaigns or create_campaign");
208
+ var listId = z3.string().trim().min(1).describe("List id, from list_lists or create_list");
209
+ var includeEmailColumn = z3.boolean().optional().describe(
210
+ "Include the Email column (default true). Pass false to omit emails"
211
+ );
110
212
  var limit = (max, fallback) => z3.number().int().min(1).max(max).optional().describe(`How many to return, 1-${max} (default ${fallback})`);
111
213
  var count = (what) => z3.number().int().min(0).optional().describe(what);
112
214
  var PLATFORMS = ["youtube", "instagram", "tiktok"];
@@ -149,10 +251,44 @@ var getAccount = defineOperation({
149
251
  method: "GET",
150
252
  path: "/account",
151
253
  kind: "read",
254
+ cost: FREE_COST,
152
255
  summary: "Show the credit balance, prices and today\u2019s usage",
153
- description: "Returns the credit balance, what each paid action costs, the plan, paid status, the maximum results per search, and today\u2019s usage against the daily limits (unpaid accounts with less than 0.5 credits drop to 5 searches a day until any purchase). Free. Call it first to confirm the API key works, and before spending credits.",
256
+ description: "Returns the credit balance, unit prices, a summary of all credit-spending and quota-limited operations, the plan, paid status, the maximum results per search, and today\u2019s usage against daily limits (unpaid accounts with less than 0.5 credits drop to 5 searches a day until any purchase; free and one-time credit-pack accounts cap at 100 outreach emails/day while active Pro subscriptions allow up to 200/day). Free. Call it first to confirm the API key works, and call get_pricing for the full per-operation catalog and plans.",
154
257
  input: z3.object({})
155
258
  });
259
+ var getPricing = defineOperation({
260
+ name: "get_pricing",
261
+ command: ["pricing"],
262
+ method: "GET",
263
+ path: "/pricing",
264
+ kind: "read",
265
+ cost: FREE_COST,
266
+ summary: "List prices, plans, limits and per-operation costs",
267
+ description: "Returns the complete Creator River pricing catalog so an agent can plan strategy and budget without trial calls: unit credit prices, credit packs and subscriptions (matching the SaaS pricing page), daily limits by tier (free, one-time credit pack, active Pro subscription), refund policies, and the structured cost of every operation across REST, MCP and CLI. Free. Pass chargedOnly: true to list only credit-spending or quota-limited operations, or group to narrow to one command group.",
268
+ input: z3.object({
269
+ chargedOnly: z3.boolean().optional().describe(
270
+ "Only include operations that charge credits or consume a daily quota (default false, returns all operations)"
271
+ ),
272
+ group: z3.string().trim().min(1).max(40).optional().describe(
273
+ "Only include operations in this command group, e.g. creators, contacts, exports, emails, campaigns, lists, searches, trends"
274
+ )
275
+ })
276
+ });
277
+ var getCreditHistory = defineOperation({
278
+ name: "get_credit_history",
279
+ command: ["credits"],
280
+ method: "GET",
281
+ path: "/account/credits",
282
+ kind: "read",
283
+ cost: FREE_COST,
284
+ summary: "Show credit spending summary and transaction history",
285
+ description: "Returns the current credit balance, an aggregated spending and refund summary by action over the requested day window, and recent credit transactions (unlocks, email reveals, outreach overages, bounce refunds, signup gift and purchases). Free.",
286
+ input: z3.object({
287
+ days: z3.number().int().min(1).max(90).optional().describe("Recent UTC days to summarize and list, 1-90 (default 30)"),
288
+ limit: limit(100, 50),
289
+ offset: z3.number().int().min(0).optional().describe("Skip this many transactions for paging (default 0)")
290
+ })
291
+ });
156
292
  var accountExclusionFilters = {
157
293
  excludeContacted: z3.boolean().optional().describe(
158
294
  "Exclude this account\u2019s contacted or do-not-contact creators across all campaigns"
@@ -203,6 +339,7 @@ var searchCreators = defineOperation({
203
339
  method: "POST",
204
340
  path: "/searches",
205
341
  kind: "read",
342
+ cost: SEARCH_QUOTA_COST,
206
343
  summary: "Find creators by description and filters",
207
344
  description: "Searches the creator database by meaning: describe the creators you want in plain words (niche, content, audience), and optionally narrow by platform, niche, creator country, audience country, language, size, engagement rate and how recently they posted. To find creators like ones the user already knows, pass their handles or profile links as exampleCreators. A new search counts toward the daily search allowance and costs no credits. Repeating the same successful search that day uses no extra allowance (see get_account). Results show each creator\u2019s name and account state (identityUnlocked, emailUnlocked, isSaved, campaignMemberships), but no handle or profile link, plus pagination; call expand_search to load more unseen results into the same search. Pass campaignId to rank against that campaign\u2019s brief and record the search in it.",
208
345
  input: z3.object({
@@ -223,6 +360,7 @@ var browseCreators = defineOperation({
223
360
  method: "GET",
224
361
  path: "/creators/browse",
225
362
  kind: "read",
363
+ cost: BROWSE_QUOTA_COST,
226
364
  summary: "List creators by filters or campaign taste",
227
365
  description: "Lists the creators that match the filters with no description to match, as the dashboard\u2019s Discover list does before a search. Without campaignId, results are ordered most followed first; with campaignId, results are ranked by that campaign\u2019s taste profile (brief, saved, added, revealed and excluded creators) and fall back to most-followed when no signals exist yet, indicated by ranking (campaign_taste or top_followed). An offset already at the account limit returns an empty page with ranking set to null. Browsing costs no credits and respects maxSearchResults (50 unpaid, 100 paid). Pass offset (from pagination.nextOffset) to read further pages. A filtered list uses the daily search allowance; paging through the same filtered list that day, or reading the default unfiltered list, uses no extra allowance. Browse lists stay out of search history. Use it for asks like the biggest beauty creators in the US or fresh picks for an active campaign; use search_creators when the user describes what the content should be about. Results show names and account state (identityUnlocked, emailUnlocked, isSaved, campaignMemberships), but no handles.",
228
366
  input: z3.object({
@@ -242,6 +380,7 @@ var findCreator = defineOperation({
242
380
  method: "GET",
243
381
  path: "/creators/lookup",
244
382
  kind: "read",
383
+ cost: FREE_COST,
245
384
  summary: "Find a creator by handle, profile link or name",
246
385
  description: "Looks up a creator the user names by @handle, profile link or display name. An explicit @handle or profile link returns exact matches across platforms ordered by followers descending; a plain name returns up to 8 matching candidates. Returns creatorId, followers and account state (isSaved, identityUnlocked, emailUnlocked, campaignMemberships) for get_creator, find_similar_creators, add_creator or reveal_contact. Free. An empty list means no creator matched that reference.",
247
386
  input: z3.object({
@@ -256,6 +395,7 @@ var findSimilarCreators = defineOperation({
256
395
  method: "POST",
257
396
  path: "/creators/{creatorId}/similar",
258
397
  kind: "read",
398
+ cost: SEARCH_QUOTA_COST,
259
399
  summary: "Find creators like one or more you already have",
260
400
  description: "Finds creators whose content and audience are closest to one seed creator \u2014 or up to five fused seeds via additionalCreatorIds \u2014 defaulting to the seed platform(s) unless platforms is set. Pass the creatorId of a search or find_creator result, no handle or unlock needed. A new similar search counts toward the daily search allowance and costs no credits (see get_account); paging the same seeds and filters that day uses no extra allowance. With campaignId, creators already in that campaign or excluded from it are left out. Results include seeds, pagination, names and account state (isSaved, identityUnlocked, emailUnlocked, campaignMemberships) but no handles, each with a matchScore from 0 to 1; the search is kept, so expand_search can load more unseen matches and list_searches or get_search can read it again.",
261
401
  input: z3.object({
@@ -276,6 +416,7 @@ var listSearches = defineOperation({
276
416
  method: "GET",
277
417
  path: "/searches",
278
418
  kind: "read",
419
+ cost: FREE_COST,
279
420
  summary: "List past searches",
280
421
  description: "Lists the searches run before, newest first, with their query, filters and how many results they had, including find_similar_creators ones. Free, and does not count against the daily search limit. To see a search\u2019s results again, call get_search instead of searching again.",
281
422
  input: z3.object({
@@ -291,6 +432,7 @@ var getSearch = defineOperation({
291
432
  method: "GET",
292
433
  path: "/searches/{searchId}",
293
434
  kind: "read",
435
+ cost: FREE_COST,
294
436
  summary: "Read a past search\u2019s results again",
295
437
  description: "Returns a past search, its results in rank order with account state (identityUnlocked, emailUnlocked, isSaved, campaignMemberships), and pagination. Free, and does not count against the daily search limit. Call expand_search to append more unseen results.",
296
438
  input: z3.object({ searchId })
@@ -301,6 +443,7 @@ var expandSearch = defineOperation({
301
443
  method: "POST",
302
444
  path: "/searches/{searchId}/more",
303
445
  kind: "write",
446
+ cost: EXPAND_QUOTA_COST,
304
447
  summary: "Load more results for a past search",
305
448
  description: "Appends unseen creators to a saved search_creators or find_similar_creators search in its original history entry and keeps existing rows in order. Pass limit as the desired total result count, up to maxSearchResults from get_account (50 unpaid, 100 paid). Returns only the newly added results with account state, totalCount and pagination. Expanding a search from today uses no extra daily allowance; expanding an older search counts as one search. Free (no credits). Similar searches saved before reference creators were recorded can be reopened with get_search. Start a new similar search to load more matches for those older searches.",
306
449
  input: z3.object({
@@ -316,6 +459,7 @@ var getSearchFilters = defineOperation({
316
459
  method: "GET",
317
460
  path: "/searches/filters",
318
461
  kind: "read",
462
+ cost: FREE_COST,
319
463
  summary: "List the values the search filters take",
320
464
  description: "Returns the values the search and browse filters accept: platforms, creator countries and languages present in the database, niches and activity windows. Free.",
321
465
  input: z3.object({})
@@ -326,6 +470,7 @@ var updateSearch = defineOperation({
326
470
  method: "PATCH",
327
471
  path: "/searches/{searchId}",
328
472
  kind: "write",
473
+ cost: FREE_COST,
329
474
  summary: "Rename or archive a past search",
330
475
  description: "Names a past search, or archives it so list_searches leaves it out (archived: false brings it back). Free.",
331
476
  input: z3.object({
@@ -340,11 +485,13 @@ var exportSearch = defineOperation({
340
485
  method: "GET",
341
486
  path: "/searches/{searchId}/export",
342
487
  kind: "write",
488
+ cost: FREE_COST,
343
489
  summary: "Export a search\u2019s results as CSV",
344
- description: "Returns a search\u2019s results as CSV text, one row per creator in rank order, as the dashboard\u2019s export does: handles and profile links only for unlocked creators, and emails only for ones already revealed. Exporting costs no credits and records the returned creators as exported for this account. Later searches can omit them with excludeExported. Save csv to a file named filename.",
490
+ description: "Returns a search\u2019s results as CSV text, one row per creator in rank order, as the dashboard\u2019s export does: handles and profile links only for unlocked creators, and the Email column (unless includeEmail is false) only for ones already revealed. Exporting costs no credits; call preview_export and prepare_export first if you want to unlock missing profiles or reveal emails before downloading. Records the returned creators as exported for this account so later searches can omit them with excludeExported. Save csv to a file named filename.",
345
491
  input: z3.object({
346
492
  searchId,
347
- scope: z3.enum(["all", "added"]).optional().describe("all results (default), or only the ones added to a campaign")
493
+ scope: z3.enum(["all", "added"]).optional().describe("all results (default), or only the ones added to a campaign"),
494
+ includeEmail: includeEmailColumn
348
495
  })
349
496
  });
350
497
  var getCreator = defineOperation({
@@ -353,8 +500,9 @@ var getCreator = defineOperation({
353
500
  method: "GET",
354
501
  path: "/creators/{creatorId}",
355
502
  kind: "read",
503
+ cost: FREE_COST,
356
504
  summary: "Show a creator\u2019s profile",
357
- description: "Returns a creator\u2019s profile: platform, country, language, followers, views, engagement, topics, weighted hashtags, audience, recent content, estimated price, active campaign memberships, whether an email is available, and detailUrl (their Creator River web page). Free. Until you unlock the creator, the handle, profile link and recent video titles and links are hidden. Pass campaignId to also see where the creator stands in that campaign.",
505
+ description: "Returns a creator\u2019s profile: platform, country, language, followers, views, engagement, topics, weighted hashtags, audience, recent content, estimated price, active campaign memberships, saved listIds, whether an email is available, and detailUrl (their Creator River web page). Free. Until you unlock the creator, the handle, profile link and recent video titles and links are hidden. Pass campaignId to also see where the creator stands in that campaign.",
358
506
  input: z3.object({
359
507
  creatorId,
360
508
  campaignId: campaignId.optional().describe("Also show this campaign\u2019s progress with the creator")
@@ -366,8 +514,9 @@ var unlockCreator = defineOperation({
366
514
  method: "POST",
367
515
  path: "/creators/{creatorId}/unlock",
368
516
  kind: "spend",
517
+ cost: UNLOCK_COST,
369
518
  summary: "Unlock a creator\u2019s handle and profile link",
370
- description: "Unlocks the creator and returns the full profile with handle, profile link, recent video titles and links, and detailUrl (their Creator River web page). Costs 0.5 credits the first time for each creator; unlocking again is free. It does not reveal the email address; use reveal_contact for that.",
519
+ description: "Unlocks the creator and returns the full profile with handle, profile link, recent video titles and links, saved listIds, detailUrl (their Creator River web page) and a credits receipt (charged and remaining balance). Costs 0.5 credits the first time for each creator; unlocking again is free. It does not reveal the email address; use reveal_contact or prepare_export for that.",
371
520
  input: z3.object({ creatorId })
372
521
  });
373
522
  var saveCreator = defineOperation({
@@ -376,10 +525,12 @@ var saveCreator = defineOperation({
376
525
  method: "POST",
377
526
  path: "/creators/{creatorId}/save",
378
527
  kind: "write",
379
- summary: "Save a creator to the account\u2019s default list",
380
- description: "Saves a creator to the account\u2019s default list (the dashboard\u2019s Lists page). Free; handles, profile links and emails remain locked until unlocked or revealed. Pass searchId to remember where they were found.",
528
+ cost: FREE_COST,
529
+ summary: "Save a creator to a list",
530
+ description: "Saves a creator to a creator list (the account\u2019s default \u201CMy Favorites\u201D list when listId is omitted). Free; handles, profile links and emails remain locked until unlocked or revealed. Pass searchId to remember where they were found. Use add_to_list to add up to 100 creators at once.",
381
531
  input: z3.object({
382
532
  creatorId,
533
+ listId: listId.optional().describe("Target list id (defaults to the account\u2019s default list)"),
383
534
  searchId: z3.string().trim().min(1).optional().describe("The search the creator was found in")
384
535
  })
385
536
  });
@@ -389,8 +540,9 @@ var unsaveCreator = defineOperation({
389
540
  method: "DELETE",
390
541
  path: "/creators/{creatorId}/save",
391
542
  kind: "write",
392
- summary: "Remove a creator from the saved list",
393
- description: "Removes a creator from the account\u2019s saved list. Free; the creator stays unlocked and in any campaign.",
543
+ cost: FREE_COST,
544
+ summary: "Remove a creator from all saved lists",
545
+ description: "Removes a creator from every creator list on this account. Free; the creator stays unlocked and in any campaign. Use remove_from_list to remove from a single list instead.",
394
546
  input: z3.object({ creatorId })
395
547
  });
396
548
  var listSavedCreators = defineOperation({
@@ -399,19 +551,176 @@ var listSavedCreators = defineOperation({
399
551
  method: "GET",
400
552
  path: "/creators/saved",
401
553
  kind: "read",
402
- summary: "List saved creators",
403
- description: "Lists the creators on the account\u2019s saved list, most recently saved first. Free.",
554
+ cost: FREE_COST,
555
+ summary: "List saved creators across all lists",
556
+ description: "Lists all creators saved to any list on this account, most recently saved first. Free. Use list_lists and get_list to inspect individual lists.",
557
+ input: z3.object({
558
+ page: z3.number().int().min(1).optional().describe("Page number, from 1"),
559
+ limit: limit(100, 20)
560
+ })
561
+ });
562
+ var listLists = defineOperation({
563
+ name: "list_lists",
564
+ command: ["lists", "list"],
565
+ method: "GET",
566
+ path: "/lists",
567
+ kind: "read",
568
+ cost: FREE_COST,
569
+ summary: "List creator lists",
570
+ description: "Lists your creator lists (including the default \u201CMy Favorites\u201D list) with each list\u2019s id, name, isDefault flag and creator count. Free.",
571
+ input: z3.object({})
572
+ });
573
+ var createList = defineOperation({
574
+ name: "create_list",
575
+ command: ["lists", "create"],
576
+ method: "POST",
577
+ path: "/lists",
578
+ kind: "write",
579
+ cost: FREE_COST,
580
+ summary: "Create a creator list",
581
+ description: "Creates a custom creator list (up to 50 lists per account) to organize prospects outside or before campaigns. Free.",
582
+ input: z3.object({
583
+ name: z3.string().trim().min(1).max(80).describe("List name, up to 80 characters")
584
+ })
585
+ });
586
+ var updateList = defineOperation({
587
+ name: "update_list",
588
+ command: ["lists", "update"],
589
+ method: "PATCH",
590
+ path: "/lists/{listId}",
591
+ kind: "write",
592
+ cost: FREE_COST,
593
+ summary: "Rename a creator list",
594
+ description: "Renames one of your creator lists. Free.",
404
595
  input: z3.object({
596
+ listId,
597
+ name: z3.string().trim().min(1).max(80).describe("New list name, up to 80 characters")
598
+ })
599
+ });
600
+ var deleteList = defineOperation({
601
+ name: "delete_list",
602
+ command: ["lists", "delete"],
603
+ method: "DELETE",
604
+ path: "/lists/{listId}",
605
+ kind: "write",
606
+ cost: FREE_COST,
607
+ summary: "Delete a custom creator list",
608
+ description: "Deletes a custom creator list. Free. The default list cannot be deleted. Creators saved in other lists stay saved there, and unlocked creators or campaigns are unchanged.",
609
+ input: z3.object({ listId })
610
+ });
611
+ var getList = defineOperation({
612
+ name: "get_list",
613
+ command: ["lists", "get"],
614
+ method: "GET",
615
+ path: "/lists/{listId}",
616
+ kind: "read",
617
+ cost: FREE_COST,
618
+ summary: "List creators in a creator list",
619
+ description: "Lists the creators in one creator list, most recently added first, with platform counts and account state (identityUnlocked, emailUnlocked, campaignMemberships). Free; handles, profile links and emails remain hidden until unlocked or revealed.",
620
+ input: z3.object({
621
+ listId,
622
+ platform: z3.enum(PLATFORMS).optional().describe("Only creators on this platform"),
405
623
  page: z3.number().int().min(1).optional().describe("Page number, from 1"),
406
624
  limit: limit(100, 20)
407
625
  })
408
626
  });
627
+ var addToList = defineOperation({
628
+ name: "add_to_list",
629
+ command: ["lists", "add"],
630
+ method: "POST",
631
+ path: "/lists/{listId}/creators",
632
+ kind: "write",
633
+ cost: FREE_COST,
634
+ summary: "Add creators to a creator list",
635
+ description: "Adds 1 to 100 creators to a creator list in one call. Free; handles, profile links and emails remain locked until unlocked or revealed. Pass searchId to record which search they came from.",
636
+ input: z3.object({
637
+ listId,
638
+ creatorIds: z3.array(creatorId).min(1).max(100).describe("1 to 100 creator IDs to add"),
639
+ searchId: searchId.optional().describe("The search the creators were found in")
640
+ })
641
+ });
642
+ var removeFromList = defineOperation({
643
+ name: "remove_from_list",
644
+ command: ["lists", "remove"],
645
+ method: "DELETE",
646
+ path: "/lists/{listId}/creators/{creatorId}",
647
+ kind: "write",
648
+ cost: FREE_COST,
649
+ summary: "Remove a creator from a creator list",
650
+ description: "Removes one creator from a specific creator list. Free; memberships in other lists, unlocked state and campaigns are unchanged.",
651
+ input: z3.object({ listId, creatorId })
652
+ });
653
+ var exportList = defineOperation({
654
+ name: "export_list",
655
+ command: ["lists", "export"],
656
+ method: "GET",
657
+ path: "/lists/{listId}/export",
658
+ kind: "write",
659
+ cost: FREE_COST,
660
+ summary: "Export a creator list as CSV",
661
+ description: "Returns a creator list (optionally filtered by platform or creatorIds) as CSV text: handles and profile links only for unlocked creators, and the Email column (unless includeEmail is false) only for ones already revealed. Exporting costs no credits; call preview_export and prepare_export first if you want to unlock missing profiles or reveal emails before downloading. Records the returned creators as exported for excludeExported. Save csv to a file named filename.",
662
+ input: z3.object({
663
+ listId,
664
+ platform: z3.enum(PLATFORMS).optional().describe("Only creators on this platform"),
665
+ creatorIds: z3.array(creatorId).min(1).max(100).optional().describe(
666
+ "Optional subset of 1 to 100 creator IDs in this list, in desired order"
667
+ ),
668
+ includeEmail: includeEmailColumn
669
+ })
670
+ });
671
+ var previewExport = defineOperation({
672
+ name: "preview_export",
673
+ command: ["exports", "preview"],
674
+ method: "POST",
675
+ path: "/exports/preview",
676
+ kind: "read",
677
+ cost: FREE_COST,
678
+ summary: "Preview credit cost before exporting CSV",
679
+ description: "Computes the exact credit cost to unlock missing profiles (0.5 credits each) and, when includeEmail is true, reveal missing business emails (0.2 credits each) before exporting a search, campaign, creator list or explicit list of creatorIds. Free and read-only. Returns counts, unlockCostCredits, emailCostCredits, totalCostCredits, balanceCredits, canAfford and pendingCreatorIds to pass to prepare_export in chunks of up to 10.",
680
+ input: z3.object({
681
+ searchId: searchId.optional().describe("Preview exporting this search"),
682
+ campaignId: campaignId.optional().describe("Preview exporting this campaign"),
683
+ listId: listId.optional().describe("Preview exporting this creator list"),
684
+ creatorIds: z3.array(creatorId).min(1).max(100).optional().describe(
685
+ "1 to 100 creator IDs directly, or a subset of campaignId or listId"
686
+ ),
687
+ scope: z3.enum(["all", "added"]).optional().describe(
688
+ "With searchId: all results (default), or only ones added to a campaign"
689
+ ),
690
+ platform: z3.enum(PLATFORMS).optional().describe("With listId: only creators on this platform"),
691
+ includeEmail: z3.boolean().optional().describe(
692
+ "Include email reveal charges in the cost preview (default true). Pass false to preview profile unlock costs only"
693
+ )
694
+ })
695
+ });
696
+ var prepareExport = defineOperation({
697
+ name: "prepare_export",
698
+ command: ["exports", "prepare"],
699
+ method: "POST",
700
+ path: "/exports/prepare",
701
+ kind: "spend",
702
+ cost: PREPARE_EXPORT_COST,
703
+ summary: "Unlock profiles and emails for CSV export",
704
+ description: "Unlocks up to 10 selected creators (0.5 credits each, first time only) and, when includeEmail is true (default), reveals their business emails (0.2 credits each, first time only) without adding them to a campaign, returning per-item results and a credits receipt (charged and remaining balance). Call preview_export first to quote the total cost and get approval, then pass pendingCreatorIds here in chunks of up to 10 before calling export_search, export_campaign or export_list. Safe to retry: already unlocked creators and revealed emails are never charged again.",
705
+ input: z3.object({
706
+ creatorIds: z3.array(creatorId).min(1).max(10).describe(
707
+ "1 to 10 creator IDs to unlock and optionally reveal emails for"
708
+ ),
709
+ includeEmail: z3.boolean().optional().describe(
710
+ "Also reveal business emails at 0.2 credits each (default true). Pass false to unlock handles and profile links at 0.5 credits only"
711
+ ),
712
+ campaignId: campaignId.optional().describe(
713
+ "For a campaign export, prepare only creators in this campaign and associate newly revealed emails with it"
714
+ )
715
+ })
716
+ });
409
717
  var listCampaigns = defineOperation({
410
718
  name: "list_campaigns",
411
719
  command: ["campaigns", "list"],
412
720
  method: "GET",
413
721
  path: "/campaigns",
414
722
  kind: "read",
723
+ cost: FREE_COST,
415
724
  summary: "List campaigns",
416
725
  description: "Lists your campaigns with their brief, status and how many creators are at each stage. Free. Every account has a default \u201CGeneral Outreach\u201D campaign you can use when no specific campaign fits.",
417
726
  input: z3.object({
@@ -426,6 +735,7 @@ var createCampaign = defineOperation({
426
735
  method: "POST",
427
736
  path: "/campaigns",
428
737
  kind: "write",
738
+ cost: FREE_COST,
429
739
  summary: "Create a campaign",
430
740
  description: "Creates a campaign from a brief: the product, the goal and the creators you want. Free. Campaigns group the creators you contact; pass the campaign id to search_creators to rank results for the brief.",
431
741
  input: z3.object({
@@ -440,6 +750,7 @@ var updateCampaign = defineOperation({
440
750
  method: "PATCH",
441
751
  path: "/campaigns/{campaignId}",
442
752
  kind: "write",
753
+ cost: FREE_COST,
443
754
  summary: "Change a campaign\u2019s name, brief or status",
444
755
  description: "Changes a campaign: its name, its brief, its status, or whether it is archived. Pass only what changes. Free. A new brief is kept as the next revision, and searches with this campaignId rank against it from then on; creators already in the campaign stay.",
445
756
  input: z3.object({
@@ -456,6 +767,7 @@ var getCampaignStatus = defineOperation({
456
767
  method: "GET",
457
768
  path: "/campaigns/{campaignId}/status",
458
769
  kind: "read",
770
+ cost: FREE_COST,
459
771
  summary: "Show a campaign\u2019s pipeline",
460
772
  description: "Shows where a campaign stands: the searches run for it, and its creators by stage (outreach, negotiation, collaboration), each with the next action and who the conversation is waiting on. Free. Counts cover the whole campaign; each stage lists its most recently active items first. To go through every creator at one stage, pass stage and read page 1, 2, \u2026 until you have count items. Use it to decide what to do next across a campaign.",
461
773
  input: z3.object({
@@ -475,8 +787,9 @@ var revealContact = defineOperation({
475
787
  method: "POST",
476
788
  path: "/campaigns/{campaignId}/creators/{creatorId}/contact",
477
789
  kind: "spend",
790
+ cost: REVEAL_CONTACT_COST,
478
791
  summary: "Reveal a creator\u2019s email for a campaign",
479
- description: "Returns the creator\u2019s email address so you can contact them in this campaign, adding the creator to the campaign first if needed. Adding unlocks the creator, which costs 0.5 credits the first time for each creator. Revealing costs 0.2 credits the first time for each creator; revealing again, in any campaign, is free. Use this or reveal_contacts before send_email.",
792
+ description: "Returns the creator\u2019s email address and a credits receipt (charged and remaining balance) so you can contact them in this campaign, adding the creator to the campaign first if needed. Adding unlocks the creator, which costs 0.5 credits the first time for each creator. Revealing costs 0.2 credits the first time for each creator; revealing again, in any campaign, is free. Creators without a revealable email fail before unlocking and cost 0 credits. Bounced or dropped emails refund 0.2 credits automatically. Use this or reveal_contacts before send_email.",
480
793
  input: z3.object({ campaignId, creatorId })
481
794
  });
482
795
  var revealContacts = defineOperation({
@@ -485,8 +798,9 @@ var revealContacts = defineOperation({
485
798
  method: "POST",
486
799
  path: "/campaigns/{campaignId}/contacts/reveal",
487
800
  kind: "spend",
801
+ cost: REVEAL_CONTACTS_COST,
488
802
  summary: "Reveal selected creators\u2019 emails for a campaign",
489
- description: "Reveals emails for up to 10 selected creators in this campaign. Each available contact is added to the campaign. The first unlock costs 0.5 credits and the first email reveal costs 0.2 credits per creator across the account. Check the budget for the whole selection before calling. Read items for each unique creator in input order: successful items include revealedContact, and other items report why the reveal failed. Earlier successes are kept. Retrying reuses previous charges.",
803
+ description: "Reveals emails for up to 10 selected creators in this campaign and returns a credits receipt (charged and remaining balance). Each available contact is added to the campaign; creators without an email are skipped before charging. The first unlock costs 0.5 credits and the first email reveal costs 0.2 credits per creator across the account. Call preview_export with creatorIds first to get an exact account-scoped quote before spending. Read items for each unique creator in input order: successful items include revealedContact, and other items report why the reveal failed. Earlier successes are kept. Retrying reuses previous charges.",
490
804
  input: z3.object({
491
805
  campaignId,
492
806
  creatorIds: z3.array(creatorId).min(1).max(10).describe("1 to 10 selected creator IDs"),
@@ -499,8 +813,9 @@ var sendEmail = defineOperation({
499
813
  method: "POST",
500
814
  path: "/campaigns/{campaignId}/creators/{creatorId}/emails",
501
815
  kind: "send",
816
+ cost: SEND_EMAIL_COST,
502
817
  summary: "Email a creator",
503
- description: 'Sends a plain-text email to the creator\u2019s revealed address (call reveal_contact first). Replies arrive in the conversation (see get_conversation). A later email to the same creator in the same campaign is a follow-up: it joins the creator\u2019s existing email thread, keeps the conversation\u2019s stage, and copies whoever last replied for the creator (a manager, say); leave subject out to reply as "Re: <subject>". Subject and body can carry variables, filled in for this creator when it is sent, so one draft fits every creator: {name} (how to address them, cleaned from the channel name), {handle} (@handle), {platform}, {followers} (e.g. 75K) and {country}. A misspelled variable, or one this creator has no value for, fails the send with a message naming it. The first 100 emails each day are free; after that each costs 0.1 credits, up to the daily limit (see get_account). Sending the same subject and body to the same creator in the same campaign again returns the first send instead of emailing twice; pass a new idempotencyKey to send it again on purpose, for example after a send that failed.',
818
+ description: 'Sends a plain-text email to the creator\u2019s revealed address (call reveal_contact first) and returns a credits receipt (charged, remaining balance and remaining free daily emails). Replies arrive in the conversation (see get_conversation). A later email to the same creator in the same campaign is a follow-up: it joins the creator\u2019s existing email thread, keeps the conversation\u2019s stage, and copies whoever last replied for the creator (a manager, say); leave subject out to reply as "Re: <subject>". Subject and body can carry variables, filled in for this creator when it is sent, so one draft fits every creator: {name} (how to address them, cleaned from the channel name), {handle} (@handle), {platform}, {followers} (e.g. 75K) and {country}. A misspelled variable, or one this creator has no value for, fails the send with a message naming it. The first 100 emails each day are free: free and one-time credit-pack accounts cap at 100/day, while active Pro subscriptions allow up to 200/day with emails 101-200 costing 0.1 credits each (see get_account or get_pricing). Failed, bounced or dropped emails refund daily quota and any overage charge. Sending the same subject and body to the same creator in the same campaign again returns the first send instead of emailing twice; pass a new idempotencyKey to send it again on purpose, for example after a send that failed.',
504
819
  input: z3.object({
505
820
  campaignId,
506
821
  creatorId,
@@ -519,6 +834,7 @@ var getConversation = defineOperation({
519
834
  method: "GET",
520
835
  path: "/campaigns/{campaignId}/creators/{creatorId}/conversation",
521
836
  kind: "read",
837
+ cost: FREE_COST,
522
838
  summary: "Read the email conversation with a creator",
523
839
  description: "Returns the email thread with a creator in a campaign: its stage, who it is waiting on, the next action and agreed facts, plus every message and event, oldest first. Free. Check it for replies after send_email. An out-of-office or other automatic answer appears as an auto_reply event and leaves the thread waiting on the creator. The thread is null until the first email is sent.",
524
840
  input: z3.object({ campaignId, creatorId })
@@ -531,6 +847,7 @@ var recordReply = defineOperation({
531
847
  method: "POST",
532
848
  path: "/campaigns/{campaignId}/creators/{creatorId}/replies",
533
849
  kind: "write",
850
+ cost: FREE_COST,
534
851
  summary: "Record a reply the creator sent outside Creator River",
535
852
  description: "Records a reply that reached the user some other way (a DM, another inbox, a call) and how it went. positive or neutral moves the creator to negotiation (a confirmed collaboration stays), waiting on the user; negative records that they declined and closes the conversation. Free. Replies to emails sent with send_email arrive on their own (see get_conversation), so never record those. Needs an email sent first. Recording the same reply again changes nothing.",
536
853
  input: z3.object({
@@ -550,6 +867,7 @@ var confirmCollaboration = defineOperation({
550
867
  method: "POST",
551
868
  path: "/campaigns/{campaignId}/creators/{creatorId}/collaboration",
552
869
  kind: "write",
870
+ cost: FREE_COST,
553
871
  summary: "Record that a creator agreed to collaborate",
554
872
  description: "Records that the creator agreed to work with the user, with the agreed terms, and moves them to the collaboration stage, waiting on the user to prepare it. Free. Call it only once the creator has clearly said yes to the terms; it sends nothing to the creator. Needs an email sent first. Confirming the same terms again changes nothing.",
555
873
  input: z3.object({
@@ -567,8 +885,9 @@ var addCreator = defineOperation({
567
885
  method: "POST",
568
886
  path: "/campaigns/{campaignId}/creators/{creatorId}",
569
887
  kind: "spend",
570
- summary: "Shortlist a creator in a campaign",
571
- description: "Adds a creator to a campaign, at the outreach stage, without revealing the email: use it to build a shortlist before deciding whom to contact (reveal_contact adds the creator too). Adding unlocks the creator, which costs 0.5 credits the first time for each creator; adding again is free. Pass searchId to mark the creator as added in that search.",
888
+ cost: ADD_CREATOR_COST,
889
+ summary: "Add and unlock a creator in a campaign",
890
+ description: "Adds a creator to a campaign, at the outreach stage, without revealing the email, and returns a credits receipt (charged and remaining balance). Adding unlocks the creator, which costs 0.5 credits the first time for each creator; adding again or adding an already unlocked creator is free. Use add_to_list instead if you only want to shortlist creators for free without unlocking (reveal_contact adds the creator too). Pass searchId to mark the creator as added in that search.",
572
891
  input: z3.object({
573
892
  campaignId,
574
893
  creatorId,
@@ -581,6 +900,7 @@ var excludeCreator = defineOperation({
581
900
  method: "POST",
582
901
  path: "/campaigns/{campaignId}/creators/{creatorId}/exclusion",
583
902
  kind: "write",
903
+ cost: FREE_COST,
584
904
  summary: "Hide a creator from discovery for a campaign",
585
905
  description: "Marks a creator as Not Fit for discovery in this campaign. Searches, recommendations and similar-creator results omit them. Pass searchId to hide them in that search as well. Free.",
586
906
  input: z3.object({
@@ -589,12 +909,30 @@ var excludeCreator = defineOperation({
589
909
  searchId: z3.string().trim().min(1).optional().describe("A search to drop the creator from as well")
590
910
  })
591
911
  });
912
+ var exportCampaign = defineOperation({
913
+ name: "export_campaign",
914
+ command: ["campaigns", "export"],
915
+ method: "GET",
916
+ path: "/campaigns/{campaignId}/export",
917
+ kind: "write",
918
+ cost: FREE_COST,
919
+ summary: "Export a campaign\u2019s creators as CSV",
920
+ description: "Returns a campaign\u2019s active creators (or a selected subset via creatorIds) as CSV text: handles and profile links only for unlocked creators, and the Email column (unless includeEmail is false) only for ones already revealed. Exporting costs no credits; call preview_export and prepare_export first if you want to unlock missing profiles or reveal emails before downloading. Records the returned creators as exported for excludeExported. Save csv to a file named filename.",
921
+ input: z3.object({
922
+ campaignId,
923
+ creatorIds: z3.array(creatorId).min(1).max(100).optional().describe(
924
+ "Optional subset of 1 to 100 creator IDs in this campaign, in desired order"
925
+ ),
926
+ includeEmail: includeEmailColumn
927
+ })
928
+ });
592
929
  var listTrendingVideos = defineOperation({
593
930
  name: "list_trending_videos",
594
931
  command: ["trends", "videos"],
595
932
  method: "GET",
596
933
  path: "/trends/videos",
597
934
  kind: "read",
935
+ cost: FREE_COST,
598
936
  summary: "List recent viral videos across platforms",
599
937
  description: "Lists quality-gated viral videos (10x+ above each creator\u2019s baseline views) across YouTube, Instagram and TikTok, deduplicated to one top video per creator by default. Free. Returns video metrics, hashtags, creatorId, creatorName, hasEmail and account access states (identityUnlocked, emailUnlocked, isSaved, campaignMemberships). Source video IDs, creator handles and playback links stay hidden until the creator is unlocked (unlock_creator, add_creator or reveal_contact).",
600
938
  input: z3.object({
@@ -619,6 +957,7 @@ var listTrendingHashtags = defineOperation({
619
957
  method: "GET",
620
958
  path: "/trends/hashtags",
621
959
  kind: "read",
960
+ cost: FREE_COST,
622
961
  summary: "List rising and popular hashtags across platforms",
623
962
  description: "Lists trending hashtags across YouTube, Instagram and TikTok using Creator River\u2019s dual-track trend engine: steady 7-day momentum baselines by default, or live viral-video aggregations when filtering by country, time window, sponsored status or business email availability. Free. Returns each tag, state, creator count, total views, delta, related tags and sample creators with creatorId and hasEmail (no handles until unlocked).",
624
963
  input: z3.object({
@@ -638,6 +977,8 @@ var listTrendingHashtags = defineOperation({
638
977
  });
639
978
  var operations = [
640
979
  getAccount,
980
+ getPricing,
981
+ getCreditHistory,
641
982
  searchCreators,
642
983
  browseCreators,
643
984
  findCreator,
@@ -655,11 +996,22 @@ var operations = [
655
996
  saveCreator,
656
997
  unsaveCreator,
657
998
  listSavedCreators,
999
+ listLists,
1000
+ createList,
1001
+ updateList,
1002
+ deleteList,
1003
+ getList,
1004
+ addToList,
1005
+ removeFromList,
1006
+ exportList,
1007
+ previewExport,
1008
+ prepareExport,
658
1009
  listCampaigns,
659
1010
  createCampaign,
660
1011
  updateCampaign,
661
1012
  getCampaignStatus,
662
1013
  addCreator,
1014
+ exportCampaign,
663
1015
  revealContact,
664
1016
  revealContacts,
665
1017
  sendEmail,
@@ -670,10 +1022,10 @@ var operations = [
670
1022
  ];
671
1023
 
672
1024
  // src/cli.ts
673
- import { Command, CommanderError } from "commander";
1025
+ import { Command, CommanderError, Option } from "commander";
674
1026
 
675
1027
  // package.json
676
- var version = "0.6.2";
1028
+ var version = "0.8.0";
677
1029
 
678
1030
  // src/http.ts
679
1031
  var DEFAULT_API_URL = "https://www.creatorriver.com";
@@ -737,19 +1089,12 @@ async function send(endpoint2, url, init) {
737
1089
  `Unexpected response from ${url.origin} (HTTP ${response.status})`
738
1090
  );
739
1091
  }
740
- async function callOperation(operation, input, connection) {
1092
+ function buildOperationRequest(operation, input, endpoint2) {
741
1093
  const params = new Set(pathParamNames(operation.path));
742
1094
  const fields = Object.entries(input).filter(
743
1095
  ([name, value]) => !params.has(name) && value !== void 0
744
1096
  );
745
- const url = apiUrl(connection, `/api/v1${fillPath(operation.path, input)}`);
746
- const headers = {
747
- authorization: `Bearer ${connection.apiKey}`
748
- };
749
- const init = {
750
- method: operation.method,
751
- headers
752
- };
1097
+ const url = apiUrl(endpoint2, `/api/v1${fillPath(operation.path, input)}`);
753
1098
  if (operation.method === "GET") {
754
1099
  for (const [name, value] of fields) {
755
1100
  url.searchParams.set(
@@ -757,11 +1102,28 @@ async function callOperation(operation, input, connection) {
757
1102
  Array.isArray(value) ? value.join(",") : String(value)
758
1103
  );
759
1104
  }
760
- } else {
1105
+ return { method: operation.method, url };
1106
+ }
1107
+ return {
1108
+ method: operation.method,
1109
+ url,
1110
+ body: Object.fromEntries(fields)
1111
+ };
1112
+ }
1113
+ async function callOperation(operation, input, connection) {
1114
+ const built = buildOperationRequest(operation, input, connection);
1115
+ const headers = {
1116
+ authorization: `Bearer ${connection.apiKey}`
1117
+ };
1118
+ const init = {
1119
+ method: built.method,
1120
+ headers
1121
+ };
1122
+ if (built.body !== void 0) {
761
1123
  headers["content-type"] = "application/json";
762
- init.body = JSON.stringify(Object.fromEntries(fields));
1124
+ init.body = JSON.stringify(built.body);
763
1125
  }
764
- return send(connection, url, init);
1126
+ return send(connection, built.url, init);
765
1127
  }
766
1128
  function postJson(endpoint2, path, body) {
767
1129
  return send(endpoint2, apiUrl(endpoint2, path), {
@@ -897,8 +1259,10 @@ async function waitForLogin(endpoint2, io, login, waitSeconds) {
897
1259
  var LOGIN_HINT = "run `creatorriver auth login`";
898
1260
  var GROUP_DESCRIPTIONS = {
899
1261
  creators: "Find, inspect, unlock and save creators, and find more like one",
1262
+ lists: "Create, manage and export creator lists",
1263
+ exports: "Preview costs and unlock creators before exporting CSV",
900
1264
  trends: "List recent viral videos and rising hashtags across platforms",
901
- campaigns: "Create, change and follow campaigns and the creators in them",
1265
+ campaigns: "Create, change, follow and export campaigns and the creators in them",
902
1266
  contacts: "Reveal email addresses for one or more selected creators",
903
1267
  emails: "Send outreach emails",
904
1268
  conversations: "Read email threads with creators and record their replies",
@@ -913,6 +1277,34 @@ function forCli(text, operations2) {
913
1277
  text
914
1278
  );
915
1279
  }
1280
+ function formatCliSummary(operation) {
1281
+ return operation.cost.model === "free" ? operation.summary : `${operation.summary} [${operation.cost.label}]`;
1282
+ }
1283
+ function formatCliDescription(operation, operations2) {
1284
+ const base = forCli(operation.description, operations2) ?? "";
1285
+ const note = forCli(operation.cost.note, operations2);
1286
+ const costLine = note ? `Cost: ${operation.cost.label} \u2014 ${note}` : `Cost: ${operation.cost.label}`;
1287
+ return base ? `${base}
1288
+
1289
+ ${costLine}` : costLine;
1290
+ }
1291
+ function dryRunNote(operation, input) {
1292
+ if (operation.cost.model === "free") {
1293
+ return void 0;
1294
+ }
1295
+ if (operation.cost.model === "quota") {
1296
+ return "0 credits; may count toward the daily search allowance (check `creatorriver account` or `creatorriver pricing`).";
1297
+ }
1298
+ if (operation.name === "send_email") {
1299
+ return "First 100 outreach emails/day are free (Pro subscriptions allow 101-200/day at 0.1 credits each). Check `creatorriver account` for remaining free emails today.";
1300
+ }
1301
+ if (Array.isArray(input.creatorIds) && input.creatorIds.length > 0) {
1302
+ const ids = input.creatorIds.join(",");
1303
+ const noEmailFlag = operation.name === "prepare_export" && input.includeEmail === false ? " --no-include-email" : "";
1304
+ return `Upper bound assuming none are unlocked yet. Run \`creatorriver exports preview --creator-ids ${ids}${noEmailFlag}\` for an exact account-scoped quote.`;
1305
+ }
1306
+ return "Upper bound assuming this creator has not been unlocked or revealed yet; repeating already-paid items costs 0 credits.";
1307
+ }
916
1308
  function describeFlag(field, operations2) {
917
1309
  return [
918
1310
  forCli(field.description, operations2),
@@ -945,7 +1337,7 @@ function buildInput(fields, options) {
945
1337
  for (const field of fields) {
946
1338
  const value = options[field.name];
947
1339
  if (value === void 0) continue;
948
- input[field.name] = field.kind === "boolean" ? true : parseFieldText(field, String(value));
1340
+ input[field.name] = field.kind === "boolean" ? Boolean(value) : parseFieldText(field, String(value));
949
1341
  }
950
1342
  return input;
951
1343
  }
@@ -1020,17 +1412,22 @@ Exit codes: 0 ok, ${Object.entries(EXIT_CODES).sort(([, a], [, b]) => a - b).map
1020
1412
  parent = program.commands.find((command2) => command2.name() === first) ?? program.command(first).description(GROUP_DESCRIPTIONS[first] ?? "");
1021
1413
  }
1022
1414
  const fields = describeFields(operation.input);
1023
- const command = parent.command(second ?? first).summary(operation.summary).description(forCli(operation.description, operations2) ?? "");
1415
+ const command = parent.command(second ?? first).summary(formatCliSummary(operation)).description(formatCliDescription(operation, operations2));
1024
1416
  for (const field of fields) {
1025
1417
  const flag = flagName(field.name);
1026
- command.option(
1027
- field.kind === "boolean" ? flag : `${flag} <value>`,
1028
- describeFlag(field, operations2)
1029
- );
1418
+ if (field.kind === "boolean") {
1419
+ command.option(flag, describeFlag(field, operations2));
1420
+ command.addOption(new Option(`--no-${flag.slice(2)}`).hideHelp());
1421
+ } else {
1422
+ command.option(`${flag} <value>`, describeFlag(field, operations2));
1423
+ }
1030
1424
  }
1031
1425
  command.option(
1032
1426
  "--input-json <json>",
1033
1427
  "the whole input as a JSON object; flags override its fields"
1428
+ ).option(
1429
+ "--dry-run",
1430
+ "preview the request and estimated maximum credit cost without calling the API"
1034
1431
  ).action(async (options) => {
1035
1432
  try {
1036
1433
  const parsed = operation.input.strict().safeParse(buildInput(fields, options));
@@ -1042,9 +1439,34 @@ Exit codes: 0 ok, ${Object.entries(EXIT_CODES).sort(([, a], [, b]) => a - b).map
1042
1439
  }))
1043
1440
  });
1044
1441
  }
1442
+ const validatedInput = parsed.data;
1443
+ if (options.dryRun === true) {
1444
+ const built = buildOperationRequest(
1445
+ operation,
1446
+ validatedInput,
1447
+ endpoint(io)
1448
+ );
1449
+ const estimatedMaxCredits = estimateMaxOperationCredits(
1450
+ operation,
1451
+ validatedInput
1452
+ );
1453
+ const note = dryRunNote(operation, validatedInput);
1454
+ succeed({
1455
+ dryRun: true,
1456
+ operation: operation.name,
1457
+ command: operation.command.join(" "),
1458
+ method: built.method,
1459
+ url: built.url.toString(),
1460
+ ...built.body !== void 0 ? { body: built.body } : {},
1461
+ cost: operation.cost,
1462
+ estimatedMaxCredits,
1463
+ ...note ? { note } : {}
1464
+ });
1465
+ return;
1466
+ }
1045
1467
  const data = await callOperation(
1046
1468
  operation,
1047
- parsed.data,
1469
+ validatedInput,
1048
1470
  await connect(io)
1049
1471
  );
1050
1472
  succeed(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creatorriver",
3
- "version": "0.6.2",
3
+ "version": "0.8.0",
4
4
  "description": "Creator River CLI: search 10M+ YouTube, TikTok and Instagram creators, every one with a contact email, and run outreach from your terminal or AI agent",
5
5
  "keywords": [
6
6
  "creator-river",