Agents × jobs · Gemini CLI

Seed a music sound on TikTok with Gemini CLI

Seed a TikTok sound from Gemini CLI: many geo-targeted accounts posting with tiktok_sound_url on the same track, staggered dates, per-video analytics fo…

Sound seeding from Gemini CLI means getting a track used by many accounts in the launch market in the same week. TokPortal turns it into API calls: create_bundles_bulk opens the accounts in the country the label cares about, every slot's tiktok_sound_url points at the official sound page so the manager posts with that sound (volume fields let you balance original vs. added audio), dates are staggered, and list_account_video_analytics reports plays per post. Accounts are human-created and operated, so the wave reads as adoption rather than as one uploader.

Connect TokPortal to Gemini CLI

Gemini CLI is a terminal agent: Google's open-source terminal agent for Gemini; MCP servers via gemini mcp add or ~/.gemini/settings.json, plus extensions.

gemini mcp add --transport http tokportal https://app.tokportal.com/api/ext/mcp

Add --header "Authorization: Bearer sk_..." to skip OAuth. Equivalent ~/.gemini/settings.json:

{
  "mcpServers": {
    "tokportal": {
      "httpUrl": "https://app.tokportal.com/api/ext/mcp",
      "headers": { "Authorization": "Bearer sk_..." }
    }
  }
}

Or install the packaged extension: gemini extensions install https://github.com/tokportal/gemini-cli-extension.

Snippet status: verified against Gemini CLI's documentation (source).

Once connected, sanity-check the setup with a read-only call: "What is my TokPortal credit balance?" should trigger tokportal_get_credit_balance. GET requests and dry-run writes do not spend credits.

Try the workflow without spending

For this trial, use the remote MCP endpoint https://app.tokportal.com/api/ext/mcp, local tokportal-mcp 1.15.1 or later, or the REST API. Upgrade and restart an older local server first. Version 1.15.0 does not forward the dry-run header; do not use its write tools for a simulation. If you cannot verify the installed local version, use the remote endpoint or REST.

Use the sandbox for the first attempt. MCP write tools accept dry_run: true as a top-level argument, beside body; REST writes accept the X-TokPortal-Dry-Run: true header. Keep your usual authentication and scopes. Each simulated write validates the request and returns credits_would_charge with credits_charged: 0. Nothing is created or published.

Simulated IDs start with 00000000-0000-4000-8000-. Use them only in later dry-run writes. GET requests read real data, so skip publish-readiness checks and polling for synthetic IDs. Simulations have no cross-call memory and upload URLs are placeholders: do not upload files to them.

To run for real, review the returned price and confirm before the first live write. Bundle creation charges credits immediately; publishing hands the order to a manager. Repeat creation without dry-run mode and use the new real IDs for configuration and publishing. A synthetic ID cannot be reused in a live request.

How it works

The unit that matters for a sound campaign is uses: distinct accounts posting with the sound. So the agent sizes accounts first — 20 to 50 is a typical first wave — with create_bundles_bulk in the target country (US, GB, BR, MX…), videos_per_account 2–3 so each account posts a couple of times during the week. Advanced Warming on music/dance/genre terms (generate_warming_terms from "bedroom pop fans, indie playlists") gives the accounts a plausible listening history before the drop.

Each video slot needs a clip (dance, lip-sync, POV, transition — the label usually supplies a brief and creatives), a caption and the sound. configure_bundle_video fields: video_url, description (caption with the artist's hashtags), target_publish_date (spread across the week, ≤3/day/bundle), tiktok_sound_url (the tiktok.com/music/... URL), and optionally volume_original_sound / volume_added_sound (0–200; using them costs 1 credit per video) when the clip's own audio must stay audible under the track. Add disclose_as_ads: true if it is a paid placement. Then publish_bundle for each bundle.

For measurement the agent reads list_account_video_analytics per account and export_analytics_videos for the whole wave; sound-level use counts live on TikTok's sound page, so the agent reports its own contribution (posts, views, likes per post) alongside. A second wave on the same accounts is just videos_only bundles with account_id.

Run it from Gemini CLI

Start a Gemini CLI session in the project folder and paste the prompt below. Every tokportal_* call is shown before it runs; approve read-only tools freely and review write tools (create_*, configure_*, publish_*) before accepting.

Tool sequence

  1. tokportal_get_credit_costs — Accounts + slots + 1 credit per video using volume control.
  2. tokportal_generate_warming_terms — Genre/fan-culture terms so accounts look like listeners.
  3. tokportal_create_bundles_bulkplatforms:["tiktok"], country, accounts_count, videos_per_account, warming terms.
  4. tokportal_configure_bundle_account — Fan-style personas, not label handles.
  5. tokportal_configure_bundle_videotiktok_sound_url, volume_original_sound, volume_added_sound, description, date, video_url.
  6. tokportal_publish_bundle — Per bundle.
  7. tokportal_list_account_video_analytics — Views/likes per seeded post.
  8. tokportal_export_analytics_videos — Wave-level CSV for the label.

Prompt to paste

Evaluate this workflow in the TokPortal sandbox only.
Use the remote MCP endpoint https://app.tokportal.com/api/ext/mcp or local tokportal-mcp 1.15.1 or later for write tools.
Verify the installed local version before using its write tools. Version 1.15.0 is unsafe for simulations.
If the local version is older or unknown, use the remote endpoint or authenticated REST
requests with X-TokPortal-Dry-Run: true instead.
For every non-GET MCP tool call, set dry_run: true as a top-level boolean beside body.
For every REST write in a workflow, send the X-TokPortal-Dry-Run: true header.
Use normal read tools for existing real objects. Do not GET or poll synthetic IDs,
and do not upload files to simulated upload URLs. Simulated objects have no cross-call memory.
Show credits_would_charge and verify credits_charged is 0 for each simulated write.
Do not execute any live write. Ask for my explicit GO before the first real write,
including bundle creation, which charges immediately. After GO, repeat creation
without dry_run and use the new real IDs; never reuse synthetic IDs in live requests.

Use the TokPortal MCP tools. Sound: https://www.tiktok.com/music/Track-Name-7300000000000000000. Market: GB.
Plan a 20-account wave, 2 posts each between 2026-09-12 and 2026-09-18, clip audio at 30% under the track.
Quote it with get_credit_costs, create the fleet with create_bundles_bulk (external_ref "uk-single"),
and print the configure_bundle_video payload for bundle 1 / position 1 before running the rest.

Start gemini, check /mcp shows tokportal connected, then paste the prompt.

REST equivalent (write requests below are simulations; GET requests read existing real data)

curl -X POST -H "X-TokPortal-Dry-Run: true" https://app.tokportal.com/api/ext/bundles/bulk \
  -H "X-API-Key: sk_..." -H "Content-Type: application/json" -H "Idempotency-Key: $(uuidgen)" \
  -d '{"platforms":["tiktok"],"country":"GB","accounts_count":30,"videos_per_account":2,
       "wants_advanced_warming":true,"advanced_warming_terms":["indie pop 2026","bedroom pop","new music friday"],
       "external_ref":"single-launch-uk"}'

curl -X PUT -H "X-TokPortal-Dry-Run: true" https://app.tokportal.com/api/ext/bundles/BUNDLE_ID/videos/1 \
  -H "X-API-Key: sk_..." -H "Content-Type: application/json" \
  -d '{"video_type":"video","description":"this bridge though 😭 #newmusic #indiepop","target_publish_date":"2026-09-12",
       "video_url":"https://.../pov-1.mp4",
       "tiktok_sound_url":"https://www.tiktok.com/music/Track-Name-7300000000000000000",
       "volume_original_sound":40,"volume_added_sound":100}'

Key parameters

ParameterValuesNotes
tiktok_sound_urltiktok.com/music/… URLManager posts with this sound.
volume_original_sound / volume_added_sound0–200Balance clip audio vs. track; 1 credit per video when used.
accounts_count1–100Distinct uses of the sound = distinct accounts.
target_publish_dateYYYY-MM-DDSpread across launch week; 3/day/bundle.
disclose_as_adsbooleanPaid placements.
external_ref≤200 charsCampaign tag for list_bundles.

Full schemas: OpenAPI reference · openapi.json.

Example configurations

30-account UK wave

{"platforms":["tiktok"],"country":"GB","accounts_count":30,"videos_per_account":2,"external_ref":"single-launch-uk"}

Slot with sound and mix

{"video_type":"video","description":"walking to this all week #indiepop","target_publish_date":"2026-09-13",
 "video_url":"https://pub-xxx.r2.dev/videos/walk-2.mp4",
 "tiktok_sound_url":"https://www.tiktok.com/music/Track-Name-7300000000000000000",
 "volume_original_sound":0,"volume_added_sound":100}

Second wave on delivered accounts

{"bundle_type":"videos_only","account_id":"ACCOUNT_UUID","videos_quantity":3,"title":"Wave 2"}

Credits

30 accounts × (32 + 2 × 2 + 2 × 1 volume) = 1 140 credits at standard rates for a 30-account, 2-post wave with volume control, plus warming targets at 5 each. Verify with get_credit_costs; see Credits & Pricing.

Why not the official API

The Content Posting API can attach nothing to a sound and cannot create the fan accounts a launch needs; it posts on audited apps to accounts users authorized, privately until audit, with per-token limits (6 requests/minute) and per-user daily caps. A sound launch is many accounts, one track, one week — the opposite shape.

As of August 2026 the first-party routes look like this. TikTok's Content Posting API (Direct Post) requires each account owner to authorize your app with the video.publish scope, limits every user access token to 6 requests per minute, keeps all posts from unaudited apps in private viewing mode until TikTok audits the app, and enforces an unpublished daily post cap per user (spam_risk_too_many_posts) that integrators commonly report at roughly 15–25 posts per account per day. Meta's Instagram Content Publishing API allows 100 API-published posts per professional account in a 24-hour moving window and only for accounts you own and connect via OAuth. Neither creates accounts, warms them, or reports third-party bans. TokPortal is human-operated infrastructure: accounts created and run by managers in the target country, one X-API-Key for all of them, dated slots (max 3 per day per bundle) instead of per-account tokens.

Sources: TikTok Content Posting API – Direct Post, TikTok Content Posting API – Get started, Instagram Platform – Content Publishing.

FAQ

Can the manager use the sound if the track is not on TikTok yet?

No — tiktok_sound_url must resolve to an existing sound page. Have the distributor deliver to TikTok first, then seed.

How do I keep the original clip audio audible?

Set volume_original_sound (e.g. 40) and volume_added_sound (e.g. 100); the manager applies the mix. It costs 1 credit per video.

Does TokPortal report total sound uses?

It reports what its accounts posted (views, likes, comments per video). Total uses are read from the sound page on TikTok; the agent can combine both.

Which countries make sense for music?

Whatever the release strategy says — list_countries shows what is open. Country picks the manager and device, so a BR wave is Brazilian accounts operated in Brazil.

Also works with

All 25 agents for "Seed a music sound on TikTok"

Other jobs with Gemini CLI