10 credits per call · All plans from $0.00012/credit
curl -X POST https://xquik.com/api/v1/x/media \
-H "x-api-key: xq_YOUR_KEY_HERE" \
-F "account=myxhandle" \
-F "file=@/path/to/image.png" | jq
URL-based upload (for AI agents and MCP clients):
curl -X POST https://xquik.com/api/v1/x/media \
-H "x-api-key: xq_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{"account": "myxhandle", "url": "https://example.com/image.png"}' | jq
Your API key. Session cookie authentication is also supported. Generate a key from the dashboard .
Use multipart/form-data when uploading a file. Use application/json when providing a URL.
Body
The connected X account to upload media as. Must be a username you have connected to your Xquik account.
The media file to upload. Required if url is not provided. Supported formats: GIF, JPEG, PNG, MP4.
HTTPS URL to download media from. Required if file is not provided. The server fetches the file from this URL. Useful for AI agents and MCP clients that work with URLs instead of binary file uploads.
Set to true for videos longer than 140 seconds. Defaults to false.
Response
The uploaded media ID. Use this in the media_ids array when creating tweets.
{
"mediaId" : "1893726451023847424" ,
"success" : true
}
{ "error" : "invalid_input" , "message" : "Unsupported file format or missing required fields" }
Missing account, or neither file nor url provided, or the media is not a supported format (GIF, JPEG, PNG, MP4). { "error" : "unauthenticated" , "message" : "Missing or invalid API key" }
Missing or invalid API key. { "error" : "no_subscription" , "message" : "No active subscription" }
An active subscription is required to upload media. Subscribe from the dashboard . { "error" : "usage_limit_reached" , "message" : "Monthly usage quota exceeded" }
Your monthly usage quota has been exhausted. Usage resets at the start of each billing cycle. { "error" : "account_not_found" , "message" : "Connected X account not found" }
The specified account is not connected to your Xquik account. Connect it from the dashboard .
10 credits per call · All plans from $0.00012/credit
Use the returned mediaId in the media_ids array when creating a tweet . Media IDs are valid for 24 hours after upload.