Skip to content

Remix a post with Xholic AI

POST
/remix/generate
curl -X POST https://api.xholic.ai/v1/remix/generate \
-H "Authorization: Bearer $XHOLIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tweetId":"<tweetId>","closeness":1,"dryRun":true}'

Only when the user explicitly asks for Xholic’s remixer. Writes the user’s own take on an X post in their voice (3 drafts). Uses Xholic AI credits: quote first and pass confirmCredits after the user agrees. Otherwise write the remix yourself from get_post and get_me.

Uses Xholic AI credits (up to about 12). The first call returns CREDITS_CONFIRMATION_REQUIRED with a quote; after the user agrees, call again with confirmCredits and the quote’s quoteId.

Media typeapplication/json
object
tweetId
required

X post id (digits).

string
/^\d{1,25}$/
closeness
required

0 is loosely inspired, 1 stays close to the original.

number
<= 1
customInstructions
string
<= 500 characters
remixAction

Iterate on currentDraft: shorter, punchier, casual or hot_take.

string
Allowed values: shorter punchier casual hot_take
maxLength
integer
>= 30 <= 2000
productId

Weave in one of the user’s products.

string
>= 1 characters <= 100 characters
productContextIntent
string
Allowed values: context focus
currentDraft
string
<= 25000 characters
account

X account to act on, as @handle. Leave it out to use the connection’s default account.

string
>= 1 characters <= 64 characters
dryRun

Return exactly what would happen without doing it.

boolean
idempotencyKey

A unique key for this write. Repeating a call with the same key returns the first result instead of acting twice.

string
>= 8 characters <= 200 characters
confirmCredits

Xholic AI credits the user agreed to spend. Call first without it to get the quote, show the quote to the user, and pass the amount only after they say yes.

number
<= 100000
quoteId

The quoteId from the quote the user agreed to. Send it with confirmCredits.

string
>= 8 characters <= 100 characters

Example

{
"tweetId": "<tweetId>",
"closeness": 1,
"dryRun": true
}

Success

Media typeapplication/json
object
ok
required
boolean
summary
required

One or two readable sentences about the result.

string
data
required

The result. Its shape depends on the action.

ids
object
key
additional properties
any
next
Array<string>
creditsCharged
number
dryRun
boolean

Example

{
"ok": true
}

Error

Media typeapplication/json
object
ok
required
boolean
error
required
object
code
required
string
Allowed values: UNAUTHENTICATED INVALID_CREDENTIAL SCOPE_MISSING ROLE_NOT_PERMITTED ACCOUNT_NOT_FOUND SUBSCRIPTION_REQUIRED FEATURE_NOT_INCLUDED APP_ONLY INVALID_INPUT NOT_FOUND CONFLICT CREDITS_CONFIRMATION_REQUIRED INSUFFICIENT_CREDITS RATE_LIMITED IDEMPOTENCY_KEY_REUSED IDEMPOTENCY_IN_PROGRESS X_DATA_LIMIT_REACHED UPSTREAM_UNAVAILABLE INTERNAL_ERROR
message
required
string
scope
required
string
Allowed values: account platform
retryAfterSeconds
integer
details

Example

{
"ok": false,
"error": {
"code": "UNAUTHENTICATED",
"scope": "account"
}
}