API
Complete API v1 documentation for authentication, publishing, scheduling, accounts, templates, and CLI
Overview
The xAIcreator API v1 provides a RESTful interface for multi-platform authentication, content publishing, scheduling, and account management. All endpoints use API Key authentication for secure access.
Base URL: https://xaicreator.com/api/v1
Authentication
All API requests require an API Key passed via the xai-key header:
curl "https://xaicreator.com/api/v1/twitter/drafts" \
-H "xai-key: your_api_key_here"
Getting Your API Key
1. Email Login
POST /api/v1/auth/login
Email login for existing users only. Does not support new user registration.
curl -X POST "https://xaicreator.com/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "yourpassword"
}'
Response (Success):
{
"success": true,
"user": {
"uuid": "user-uuid",
"email": "[email protected]"
},
"apiKey": {
"key": "sk-xxxxx...",
"name": "Default API Key",
"createdAt": "2026-01-15T10:00:00Z",
"lastUsed": null
},
"warning": "Please save your API key securely. This is the only time the full key will be displayed."
}
2. Google OAuth
Step 1: Get OAuth URL
POST /api/v1/auth/oauth/google/url
curl -X POST "https://xaicreator.com/api/v1/auth/oauth/google/url" \
-H "Content-Type: application/json" \
-d '{"redirectUri": "http://localhost:3000/oauth-callback"}'
Response:
{
"success": true,
"authUrl": "https://accounts.google.com/o/oauth2/v2/auth?client_id=...",
"state": "server-generated-state"
}
Step 2: OAuth Callback
POST /api/v1/auth/oauth/google/callback
curl -X POST "https://xaicreator.com/api/v1/auth/oauth/google/callback" \
-H "Content-Type: application/json" \
-d '{
"code": "authorization-code-from-google",
"state": "state-from-step-1"
}'
Response (New User):
{
"success": true,
"user": {
"uuid": "new-user-uuid",
"email": "[email protected]",
"provider": "google",
"isNewUser": true
},
"apiKey": {
"key": "sk-new-user-key...",
"name": "Default API Key",
"createdAt": "2026-01-15T10:00:00Z",
"lastUsed": null
}
}
3. Twitter OAuth
Step 1: Get OAuth URL
POST /api/v1/auth/oauth/twitter/url
curl -X POST "https://xaicreator.com/api/v1/auth/oauth/twitter/url" \
-H "Content-Type: application/json" \
-d '{"redirectUri": "http://localhost:3000/oauth-callback?provider=twitter"}'
Response:
{
"success": true,
"authUrl": "https://x.com/i/oauth2/authorize?client_id=...",
"state": "base64url-encoded-state"
}
Step 2: OAuth Callback
POST /api/v1/auth/oauth/twitter/callback
curl -X POST "https://xaicreator.com/api/v1/auth/oauth/twitter/callback" \
-H "Content-Type: application/json" \
-d '{
"code": "authorization-code-from-twitter",
"state": "state-from-step-1"
}'
Important: The complete API Key is only displayed once during registration/login. Save it immediately.
API Key Management
Get API Keys
GET /api/v1/auth/api-keys
curl "https://xaicreator.com/api/v1/auth/api-keys" \
-H "xai-key: sk-your-api-key"
Response:
{
"success": true,
"apiKeys": [
{
"id": "key-uuid-1",
"key": "sk-xxxx...abcd",
"name": "Default API Key",
"status": "created",
"lastUsed": "2026-01-15T10:00:00Z",
"createdAt": "2026-01-14T08:00:00Z"
}
]
}
Create API Key
POST /api/v1/auth/api-keys
curl -X POST "https://xaicreator.com/api/v1/auth/api-keys" \
-H "Content-Type: application/json" \
-H "xai-key: sk-your-api-key" \
-d '{"name": "New API Key"}'
Delete API Key
DELETE /api/v1/auth/api-keys/:keyId
curl -X DELETE "https://xaicreator.com/api/v1/auth/api-keys/key-uuid-3" \
-H "xai-key: sk-your-api-key"
Twitter OAuth 2.0
Initiate Twitter OAuth
POST /api/v1/twitter/auth
curl -X POST "https://xaicreator.com/api/v1/twitter/auth" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"socialSetId": "your-social-set-id",
"mode": "add_to_existing"
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
socialSetId | string | No | Social Set ID to bind the account |
mode | string | No | "create_new" or "add_to_existing" (default) |
followOnX | boolean | No | Whether to follow on X after authorization |
Response:
{
"authUrl": "https://x.com/i/oauth2/authorize?...",
"sessionId": "session_uuid_here"
}
Twitter OAuth Callback
GET /api/v1/twitter/callback
After user authorization, Twitter redirects to your callback URL with code and state parameters.
curl "https://xaicreator.com/api/v1/twitter/callback?code=xxx&state=xxx"
Response:
{
"success": true,
"accountUuid": "account_uuid",
"socialSetId": "social_set_id"
}
Drafts Management
List Drafts
GET /api/v1/twitter/drafts
curl "https://xaicreator.com/api/v1/twitter/drafts?socialSetId=xxx" \
-H "xai-key: your_api_key"
Response:
{
"drafts": [
{
"id": "draft_uuid",
"title": "My Draft",
"status": "draft",
"tweets": [...],
"createdAt": "2026-01-14T07:21:26.000Z"
}
]
}
Create Draft
POST /api/v1/twitter/drafts
curl -X POST "https://xaicreator.com/api/v1/twitter/drafts" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"title": "My Draft",
"tweets": [{"content": "<p>Hello from API!</p>"}],
"socialSetId": "social-set-id",
"scheduledFor": "2026-01-15T10:00:00Z"
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Draft title |
tweets | array | Yes | Array of tweet objects with content field (HTML supported) |
socialSetId | string | No | Associated Social Set ID. If omitted, uses the user's default Social Set. Returns NO_SOCIAL_SET error if the user has no Social Set. |
status | string | No | Draft status (default: "draft") |
scheduledFor | string | No | ISO 8601 datetime for scheduled publishing |
selectedAccountIds | array | No | Account IDs to publish to |
templateId | string | No | Template ID if created from template |
Note: A Social Set is required to create drafts. If the user has not connected any social accounts, the API will return a
400error withNO_SOCIAL_SETcode. Please connect a social account via the web dashboard first.
Response:
{
"draft": {
"id": "draft_uuid",
"title": "My Draft",
"status": "draft",
"scheduledFor": null,
"socialSetId": "social-set-id",
"selectedAccountIds": [],
"tweets": [
{
"id": "tweet_uuid",
"content": "<p>Hello from API!</p>",
"plainText": "Hello from API!",
"media": [],
"characterCount": 16,
"isValid": true,
"position": 0
}
],
"createdAt": "2026-01-14T07:21:26.000Z",
"updatedAt": "2026-01-14T07:21:26.000Z"
}
}
Draft Batch Creation
Batch Create Drafts
POST /api/v1/twitter/drafts/batch
Create multiple drafts in a single request.
curl -X POST "https://xaicreator.com/api/v1/twitter/drafts/batch" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"drafts": [
{
"title": "Draft 1",
"tweets": [{"content": "<p>First draft</p>"}]
},
{
"title": "Draft 2",
"tweets": [{"content": "<p>Second draft</p>"}]
}
],
"socialSetId": "social-set-id"
}'
Draft Platform Content
Get Platform Content
GET /api/v1/twitter/drafts/:id/platforms
Get platform-specific content for a draft. When publishing to multiple platforms, each platform can have customized content.
curl "https://xaicreator.com/api/v1/twitter/drafts/draft-uuid/platforms" \
-H "xai-key: your_api_key"
Response:
{
"platforms": [
{
"id": 1,
"draft_uuid": "draft-uuid",
"platform": "bluesky",
"content": "Custom Bluesky content",
"created_at": "2026-01-15T10:00:00.000Z",
"updated_at": "2026-01-15T10:00:00.000Z"
}
]
}
Update Platform Content
PUT /api/v1/twitter/drafts/:id/platforms
Set platform-specific content for a draft. Uses upsert logic (creates or updates).
curl -X PUT "https://xaicreator.com/api/v1/twitter/drafts/draft-uuid/platforms" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"platforms": [
{
"platform": "bluesky",
"content": "Custom Bluesky content"
},
{
"platform": "linkedin",
"content": "Custom LinkedIn content"
}
]
}'
Publishing
Publish to Twitter
POST /api/v1/twitter/publish
curl -X POST "https://xaicreator.com/api/v1/twitter/publish" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"draftId": "draft_uuid",
"accountIds": ["account_id"]
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
draftId | string | Yes | Draft ID to publish |
accountIds | array | No | Specific account IDs |
jobId | string | No | Custom job ID for tracking |
community | object | No | Community metadata ({id, name, description}) |
Quote Tweet
POST /api/v1/twitter/quote
curl -X POST "https://xaicreator.com/api/v1/twitter/quote" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"content": "Great insight!",
"quoteTweetId": "quoted_tweet_id",
"accountId": "your_account_id"
}'
Response:
{
"success": true,
"message": "Quote posted successfully",
"tweetId": "new_tweet_id",
"url": "https://x.com/user/status/new_tweet_id"
}
Publish Progress
GET /api/v1/twitter/publish/progress
Check the publishing progress for a draft.
curl "https://xaicreator.com/api/v1/twitter/publish/progress?draftId=draft-uuid" \
-H "xai-key: your_api_key"
Response:
{
"entries": [
{
"id": "queue-uuid",
"draftId": "draft-uuid",
"status": "published",
"platform": "twitter",
"accountUuid": "account-uuid",
"scheduledFor": "2026-01-15T10:00:00.000Z",
"publishedAt": "2026-01-15T10:00:05.000Z"
}
],
"summary": {
"total": 2,
"completed": 2,
"failed": 0,
"pending": 0
}
}
Multi-Platform Publishing
POST /api/v1/publish/multi-platform
Publish to multiple platforms (Twitter, Bluesky, Mastodon, Threads, LinkedIn) simultaneously.
curl -X POST "https://xaicreator.com/api/v1/publish/multi-platform" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"draftId": "draft_uuid",
"targetAccounts": [
{
"accountId": "twitter_account_id",
"platform": "twitter",
"communityId": "community_id"
},
{
"accountId": "bluesky_account_id",
"platform": "bluesky"
},
{
"accountId": "mastodon_account_id",
"platform": "mastodon"
},
{
"accountId": "threads_account_id",
"platform": "threads"
},
{
"accountId": "linkedin_account_id",
"platform": "linkedin"
}
]
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
draftId | string | Yes | Draft UUID |
targetAccounts | array | Yes | Target account list |
targetAccounts[].accountId | string | Yes | Account UUID |
targetAccounts[].platform | string | Yes | Platform: twitter, bluesky, mastodon, threads, linkedin |
targetAccounts[].communityId | string | No | Community ID (Twitter only) |
Response:
{
"success": true,
"results": [
{
"accountId": "account_uuid",
"platform": "twitter",
"success": true,
"data": { "tweetId": "...", "url": "..." }
},
{
"accountId": "account_uuid",
"platform": "bluesky",
"success": true,
"data": { "uri": "at://...", "cid": "..." }
}
],
"summary": {
"total": 2,
"succeeded": 2,
"failed": 0
}
}
Cost: 10 credits per platform
Platform-Specific Publishing
Bluesky
POST /api/v1/bluesky/publish
curl -X POST "https://xaicreator.com/api/v1/bluesky/publish" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"accountUuid": "account_uuid",
"type": "single",
"text": "Hello Bluesky!",
"langs": ["en"]
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
accountUuid | string | Yes | Account UUID |
type | string | Yes | single or thread |
text | string | No* | Post content (required for single) |
texts | array | No* | Thread posts (required for thread) |
imageUrls | array | No | Image URLs |
langs | array | No | Language tags (default: ["en"]) |
Cost: 10 credits
Mastodon
POST /api/v1/mastodon/publish
curl -X POST "https://xaicreator.com/api/v1/mastodon/publish" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"accountUuid": "account_uuid",
"type": "single",
"text": "Hello Mastodon!"
}'
Parameters: Same as Bluesky
Cost: 10 credits
Threads
POST /api/v1/threads/publish
curl -X POST "https://xaicreator.com/api/v1/threads/publish" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"accountId": "account_uuid",
"text": "Hello Threads!",
"mediaUrls": ["https://example.com/image.jpg"]
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | Account UUID |
draftId | string | No* | Draft UUID (use draft or text/mediaUrls) |
text | string | No* | Post text (max 500 characters) |
mediaUrls | array | No | Media URL array |
replyControl | string | No | everyone, accounts_you_follow, mentioned_only |
Cost: 10 credits
POST /api/v1/linkedin/publish
curl -X POST "https://xaicreator.com/api/v1/linkedin/publish" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"accountId": "account_uuid",
"text": "Hello LinkedIn!",
"mediaUrls": ["https://example.com/image.jpg"],
"visibility": "PUBLIC"
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | Account UUID |
draftId | string | No* | Draft UUID (use draft or text) |
text | string | No* | Post text (max 3000 characters) |
mediaUrls | array | No | Media URL array |
visibility | string | No | PUBLIC, CONNECTIONS, LOGGED_IN (default: PUBLIC) |
Cost: 10 credits
Scheduled Publishing
Schedule Draft
POST /api/v1/twitter/schedule
curl -X POST "https://xaicreator.com/api/v1/twitter/schedule" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"draftId": "draft_uuid",
"scheduledFor": "2026-01-15T10:00:00Z",
"targetAccounts": [
{
"accountId": "account_id",
"platform": "twitter"
}
],
"priority": 0,
"applyJitter": true
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
draftId | string | Yes | Draft UUID |
scheduledFor | string | Yes | ISO 8601 datetime (UTC) |
targetAccounts | array | No | Target accounts (multi-platform) |
accountUuid | string | No | Single account (legacy) |
platform | string | No | Platform type (default: twitter) |
priority | number | No | Priority (default: 0) |
applyJitter | boolean | No | Add random jitter ±3min (default: true) |
Response:
{
"message": "Draft scheduled successfully",
"queueIds": ["uuid1", "uuid2"],
"scheduledFor": "2026-01-15T10:00:00.000Z",
"accountCount": 2
}
Cancel Schedule
DELETE /api/v1/twitter/schedule
curl -X DELETE "https://xaicreator.com/api/v1/twitter/schedule?draftId=draft_uuid" \
-H "xai-key: your_api_key"
List Schedules
GET /api/v1/twitter/schedule
curl "https://xaicreator.com/api/v1/twitter/schedule" \
-H "xai-key: your_api_key"
Response:
{
"schedules": [
{
"id": "queue_uuid",
"draftId": "draft_uuid",
"draftTitle": "My Draft",
"scheduledFor": "2026-01-15T10:00:00.000Z",
"priority": 0,
"attempts": 0,
"createdAt": "2026-01-14T08:00:00.000Z",
"platform": "twitter",
"accountUuid": "account_uuid"
}
]
}
Media Upload
Upload Media
POST /api/v1/twitter/media/upload
curl -X POST "https://xaicreator.com/api/v1/twitter/media/upload" \
-H "xai-key: your_api_key" \
-F "files=@/path/to/image.jpg"
Limits:
- Maximum 4 files per request
- Images: 5MB per file
- GIFs: 15MB per file
- Videos: 512MB per file
Response:
{
"code": 0,
"data": {
"uploads": [
{
"mediaId": "media_id_string",
"url": "https://pbs.twimg.com/...",
"type": "image"
}
]
}
}
Social Sets
List Social Sets
GET /api/v1/social-sets
curl "https://xaicreator.com/api/v1/social-sets" \
-H "xai-key: your_api_key"
Response:
{
"socialSets": [
{
"id": "social-set-id",
"name": "My Social Set",
"accounts": [
{
"accountId": "account_id",
"platform": "twitter",
"username": "username"
}
]
}
]
}
Create Social Set
POST /api/v1/social-sets
curl -X POST "https://xaicreator.com/api/v1/social-sets" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{"name": "New Social Set"}'
Update Social Set
PUT /api/v1/social-sets
curl -X PUT "https://xaicreator.com/api/v1/social-sets" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{"id": "social-set-id", "name": "Updated Name"}'
Delete Social Set
DELETE /api/v1/social-sets
curl -X DELETE "https://xaicreator.com/api/v1/social-sets" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{"id": "social-set-id"}'
User Info
Get Current User
GET /api/v1/me
curl "https://xaicreator.com/api/v1/me" \
-H "xai-key: your_api_key"
Response:
{
"uuid": "user-uuid",
"email": "[email protected]",
"nickname": "John",
"avatar_url": "https://...",
"timezone": "Asia/Shanghai",
"credits_balance": 150,
"locale": "en",
"created_at": "2026-01-01T00:00:00.000Z"
}
Accounts Management
List Connected Accounts
GET /api/v1/accounts
List all social accounts bound to the authenticated user across all platforms.
curl "https://xaicreator.com/api/v1/accounts" \
-H "xai-key: your_api_key"
Response:
{
"accounts": [
{
"uuid": "account-uuid",
"platform": "twitter",
"platform_user_id": "123456",
"username": "johndoe",
"display_name": "John Doe",
"avatar": "https://...",
"status": "active",
"followers_count": 1500,
"following_count": 300,
"created_at": "2026-01-01T00:00:00.000Z"
}
]
}
Get Account Details
GET /api/v1/accounts/:id
curl "https://xaicreator.com/api/v1/accounts/account-uuid" \
-H "xai-key: your_api_key"
Remove Account
DELETE /api/v1/accounts/:id
Unbind a social account from the user. This removes the account from all Social Sets.
curl -X DELETE "https://xaicreator.com/api/v1/accounts/account-uuid" \
-H "xai-key: your_api_key"
Response:
{
"success": true,
"message": "Account deleted successfully"
}
Templates
List Templates
GET /api/v1/templates
curl "https://xaicreator.com/api/v1/templates" \
-H "xai-key: your_api_key"
Response:
{
"templates": [
{
"uuid": "template-uuid",
"name": "My Template",
"description": "A reusable template",
"head_content_plain": "Header text",
"tail_content_plain": "Footer text",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}
]
}
Get Template
GET /api/v1/templates/:id
curl "https://xaicreator.com/api/v1/templates/template-uuid" \
-H "xai-key: your_api_key"
Create Template
POST /api/v1/templates
curl -X POST "https://xaicreator.com/api/v1/templates" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{
"name": "My Template",
"description": "A reusable template",
"headContentPlain": "Header text",
"tailContentPlain": "Footer text"
}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name |
description | string | No | Template description |
headContentPlain | string | No | Header content (plain text) |
tailContentPlain | string | No | Footer content (plain text) |
headContentHtml | string | No | Header content (HTML) |
tailContentHtml | string | No | Footer content (HTML) |
Update Template
PUT /api/v1/templates/:id
curl -X PUT "https://xaicreator.com/api/v1/templates/template-uuid" \
-H "Content-Type: application/json" \
-H "xai-key: your_api_key" \
-d '{"name": "Updated Template"}'
Delete Template
DELETE /api/v1/templates/:id
curl -X DELETE "https://xaicreator.com/api/v1/templates/template-uuid" \
-H "xai-key: your_api_key"
Credits
Check Credits Balance
POST /api/v1/credits
curl -X POST "https://xaicreator.com/api/v1/credits" \
-H "xai-key: your_api_key"
Response:
{
"balance": 150,
"expiresAt": "2026-02-01T00:00:00Z"
}
Credits Usage History
GET /api/v1/credits/usage
curl "https://xaicreator.com/api/v1/credits/usage?page=1&limit=20" \
-H "xai-key: your_api_key"
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | number | No | Page number (default: 1) |
limit | number | No | Items per page (default: 20, max: 100) |
start_date | string | No | Filter by start date (ISO 8601) |
end_date | string | No | Filter by end date (ISO 8601) |
trans_type | string | No | Filter by transaction type |
Response:
{
"records": [
{
"id": 1,
"trans_no": "TXN-001",
"trans_type": "publish",
"credits": -10,
"order_no": null,
"source_type": "twitter",
"source_detail": "Published draft: My Draft",
"expired_at": null,
"created_at": "2026-01-15T10:00:00.000Z"
}
],
"pagination": {
"total": 50,
"page": 1,
"limit": 20,
"hasMore": true
}
}
Error Handling
All endpoints may return errors in this format:
{
"success": false,
"error": "ERROR_CODE",
"message": "Human-readable error message"
}
Common Error Codes
| Code | Description |
|---|---|
INVALID_API_KEY | API key is missing, invalid, or revoked |
USER_NOT_FOUND | Email not registered |
INVALID_CREDENTIALS | Invalid email or password |
INSUFFICIENT_CREDITS | Not enough credits for the operation |
NO_SOCIAL_SET | User has no Social Set. Connect a social account first before creating drafts. |
UNAUTHORIZED | User lacks permission for the resource |
NOT_FOUND | Requested resource doesn't exist |
RATE_LIMITED | Too many requests, try again later |
INVALID_INPUT | Request validation failed |
TOKEN_EXPIRED | OAuth token has expired (re-auth required) |
OAUTH_NOT_CONFIGURED | OAuth environment variables not configured |
HTTP Status Codes
| Status | Description |
|---|---|
200 | Success |
400 | Bad Request (invalid input) |
401 | Unauthorized (invalid API key or token) |
402 | Payment Required (insufficient credits) |
403 | Forbidden (limit exceeded) |
404 | Not Found |
500 | Internal Server Error |
Rate Limits
API requests are rate limited per API Key:
- Free tier: 100 requests/hour
- Pro tier: 1,000 requests/hour
- Enterprise: Custom limits
Rate limit headers are included in responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1705272000
Best Practices
- Secure Your Keys: Never expose API Keys in client-side code or public repositories
- Handle Errors: Always check for error responses and handle appropriately
- Check Credits: Verify credit balance before publishing operations
- Use Webhooks: For long-running operations, consider setting up webhooks
- Cache Responses: Cache Social Set and account data to reduce API calls
- Batch Operations: Create threads in a single draft request when possible
- Schedule Ahead: Use the scheduling API for optimal posting times
- Multi-Platform: Use
multi-platformendpoint for simultaneous publishing
Platform Reference
| Platform | Max Characters | Max Media | Credit Cost |
|---|---|---|---|
Twitter | 280 (or more with Premium) | 4 images / 1 video | 10 |
Bluesky | 300 | 4 images | 10 |
Mastodon | 500 (instance-dependent) | 4 images | 10 |
Threads | 500 | 10 photos / 1 video | 10 |
LinkedIn | 3000 | 20 images | 10 |
CLI Tool
The @xaicreator/cli npm package provides a command-line interface for all API operations, suitable for both human users and AI agents.
Installation
npm install -g @xaicreator/cli
# or run directly
npx @xaicreator/cli
Authentication
# Login with API Key
xaic login --api-key sk-xxx
# Check current user
xaic whoami
# Logout
xaic logout
Common Commands
# Drafts
xaic draft list
xaic draft create --content "Hello world"
xaic draft create --file ./tweet.md # From file
xaic draft create --stdin # From stdin (pipe)
xaic draft get <id>
xaic draft update <id> --content "Updated"
xaic draft delete <id>
# Publishing
xaic publish <draft-id>
# Scheduling
xaic schedule create <draft-id> --at "2026-01-15T10:00:00Z"
xaic schedule list
xaic schedule cancel <id>
# Social Sets & Accounts
xaic social-set list
xaic account list
# Templates
xaic template list
xaic template get <id>
xaic template create --name "My Template"
# Credits
xaic credits
xaic credits-usage
Global Options
--output json|table|minimal # Output format (default: table)
--api-key sk-xxx # Override stored API Key
--base-url https://... # Custom API base URL
--quiet # Suppress non-essential output
Environment Variables
XAIC_API_KEY=sk-xxx # API Key (alternative to login)
XAIC_BASE_URL=https://... # Custom API base URL
SDK Usage
The CLI's underlying client can be imported as an SDK:
import { XAICreatorClient } from '@xaicreator/cli';
const client = new XAICreatorClient({ apiKey: 'sk-xxx' });
const drafts = await client.listDrafts();
const draft = await client.createDraft({
title: 'Hello',
tweets: [{ content: 'Hello world', position: 0 }],
});
await client.publish(draft.draft.id);
Thread Support
Create multi-tweet threads using --- separator:
echo "First tweet
---
Second tweet
---
Third tweet" | xaic draft create --stdin
Support
For API issues or questions:
- Email: [email protected]
- Documentation: https://xaicreator.com/docs/api
- Status Page: https://xaicreator.com/en/status