# ShortsPilot Live Agent Guide

- **MCP Endpoint:** `https://api.shortspilot.ai/mcp`
- **REST v1 Base URL:** `https://api.shortspilot.ai/v1`
- **Dashboard & API Keys:** https://www.shortspilot.ai/settings/api-keys

## Authentication

1. **OAuth 2.1 (recommended for Claude, ChatGPT, Cursor, Claude Code, Codex):** Connect to `https://api.shortspilot.ai/mcp` and approve access on the ShortsPilot consent screen.
2. **API Key (for CLI, n8n, Make, scripts):** Create a `sp_...` key in Settings → API & MCP and pass `Authorization: Bearer sp_...`.

## Tool & Endpoint Map

| Capability | MCP Tool | REST v1 Endpoint | Credits |
| --- | --- | --- | --- |
| Account plan & credits | `get_account_credits` | `GET https://api.shortspilot.ai/v1/account` | Free |
| Connected social channels | `list_social_channels` | `GET https://api.shortspilot.ai/v1/channels` | Free |
| Available TTS voices | `list_tts_voices` | `GET https://api.shortspilot.ai/v1/voices` | Free |
| List videos | `list_videos` | `GET https://api.shortspilot.ai/v1/videos` | Free |
| Video render status | `get_video_status` | `GET https://api.shortspilot.ai/v1/videos/:videoId` | Free |
| Automated series | `list_series` | `GET https://api.shortspilot.ai/v1/series` | Free |
| Publishing calendar | `list_calendar` | `GET https://api.shortspilot.ai/v1/calendar` | Free |
| Create & render AI video | `create_ai_video` | `POST https://api.shortspilot.ai/v1/videos` | Uses render credits |
| Create & render Reddit story video | `create_reddit_story_video` | `POST https://api.shortspilot.ai/v1/videos/reddit-stories` | Uses render credits |
| Create & render Fake Chat video | `create_fake_chat_video` | `POST https://api.shortspilot.ai/v1/videos/fake-chats` | Uses render credits |
| Create Custom AI Video draft | `create_custom_ai_video` | `POST https://api.shortspilot.ai/v1/videos/custom-ai-video` | Requires paid plan + credits |
| Prepare TikTok post approval | `prepare_tiktok_post` | `POST https://api.shortspilot.ai/v1/posts` | Free (returns 1-click creator approval URL) |
| Publish or schedule YouTube Shorts | `publish_or_schedule_youtube_post` | `POST https://api.shortspilot.ai/v1/posts/youtube` | Free |
| List viral slideshow formats | `list_slideshow_formats` | `GET https://api.shortspilot.ai/v1/slideshow-formats` | Free |
| Save custom slideshow format | `create_slideshow_format` | `POST https://api.shortspilot.ai/v1/slideshow-formats` | Free |
| Lookup Apple App Store screenshots | `lookup_app_store` | `GET https://api.shortspilot.ai/v1/media/app-store` | Free |
| Inspect viral TikTok / IG post | `inspect_social_post` | `POST https://api.shortspilot.ai/v1/research/inspect-post` | Free |
| Search Pinterest photos | `search_pinterest` | `GET https://api.shortspilot.ai/v1/media/pinterest` | Free |
| List slideshows | `list_slideshows` | `GET https://api.shortspilot.ai/v1/slideshows` | Free |
| Get slideshow & JPEG URLs | `get_slideshow` | `GET https://api.shortspilot.ai/v1/slideshows/:slideshowId` | Free |
| Create & render viral slideshow | `create_slideshow` | `POST https://api.shortspilot.ai/v1/slideshows` | 50 credits (auto-refunded on render failure) |
| Edit & diff re-render slideshow | `edit_slideshow` | `POST https://api.shortspilot.ai/v1/slideshows/:slideshowId` | Free (0 credits) |
| AI redraw a single slide image | `redraw_slide_image` | `POST https://api.shortspilot.ai/v1/slideshows/:slideshowId/redraw` | 20 credits (auto-refunded on failure) |
| Send slideshow to TikTok Drafts | `send_slideshow_to_tiktok_drafts` | `POST https://api.shortspilot.ai/v1/slideshows/:slideshowId/tiktok-draft` | Free (private Drafts inbox via `MEDIA_UPLOAD` or optional `DIRECT_POST`) |
| Publish slideshow directly to TikTok | `publish_slideshow_to_tiktok` | `POST https://api.shortspilot.ai/v1/slideshows/:slideshowId/tiktok-publish` | Free (`DIRECT_POST` validated against TikTok `creator_info`) |
| Publish slideshow to Instagram Carousel | `send_slideshow_to_instagram_carousel` | `POST https://api.shortspilot.ai/v1/slideshows/:slideshowId/instagram-carousel` | Free (2-10 slide Meta Graph API carousel) |
| List outbound slideshow webhooks | `list_slideshow_webhooks` | `GET https://api.shortspilot.ai/v1/slideshow-webhooks` | Free |
| Save outbound slideshow webhook | `save_slideshow_webhook` | `POST https://api.shortspilot.ai/v1/slideshow-webhooks` | Free (HMAC-SHA256 signed `slideshow.ready` / `slideshow.published`) |
| Delete outbound slideshow webhook | `delete_slideshow_webhook` | `DELETE https://api.shortspilot.ai/v1/slideshow-webhooks/:webhookId` | Free |
| List consistent AI personas | `list_slideshow_personas` | `GET https://api.shortspilot.ai/v1/slideshow-personas` | Free |
| Create consistent AI persona | `create_slideshow_persona` | `POST https://api.shortspilot.ai/v1/slideshow-personas` | Free (text/URL) or 20 credits (`generateReferencePortrait: true`) |
| List reusable image collections | `list_image_collections` | `GET https://api.shortspilot.ai/v1/image-collections` | Free |
| Save reusable image collection | `save_image_collection` | `POST https://api.shortspilot.ai/v1/image-collections` | Free |

## Idempotency & Creator Approval

- Pass `idempotencyKey` in the tool/JSON payload (or an `Idempotency-Key` HTTP header on REST `POST` endpoints) so network retries safely return the original result without double-charging credits.
- `prepare_tiktok_post` never uploads video directly without creator consent — it creates a 24-hour approval link (`approvalUrl`) where the signed-in creator reviews the rendered video and TikTok privacy/interaction settings before confirming.
- `send_slideshow_to_tiktok_drafts` delivers rendered JPEG slides privately into the creator's TikTok Drafts inbox (`MEDIA_UPLOAD`) so the creator can add trending audio and tap Post on their phone.
- `publish_or_schedule_youtube_post` queues immediate YouTube Shorts uploads or schedules them for a future ISO-8601 UTC timestamp via `publishScheduledAt`.

## Error Handling

All errors return a structured self-healing envelope:

```json
{
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "...",
    "fix": "Check remaining credits with get_account_credits or upgrade the ShortsPilot plan.",
    "retryable": false
  }
}
```

Always follow `fix` and avoid retrying non-retryable (`retryable: false`) errors.
