Source: https://developers.tokportal.com/use-cases/ai-agents/openclaw-tiktok-posting/
Markdown: https://developers.tokportal.com/use-cases/ai-agents/openclaw-tiktok-posting.md

# TokPortal + OpenClaw

TokPortal has an OpenClaw integration path through ClawHub. The important technical detail is that the skill exposes the same public TokPortal API surface as the [MCP server](https://developers.tokportal.com/mcp): bundles, account configuration, videos, webhooks, uploads, accounts, and analytics.

## Install

```bash
clawhub install tokportal
```

Skill page: [clawhub.ai/naybu256/tokportal](https://clawhub.ai/naybu256/tokportal)

## Configure

Set a TokPortal API key from the [Developer Portal](https://app.tokportal.com/developer/api-keys).

Depending on your OpenClaw setup, configure the key either in the skill config or as an environment variable:

```bash
TOKPORTAL_API_KEY=sk_your_key_here
```

## What the agent can do

The agent can only do what the public API supports. It can call generated tools such as:

| Tool                                      | API surface                           |
| ----------------------------------------- | ------------------------------------- |
| `tokportal_get_credit_balance`            | `GET /credits/balance`                |
| `tokportal_create_bundle`                 | `POST /bundles`                       |
| `tokportal_create_bundles_bulk`           | `POST /bundles/bulk`                  |
| `tokportal_configure_bundle_account`      | `PUT /bundles/{id}/account`           |
| `tokportal_configure_bundle_video`        | `PUT /bundles/{id}/videos/{position}` |
| `tokportal_batch_configure_bundle_videos` | `PUT /bundles/{id}/videos/batch`      |
| `tokportal_publish_bundle`                | `POST /bundles/{id}/publish`          |
| `tokportal_get_account_analytics`         | `GET /accounts/{id}/analytics`        |

See the [full MCP tool list](https://developers.tokportal.com/mcp#what-you-can-do).

## Safe prompt pattern

Ask the agent to plan, show the API payload, then wait for confirmation before calling mutating tools:

> "Create a draft plan for a US TikTok bundle with 5 videos and Advanced Niche Warming on 6 targets. Show the exact `tokportal_create_bundle` payload and estimated credit cost. Do not execute until I confirm."

Then approve once the payload matches the API docs:

```json
{
  "bundle_type": "account_and_videos",
  "platform": "tiktok",
  "country": "US",
  "videos_quantity": 5,
  "wants_advanced_warming": true,
  "advanced_warming_terms": [
    "gym motivation",
    "home workout",
    "protein recipes",
    "beginner lifting",
    "hiit routine",
    "fitness transformation"
  ],
  "external_ref": "openclaw-fitness-us"
}
```

`wants_advanced_warming: true` is mandatory whenever the payload carries `advanced_warming_terms` or `advanced_warming_terms_count`; TokPortal never infers it and rejects the call with `ADVANCED_WARMING_FLAG_REQUIRED`. Targets are 3-30, in multiples of 3, each 2-50 characters. At the standard rate of 5 credits per target, the 6 targets above add 30 credits on top of the 32 for the account and 2 per video slot, so this bundle is 32 + (5 x 2) + 30 = 72 credits. Have the agent confirm the figure with `tokportal_get_credit_costs` instead of quoting it from memory.

## Realistic workflow

1. Check credits with `tokportal_get_credit_balance`.
2. Create a bundle with `tokportal_create_bundle`.
3. Configure account profile fields with `tokportal_configure_bundle_account`.
4. Configure videos from public URLs or uploaded media with `tokportal_configure_bundle_video`.
5. Publish with `tokportal_publish_bundle`.
6. Monitor bundle status, webhook events, or analytics.

The agent should not promise organic reach, view counts, or platform enforcement outcomes. TokPortal exposes operational workflow tools; performance still depends on content, platform behavior, timing, and account state.

Related docs: [OpenClaw Integration](https://developers.tokportal.com/openclaw), [MCP Server](https://developers.tokportal.com/mcp), [Create Bundle](https://developers.tokportal.com/create-bundle), [Configure Videos](https://developers.tokportal.com/configure-videos), [Analytics](https://developers.tokportal.com/analytics).
