Spaces

X (Twitter) DM API for AI agents

Connect your X account and your AI agent can read and answer your DMs with text, photos and files, start a DM with someone who expects to hear from you, and schedule messages.

What your agent can do on X

Three steps

  1. Start a trial and connect X. You sign in to X through a secure link and approve the connection.
  2. Add Spaces to your AI agent with one URL, https://api.spacesos.com/mcp/x, or use the REST API at https://api.spacesos.com/v1. Steps for each AI client.
  3. Your agent reads and answers. Spaces paces every message inside the limits that keep the account safe.

Or paste this into your agent and let it set things up with you:

Set up Spaces for me by following https://www.spacesos.com/agents

The core tools

What it doesMCP toolREST
Your conversations, newest first. Filter to unread.list_messaging_chatsGET …/chats
The messages in one conversation.list_messaging_messagesGET …/chats/{chat_id}/messages
An image, file, voice note or video from a message.get_messaging_attachmentGET …/chats/{chat_id}/messages/{message_id}/attachments/{attachment_id}
Reply in a conversation, with text or attachments.reply_in_chatPOST …/chats/{chat_id}/messages
Start a new conversation with someone who expects to hear from you.start_chatPOST …/chats
Send a message at a set local time, inside working hours you choose.schedule_messagePOST /v1/messaging/schedules

Every X tool · X MCP guide · Full reference

Limits that keep the account safe

Up to 100 messages a day per account, at least 20 seconds apart, with 20 new chats a day at most and a four-week warm-up for new accounts. X limits in full · How accounts are kept safe.

FAQ

Do I need an X developer account or a paid API tier?

No. You sign in to X through a secure link and approve the connection. Spaces is priced per connected account.

Can my agent send DMs on X?

Yes, inside conservative daily limits: up to 100 messages a day, with fewer new conversations while a new account warms up.

How much does the X API cost?

Plans from $19 a month for one connected account, with a trial. You pay per connected account, not per message or per contact.