API Guide for AI Agents
Copy prompts to give AI agents access to xAIcreator API
Fastest path: in Compose, click the Agent CLI button (top-right, next to Credits). It creates a scoped Agent Key and gives you copy-ready setup snippets for Claude Code, Codex, Cursor or any agent. All of them read the public, always-current SKILL.md.
Recommended: one xAIcreator user Agent Key, select a Social Set to publish
Keys belong to the xAIcreator user, not an individual X account. One scoped Key can operate across that user's Social Sets. Every draft creation / publication explicitly supplies socialSetId; scopes separately control Monitor reads, draft reads/writes, and publication.
Create the Key using the user's existing sk- credential, then configure the returned xai_agent_ secret in the Agent's secret manager. Never delegate X OAuth credentials. Secrets are shown only once; expiry defaults to 90 days and publication is excluded from default scopes.
xaic --output json key create --name content-agent --scopes monitor:read,drafts:read,drafts:write,tweets:publish
With the Agent Key configured:
xaic --output json whoami
xaic --output json social-set list
xaic --output json monitor signals --preset ai-agent --hours 24
xaic --output json monitor posts
xaic --output json tweet create --social-set-id SOCIAL_SET_UUID --content 'Save a reviewable draft'
xaic --output json publish DRAFT_UUID --social-set-id SOCIAL_SET_UUID --idempotency-key campaign-post-001
xaic --output json tweet publish --social-set-id SOCIAL_SET_UUID --content 'The approved post' --idempotency-key campaign-post-002
xaic --output json tweet status REQUEST_UUID
Use /api/v1/agent/social-sets, /agent/monitor/viral, /agent/monitor/posts, /agent/drafts, /agent/publish, and /agent/publish/:id with xai-key or Bearer. Creation/publication bodies require socialSetId. The server checks Set ownership and resolves its authorized X target; clients cannot override user identity or accountIds.
Monitor reads include system discovery and the user's own strategies. Aggregation reports the earliest observed representative within the authorized window, not global originality. Drafts are user-owned, including existing drafts, with optional Social Set filtering.
This phase supports a single X account per Set and text posts/threads. Sets without X or with multiple X accounts fail explicitly. Media, scheduling, other platforms, Auto DM and template changes are not exposed. Scoped Keys cannot manage credentials or access legacy user-wide APIs. Existing sk- behavior remains compatible.
Only publish with explicit authorization. Supply a stable Idempotency-Key and reuse it with the same payload and Set for retries. Unknown/in-progress outcomes require checking request status and X; never bypass them with a new intent key. OAuth credentials and existing Credits charging remain server-side. The user manages delegation with key list and key revoke KEY_UUID using the original user Key. Matching server deployment and migration 0039 are required.
Quick Prompts (One per Tool)
Email Login
I want to get an xai-key using email and password. Follow the rules and return only the result fields.
Base URL: https://xaicreator.com
Note: Use camelCase field names in JSON bodies (for example, socialSetId). Tweets must be an array of objects with a content field (for example, [{"content":"..."}]).
Available tools:
email_login
Endpoint: POST /api/v1/auth/login
Input:
- email: string
- password: string
Output:
- api_key: string
Rules:
- Use curl for all API requests.
- Use header `-H "xai-key: <xai_key>"` for authentication (NOT x-api-key).
- A draft must be created before publishing or scheduling.
- If the user only provides xai_key or any required parameters are missing, use xai_key to fetch the required parameters.
- Always confirm with the user before publishing or scheduling.
- Do not publish without explicit user confirmation.
- Only return the final result fields listed above.
Twitter OAuth URL
I want to get the Twitter OAuth auth_url and state. Follow the rules and return only the result fields.
Base URL: https://xaicreator.com
Note: Use camelCase field names in JSON bodies.
Available tools:
twitter_oauth_url
Endpoint: POST /api/v1/auth/oauth/twitter/url
Input:
- redirect_uri: string
Output:
- auth_url: string
- state: string
Rules:
- Use curl for all API requests.
- Use header `-H "xai-key: <xai_key>"` for authentication (NOT x-api-key).
- A draft must be created before publishing or scheduling.
- If the user only provides xai_key or any required parameters are missing, use xai_key to fetch the required parameters.
- Always confirm with the user before publishing or scheduling.
- Do not publish without explicit user confirmation.
- Only return the final result fields listed above.
Twitter OAuth Callback
I want to exchange code and state for an xai-key. Follow the rules and return only the result fields.
Base URL: https://xaicreator.com
Note: Use camelCase field names in JSON bodies.
Available tools:
twitter_oauth_callback
Endpoint: POST /api/v1/auth/oauth/twitter/callback
Input:
- code: string
- state: string
Output:
- api_key: string
Rules:
- Use curl for all API requests.
- Use header `-H "xai-key: <xai_key>"` for authentication (NOT x-api-key).
- A draft must be created before publishing or scheduling.
- If the user only provides xai_key or any required parameters are missing, use xai_key to fetch the required parameters.
- Always confirm with the user before publishing or scheduling.
- Do not publish without explicit user confirmation.
- Only return the final result fields listed above.
User Information
I want to fetch the user's social sets and accounts. Follow the rules and return only the result fields.
Base URL: https://xaicreator.com
Available tools:
get_social_set
Endpoint: GET /api/v1/social-sets
Headers: xai-key: <your_xai_key>
Output:
- social_sets: array of socialSetId, name, accounts (array of account_id and platform)
Rules:
- Use curl for all API requests.
- Use header `-H "xai-key: <xai_key>"` for authentication (NOT x-api-key).
- A draft must be created before publishing or scheduling.
- If the user only provides xai_key or any required parameters are missing, use xai_key to fetch the required parameters.
- Always confirm with the user before publishing or scheduling.
- Do not publish without explicit user confirmation.
- Only return the final result fields listed above.
Create Draft
I want to create a draft. Follow the rules and return only the result fields.
Base URL: https://xaicreator.com
Note: Use camelCase field names in JSON bodies. Tweets must be an array of objects with a content field (for example, [{"content":"..."}]).
Available tools:
create_draft
Endpoint: POST /api/v1/twitter/drafts
Headers: xai-key: <your_xai_key>
Input:
- title: string
- tweets: array of objects with content field
- socialSetId: string
Output:
- draft_id: string
Rules:
- Use curl for all API requests.
- Use header `-H "xai-key: <xai_key>"` for authentication (NOT x-api-key).
- A draft must be created before publishing or scheduling.
- If the user only provides xai_key or any required parameters are missing, use xai_key to fetch the required parameters.
- Always confirm with the user before publishing or scheduling.
- Do not publish without explicit user confirmation.
- Only return the final result fields listed above.
Publish Draft
I want to publish a draft. Follow the rules and return only the result fields.
Base URL: https://xaicreator.com
Note: Use camelCase field names in JSON bodies.
Available tools:
publish_draft
Endpoint: POST /api/v1/twitter/publish
Headers: xai-key: <your_xai_key>
Input:
- draft_id: string
- account_ids: array of string
Output:
- success: boolean
- results: array of account_id and status
Rules:
- Use curl for all API requests.
- Use header `-H "xai-key: <xai_key>"` for authentication (NOT x-api-key).
- A draft must be created before publishing or scheduling.
- If the user only provides xai_key or any required parameters are missing, use xai_key to fetch the required parameters.
- Always confirm with the user before publishing or scheduling.
- Do not publish without explicit user confirmation.
- Only return the final result fields listed above.
Schedule Draft
I want to schedule a draft. Follow the rules and return only the result fields.
Base URL: https://xaicreator.com
Note: Use camelCase field names in JSON bodies.
Available tools:
schedule_draft
Endpoint: POST /api/v1/twitter/schedule
Headers: xai-key: <your_xai_key>
Input:
- draft_id: string
- scheduled_for: ISO 8601 datetime string
- targets: array of account_id and platform
Output:
- schedule_id: string
- scheduled_for: string
Rules:
- Use curl for all API requests.
- Use header `-H "xai-key: <xai_key>"` for authentication (NOT x-api-key).
- A draft must be created before publishing or scheduling.
- If the user only provides xai_key or any required parameters are missing, use xai_key to fetch the required parameters.
- Always confirm with the user before publishing or scheduling.
- Do not publish without explicit user confirmation.
- Only return the final result fields listed above.
View Schedules
I want to view scheduled posts. Follow the rules and return only the result fields.
Base URL: https://xaicreator.com
Available tools:
view_schedules
Endpoint: GET /api/v1/twitter/schedule
Headers: xai-key: <your_xai_key>
Output:
- schedules: array of draft_id, title, scheduled_for, targets (array of platform and account_id)
Rules:
- Use curl for all API requests.
- Use header `-H "xai-key: <xai_key>"` for authentication (NOT x-api-key).
- A draft must be created before publishing or scheduling.
- If the user only provides xai_key or any required parameters are missing, use xai_key to fetch the required parameters.
- Always confirm with the user before publishing or scheduling.
- Do not publish without explicit user confirmation.
- Only return the final result fields listed above.
Full Prompt
I want to use xAIcreator API tools to manage login, OAuth, social sets, drafts, publishing, and scheduling. If any required parameters are missing, fetch them via the API. Follow the rules and return only the result fields.
Base URL: https://xaicreator.com
Note: Use camelCase field names in JSON bodies. Tweets must be an array of objects with a content field (for example, [{"content":"..."}]).
Available tools:
email_login
Endpoint: POST /api/v1/auth/login
Input:
- email: string
- password: string
Output:
- api_key: string
---
twitter_oauth_url
Endpoint: POST /api/v1/auth/oauth/twitter/url
Input:
- redirect_uri: string
Output:
- auth_url: string
- state: string
---
twitter_oauth_callback
Endpoint: POST /api/v1/auth/oauth/twitter/callback
Input:
- code: string
- state: string
Output:
- api_key: string
---
get_social_set
Endpoint: GET /api/v1/social-sets
Headers: xai-key: <your_xai_key>
Output:
- social_sets: array of socialSetId, name, accounts (array of account_id and platform)
---
create_draft
Endpoint: POST /api/v1/twitter/drafts
Headers: xai-key: <your_xai_key>
Input:
- title: string
- tweets: array of objects with content field
- socialSetId: string
Output:
- draft_id: string
---
publish_draft
Endpoint: POST /api/v1/twitter/publish
Headers: xai-key: <your_xai_key>
Input:
- draft_id: string
- account_ids: array of string
Output:
- success: boolean
- results: array of account_id and status
---
schedule_draft
Endpoint: POST /api/v1/twitter/schedule
Headers: xai-key: <your_xai_key>
Input:
- draft_id: string
- scheduled_for: ISO 8601 datetime string
- targets: array of account_id and platform
Output:
- schedule_id: string
- scheduled_for: string
---
view_schedules
Endpoint: GET /api/v1/twitter/schedule
Headers: xai-key: <your_xai_key>
Output:
- schedules: array of draft_id, title, scheduled_for, targets (array of platform and account_id)
Rules:
- Use curl for all API requests.
- Use header `-H "xai-key: <xai_key>"` for authentication (NOT x-api-key).
- A draft must be created before publishing or scheduling.
- If the user only provides xai_key or any required parameters are missing, use xai_key to fetch the required parameters.
- Always confirm with the user before publishing or scheduling.
- Do not publish without explicit user confirmation.
- Only return the final result fields listed above.