# API & AI agents: drive Pamba programmatically

> Workspace-scoped API keys, the public customer API, and connecting Claude and other agents over MCP.

Everything the Pamba UI does, an agent can do through the API. The full public API reference lives at [pamba.app/api](/api): endpoint auth, request and response structures, credit usage, and examples.

## Authentication

- **Base URL:** `https://api.pamba.app`
- **Agent auth:** `X-API-Key` header. Open account settings and select **Workspace Settings**, then find **API Keys** directly below **Company name**. You can also open workspace settings from the workspace switcher.
- JWT callers must include `X-Workspace-Id` on workspace-scoped routes; API-key callers don't, since the key already carries the workspace.
- **New workspaces from a key:** `POST /workspaces` with `setup: "complete"` creates a workspace and runs its setup in the same call (the website read into a company brief, the media library, niche feed and starter avatars), and `POST /api-keys` with that `workspace_id` gives a key that works there. A key makes keys only for its own workspace and the workspaces it created; a replacement key does not inherit that, so keep a key made inside each new workspace, or make one later in its settings.
- **A key acts as you.** Besides its own workspace, it can manage your keys everywhere and the settings, members and invitations of every workspace you administer, and delete those workspaces (never your default one), as you can in the app.
- **If a key leaks:** revoke it under **API Keys** in that workspace's settings, or with `DELETE /api-keys/{keyId}`. Revoking it removes nothing it made, so check three things next.
- **After a leak, keys:** list every key you own with `GET /api-keys` (the settings list shows only the open workspace's keys) and revoke each one made since the leak, going by its `created_at` rather than its name, which its maker chose.
- **After a leak, members:** in every workspace you administer, check **Members** and its pending invitations, and remove anyone you didn't add: an invitation link admits whoever accepts it. Revoke share links in the key's workspace that you didn't make.
- **After a leak, workspaces:** delete any workspace you own and don't recognize (**Delete workspace** in its settings), and ask the admins of one you don't own to remove you.

## Connect Claude, Codex or another agent

Claude Code, Codex, Cursor and other MCP clients connect to the [MCP server](/help/mcp-server) at `https://api.pamba.app/mcp` with the same `X-API-Key` header. They get every tool the in-app assistant has, and the connection hands the model Pamba's product knowledge, so there is no guide file to download or keep up to date. The [MCP tool reference](/help/mcp-tool-reference) lists every tool.

An agent that calls the REST API directly works from [pamba.app/api](/api), which lists every customer route.

## What your agent can do

Track TikTok accounts and mine analyzed videos; add ideas and scripts in bulk; create project batches as drafts or fully generated videos; generate clips and select takes; check when an account's phone is free (`GET /devices/accounts/schedule`) and schedule, reschedule, cancel, and retry posts; configure warming; create avatars from reference images; manage starting-frame libraries; and pull analytics dashboards and account metrics.

## Credits

Generation spends credits (clip generation per model-second, avatar photos and scenes at 15 credits per image, hook purchases at 200; voices are free). Failed operations are never charged, and insufficient-credit requests return `402 Payment Required` with `remaining_credits` and `required_credits`. The live price list is public at `GET /usage/pricing`; use `GET /user` for subscription state and credit totals.

## What changed

Every public change to the REST API and the MCP tools is listed at [/changelog/api](/changelog/api), dated the day it ships, with the routes, tools and fields it touched (bug fixes are not listed). A breaking change is marked and says what to change on your side. Follow it with the Atom feed at `/changelog/api/feed.xml`, read it as JSON from `GET https://api.pamba.app/changelog?audience=api` (no key needed), or ask the agent ("what changed in the API this month?").

## This help center is agent-readable too

Every article here is available as raw markdown: see [/llms.txt](/llms.txt) for the index and [/llms-full.txt](/llms-full.txt) for the whole term list in one document.

---
HTML version: https://pamba.app/help/api-and-agents · All docs: https://pamba.app/llms.txt
