> ## 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
> ## Agent Instructions (AIsa)
>
> - 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`.
> - Paid calls need approval first. Docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP discovery are free to read. Before any paid, dynamically priced, or high-cost call, state the exact scope, rate, and maximum USD exposure, then wait for a separate user message approving that scope and cap. A request to collect data is not approval; do not send unapproved probes. Full rule: https://aisa.one/docs/llms.txt

# Media Gen

> 面向自主 Agent 的统一媒体生成。Gemini 兼容 GenerateContent 用于文本/多模态调用；图像/媒体生成路由。一个 API key，覆盖两类模态。

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

**面向自主 Agent 的 AI 媒体生成。** 一个 `AISA_API_KEY` 即可解锁 Gemini 兼容 GenerateContent，以及图像/媒体生成路由。

## 安装

如果还没有安装 AIsa CLI，请先安装：

```bash theme={null}
npm install -g @aisa-one/cli
```

然后安装该技能：

```bash theme={null}
aisa skills install media-gen
```

## Agent 可以用它做什么？

<CardGroup cols={2}>
  <Card title="营销创意" icon="palette">
    “为产品发布 deck 生成一张电影感 hero image。”
  </Card>

  <Card title="社交内容" icon="hashtag">
    “为下一条帖子创建适合社交媒体的图片变体。”
  </Card>

  <Card title="故事板" icon="film">
    “生成 6 个关键帧，展示用户旅程的 happy path。”
  </Card>

  <Card title="参考图像" icon="image">
    “使用这张静态 mock 作为生成创意的视觉上下文。”
  </Card>

  <Card title="照片级真实感" icon="camera">
    “8K 超精细赛博朋克城市天际线，霓虹灯在雨中闪烁。”
  </Card>

  <Card title="Agent 报告" icon="chart-simple">
    “为研究报告 Agent 生成视觉插图。”
  </Card>
</CardGroup>

## 核心能力

* **Gemini 兼容生成** —— 使用 `POST /v1beta/models/{model}:generateContent`，并选择经过验证的模型（如 `gemini-3.5-flash`）进行原生 Gemini 格式的内容生成。

## 快速开始

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

### Gemini 兼容生成

```bash theme={null}
curl -X POST "https://api.aisa.one/v1beta/models/gemini-3.5-flash:generateContent" \
  -H "Authorization: Bearer ***" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"role": "user", "parts": [{"text": "Return exactly: ok"}]}
    ],
    "generationConfig": {"maxOutputTokens": 16}
  }'
```

响应遵循 Gemini `GenerateContentResponse` 结构，生成文本位于 `candidates[0].content.parts[0].text`。

## 端点参考

| Endpoint | 方法 | 用途 |
| - | - | - |
| `/v1beta/models/{model}:generateContent` | POST | [Gemini 兼容生成](/docs/api-reference/chat/post_models-model-generatecontent) |

## 开始使用

1. 在 [aisa.one](https://aisa.one) 注册（新账户有 \$1 免费额度）。
2. 从控制台生成 API key。
3. `export AISA_API_KEY="your-key"` 并安装技能：
   ```bash theme={null}
   npm install -g @aisa-one/cli
   aisa skills install media-gen
   ```

## 相关

<CardGroup cols={3}>
  <Card title="Gemini generateContent" icon="google" href="/docs/api-reference/chat/post_models-model-generatecontent">
    Gemini 兼容生成端点参考。
  </Card>
</CardGroup>


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