> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# AIsa Twitter API

> 读取 X/Twitter 个人资料、时间线、推文、趋势和社区。

[在 GitHub 上查看 →](https://github.com/AIsa-team/agent-skills/tree/main/social-media/aisa-twitter-api)

**Twitter/X 数据访问 Skill。** 使用 AIsa 读取个人资料、时间线、推文、趋势、社区、列表、Spaces 及相关社交上下文。

## 安装

```bash npx skills theme={null}
npx skills add AIsa-team/agent-skills --skill aisa-twitter-api
```

```bash AIsa CLI theme={null}
npm install -g @aisa-one/cli
aisa skills install aisa-twitter-api
```

安装完成后请启动新的智能体会话，以加载该 Skill。

## 智能体可以用它做什么？

> [card] 个人资料调研
>
> 查看用户、简介、时间线和关系。

> [card] 推文搜索
>
> 查找推文、趋势、列表、Spaces 和社区。

> [card] 受众图谱
>
> 查看粉丝、关注及社交网络上下文。

> [card] 对话上下文
>
> 拉取推文线程和 Grok 对话上下文以供分析。

## 何时使用

* 当用户需要一个综合性的 Twitter/X Skill 来做调研、监控、趋势发现、时间线查看或内容发现时。
* 当用户需要查看个人资料、时间线、提及、趋势、回复、引用、列表、社区或 Spaces 时。
* 当用户想在经过明确的 OAuth 批准后起草或发布帖子，而不需要共享密码或浏览器 cookie 时。
* 当工作流应使用 `AISA_API_KEY` 并通过中继方式访问 `https://api.aisa.one` 时。

## 何时不应使用

* Do NOT 用于基于密码的登录、cookie 提取或浏览器凭据抓取。
* Do NOT 在工作流必须避免向 `https://api.aisa.one` 发送中继请求时使用。
* Do NOT 将其作为点赞、关注、回复或增长操作工作流的主要 Skill——这些场景应使用 [`aisa-twitter-post-engage`](https://aisa.one/docs/zh/agent-skills/aisa-twitter-post-engage)。

## 快速参考

* 必需的环境变量：`AISA_API_KEY`
* 必需的可执行文件：`python3`
* 读取客户端：`scripts/twitter_client.py`
* OAuth 和发布客户端：`scripts/twitter_oauth_client.py`
* 发布指南：`references/post_twitter.md`
* 中继目标：`https://api.aisa.one`
* 外部写入：仅在经过明确的 OAuth 批准后才会发布
* 上传行为：图片和视频发布会通过中继发送用户选择的媒体

## 配置

```bash theme={null}
export AISA_API_KEY="your-key"
```

前置条件：

* `python3`
* `AISA_API_KEY`
* 可访问 `https://api.aisa.one` 的网络连接
* 发布前需要明确的 OAuth 批准
* 发布图片或视频时需要用户提供媒体文件

## 功能

* 读取用户数据、时间线、提及、粉丝、关注及相关个人资料信息。
* 搜索推文和用户，查看回复、引用、转推者、线程上下文、趋势、列表、社区和 Spaces。
* 在统一的 Twitter/X 命令界面中运行关注列表式的调研和监控工作流。
* 在经过明确的 OAuth 批准后发布文字、图片和视频帖子。

## 高意图工作流

* 在写作前调研创作者、竞品、品牌或叙事。
* 监控关键词、产品发布或关注列表，并快速拉取代表性推文。
* 在统一的命令界面中查看时间线、提及、回复和趋势动态。
* 仅在用户明确批准 OAuth 后才起草并发布帖子。

## 常用命令

```bash theme={null}
python3 scripts/twitter_client.py search --query "AI agents" --type Latest
python3 scripts/twitter_oauth_client.py authorize
python3 scripts/twitter_oauth_client.py post --text "Hello from AIsa"
```

## 安全护栏

* 不要索取 Twitter/X 密码或浏览器 cookie。
* 不要伪造标题、推文 URL 或附件文件。
* 在 API 确认成功之前，不要声称外部发布已成功。
* 不要暗示发布时 OAuth 是可选的。

## 示例请求

* 调研本周 X 上的开发者在讨论哪些 AI 智能体相关话题。
* 追踪我们产品发布的反馈，并拉取有代表性的推文。
* 建立一个竞品账号小型关注列表，总结今天的变化。
* 授权并发布一条附带图片的 Twitter 短帖。

## 安全说明

* 这是一个中继式工作流，将 Twitter/X API 请求发送到 `https://api.aisa.one`。
* 发布操作需要先通过中继完成明确的 OAuth 批准，然后才会执行外部写入。
* 经批准的图片和视频发布会通过中继发送用户选择的媒体进行上传。
* 必需的密钥：`AISA_API_KEY`。
* 此工作流不需要密码或浏览器 cookie 提取。

## 开始使用

1. 在 [aisa.one](https://aisa.one) 注册并在控制台中创建 API key。
2. 在 shell 中设置：`export AISA_API_KEY="your-key"`。
3. 使用[安装](#安装)部分中的任一命令安装 Skill，然后启动新的智能体会话。

## 相关

> [card] [Twitter Autopilot](https://aisa.one/docs/zh/agent-skills/twitter-autopilot.md)
>
> 完整的 X/Twitter 搜索与互动工作流。

> [card] [AIsa Twitter Command Center](https://aisa.one/docs/zh/agent-skills/aisa-twitter-command-center.md)
>
> 命令行式的 X/Twitter 工作流。

> [card] [Twitter API 参考](https://aisa.one/docs/zh/api-reference/twitter/get_twitter-user-info.md)
>
> X/Twitter 端点文档。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.