# Create TikTok accounts with Gemini CLI

Source: https://developers.tokportal.com/agents/gemini-cli/create-tiktok-accounts/
Markdown: https://developers.tokportal.com/agents/gemini-cli/create-tiktok-accounts.md

To create TikTok accounts from Gemini CLI, connect the TokPortal MCP server and ask for a bundle: `create_bundle` opens a work order for a new account in a given country, `configure_bundle_account` sets the handle and profile, `publish_bundle` hands it to a human account manager in that country, and `list_accounts` returns the delivered account a few days later. There is no official TikTok endpoint that creates accounts at all — the Login Kit / Content Posting API only let a user who already owns an account authorize your app — so this job is only possible with human-operated infrastructure like TokPortal.

## 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.

```bash
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`:

```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](https://geminicli.com/docs/tools/mcp-server/)).

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](https://developers.tokportal.com/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

A TokPortal **bundle** is the unit of work. For a new account you create it with `bundle_type: "account_only"` (just the account) or `"account_and_videos"` (account plus a schedule of `videos_quantity` posts). The `country` field decides which pool of managers gets the order: a `US` bundle is created and warmed by a manager physically in the United States, on a US SIM and residential connection, so the account is native to that region from day one. Call `list_countries` first — it returns the countries currently open for new-account creation and, separately, the ones open for `videos_only` orders on existing accounts.

Once the bundle exists you configure the account: `username` (1–24 chars, letters/digits/`_`/`.`, no trailing dot), `visible_name` (≤30), `biography` (≤80 on TikTok), an optional `profile_picture_url` and `link_in_bio`. Then `publish_bundle`. The account setup and selected slots are charged when the bundle is created. Simulate creation with `dry_run: true` first to see the exact `credits_would_charge` without spending. The manager creates the account, warms it and finalizes it; the account then appears in `list_accounts` with `status`, `country`, `profile_url` and a `ban_appeal` block that stays `null` while the account is healthy. Credentials are never returned by ordinary tools — the account is *managed*, which is exactly what keeps it alive; `reveal_account_credentials` exists but detaches the account from management and needs a two-step confirmation.

Add `wants_advanced_warming: true` and 3–30 `advanced_warming_terms` (multiples of 3) if you want the manager to warm the account on niche searches with a recorded, verified session per term before you post — see [Warm accounts](https://developers.tokportal.com/agents/for/warm-accounts).

## 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_list_countries` — Confirm the target country is open for new-account creation (returns `data[]` for new accounts and `videos_only_countries[]`).
2. `tokportal_get_credit_costs` — Read the live account-setup price and any contract allowance before quoting the user.
3. `tokportal_create_bundle` — `bundle_type: account_only` (or `account_and_videos` with `videos_quantity`), `platform: tiktok`, `country: US`; optional `external_ref` for de-duplication.
4. `tokportal_configure_bundle_account` — Set `username`, `visible_name`, `biography`, `profile_picture_url`, `link_in_bio` (PUT, can be called again before publishing).
5. `tokportal_get_bundle_publish_readiness` — Returns what is still missing (account fields, credits) so the agent fixes it instead of hitting a 400.
6. `tokportal_publish_bundle` — Sends the order to a manager in the chosen country. Bundle creation already charged the credits.
7. `tokportal_get_bundle` — Poll `account_status` (configured → published → in\_review → finalized) or subscribe to `account.finalized` with `create_webhook_endpoint`.
8. `tokportal_list_accounts` — Filter `platform=tiktok&country=US` to retrieve the delivered account and its `profile_url`.

**Prompt to paste**

```text
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. Call list_countries and get_credit_costs first.
Then create a TikTok bundle in the US (bundle_type account_only, title "US launch #1"),
configure the account as @acme_kitchen / "Acme Kitchen" / bio "Recipes in 30s",
simulate publish_bundle and show me the returned validation and credits_would_charge.
```

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

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

```bash
# 1. Create the work order
curl -X POST -H "X-TokPortal-Dry-Run: true" https://app.tokportal.com/api/ext/bundles \
  -H "X-API-Key: sk_..." -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"bundle_type":"account_only","platform":"tiktok","country":"US","title":"US launch #1"}'

# 2. Simulate the profile (BUNDLE_ID from step 1: data.bundle_id)
curl -X PUT -H "X-TokPortal-Dry-Run: true" https://app.tokportal.com/api/ext/bundles/BUNDLE_ID/account \
  -H "X-API-Key: sk_..." -H "Content-Type: application/json" \
  -d '{"username":"acme_kitchen","visible_name":"Acme Kitchen","biography":"Recipes in 30s","link_in_bio":"https://acme.example"}'

# 3. Simulate publishing; the GET below lists only existing real accounts
curl -X POST -H "X-TokPortal-Dry-Run: true" https://app.tokportal.com/api/ext/bundles/BUNDLE_ID/publish -H "X-API-Key: sk_..."
curl "https://app.tokportal.com/api/ext/accounts?platform=tiktok&country=US" -H "X-API-Key: sk_..."
```

## Key parameters

| Parameter                                         | Values                                              | Notes                                                                                     |
| ------------------------------------------------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `bundle_type`                                     | account\_only · account\_and\_videos · videos\_only | account\_only for a bare account; account\_and\_videos to ship posts with it.             |
| `platform`                                        | tiktok · instagram (default tiktok)                 | One platform per bundle; use create\_bundles\_bulk for several.                           |
| `country`                                         | ISO code, e.g. US, GB, FR, DE, BR                   | Required unless videos\_only. Check list\_countries — availability changes.               |
| `username`                                        | 1–24 chars, \[a-zA-Z0-9\_.]                         | Cannot end with a dot; the manager reports if it is taken (account.pending\_corrections). |
| `biography`                                       | ≤80 chars on TikTok                                 | 120 on Instagram.                                                                         |
| `wants_advanced_warming / advanced_warming_terms` | boolean · 3–30 terms (multiple of 3)                | 5 credits per term, min 15; TikTok and Instagram only.                                    |
| `external_ref`                                    | ≤200 chars                                          | Duplicate-detection aid (DUPLICATE\_ACCOUNT\_BUNDLE); not an idempotency key.             |

Full schemas: [OpenAPI reference](https://developers.tokportal.com/api-reference) · [openapi.json](https://developers.tokportal.com/openapi.json).

## Example configurations

**Bare US account**

```json
{"bundle_type":"account_only","platform":"tiktok","country":"US","title":"US #1"}
```

**UK account with 12 posts and warming**

```json
{"bundle_type":"account_and_videos","platform":"tiktok","country":"GB","videos_quantity":12,
 "wants_advanced_warming":true,
 "advanced_warming_terms":["air fryer recipes","meal prep uk","budget dinners"]}
```

**Ten accounts at once (bulk)**

```json
{"platforms":["tiktok"],"country":"US","accounts_count":10,"videos_per_account":0,"external_ref":"batch-2026-08"}
```

## Credits

Standard account setup is 32 credits per TikTok account, plus 2 credits per video slot and 5 credits per Advanced Warming target (minimum 3 targets). Credits are charged on real bundle creation. A dry run charges 0 and returns `credits_would_charge`. Always read `get_credit_costs` — contract allowances override the standard rate. Details on [Credits & Pricing](https://developers.tokportal.com/credits).

## Why not the official API

There is no account-creation endpoint in the TikTok for Developers API: Login Kit authorizes an *existing* user, and the Content Posting API posts on that user's behalf after they approve the `video.publish` scope. Creating accounts programmatically is therefore not a rate-limit question but an impossibility with first-party tools; TokPortal replaces it with human managers who create the account in the target country and keep it operated.

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](https://developers.tiktok.com/doc/content-posting-api-reference-direct-post), [TikTok Content Posting API – Get started](https://developers.tiktok.com/doc/content-posting-api-get-started), [Instagram Platform – Content Publishing](https://developers.facebook.com/docs/instagram-platform/content-publishing).

## FAQ

### How long does delivery take?

Typically 24–72 hours from `publish_bundle` to `account.finalized`, depending on the country's manager pool and whether warming was ordered. Poll `get_bundle` or subscribe to `account.finalized`.

### Can I pick the exact username?

You request it in `configure_bundle_account`. If it is unavailable the manager flags it (`account.pending_corrections`) and you send a new one with the same tool; the agent can propose variants automatically.

### Do I get the password?

Not by default: the account stays managed so TokPortal can post, warm and defend it. `reveal_account_credentials` is available with a 428 policy preview and explicit acknowledgment; it detaches the account from management.

### Is there a limit on how many accounts I can create?

`create_bundles_bulk` accepts up to 100 accounts per call and you can call it repeatedly; the practical limit is manager capacity in the chosen country, which the API reports through delivery times rather than a hard cap.

## Related

- [Bulk TikTok account creation](https://developers.tokportal.com/use-cases/platform-guides/bulk-tiktok-accounts-api)
- [Create Bundle](https://developers.tokportal.com/create-bundle)
- [Account configuration](https://developers.tokportal.com/account-configuration)
- [MCP server](https://developers.tokportal.com/mcp)
- [Getting started](https://developers.tokportal.com/getting-started)

## Also works with

- [Create TikTok accounts with Goose](https://developers.tokportal.com/agents/goose/create-tiktok-accounts)
- [Create TikTok accounts with Perplexity](https://developers.tokportal.com/agents/perplexity/create-tiktok-accounts)
- [Create TikTok accounts with Microsoft Copilot Studio](https://developers.tokportal.com/agents/copilot-studio/create-tiktok-accounts)
- [Create TikTok accounts with Factory Droid](https://developers.tokportal.com/agents/factory-droid/create-tiktok-accounts)
- [Create TikTok accounts with n8n](https://developers.tokportal.com/agents/n8n/create-tiktok-accounts)
- [Create TikTok accounts with Make](https://developers.tokportal.com/agents/make/create-tiktok-accounts)

[All 25 agents for "Create TikTok accounts"](https://developers.tokportal.com/agents/for/create-tiktok-accounts)

## Other jobs with Gemini CLI

- [Post 100 TikTok videos a day with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/post-100-videos-a-day)
- [Run US TikTok accounts from abroad with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/us-tiktok-accounts-from-abroad)
- [Warm TikTok & Instagram accounts with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/warm-accounts)
- [Run a faceless TikTok channel with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/faceless-channel)
- [Seed UGC across many accounts with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/ugc-seeding)
- [Seed a music sound on TikTok with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/music-sound-seeding)
- [Launch an app with persona accounts with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/app-persona-launch)
- [Run multi-client agency operations with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/agency-multi-client)
- [Get ban alerts via webhooks with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/ban-webhooks)
- [Pull analytics across all accounts with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/analytics-multi-account)
- [Create Instagram accounts with Gemini CLI](https://developers.tokportal.com/agents/gemini-cli/create-instagram-accounts)
