跳转到主要内容
进阶接入

接入概览

Agent 工具原生只处理文本生成协议。图像生成、视频生成、语音合成、语音识别、实时语音对话和决策模型需要通过 Slash Command、Skill 或 Agent 调用原生接口。

为什么需要扩展

Claude Code、Codex、OpenCode、Qwen Code 等 Agent 工具原生只处理文本生成协议(OpenAI 兼容或 Anthropic 兼容)。Token Plan 中的图像生成、视频生成、语音合成、语音识别、实时语音对话和决策模型不在这套协议内,需要工具通过 Slash Command、Skill 或 Agent 调用各自的接口。

接口总览

能力接口
决策模型https://token-plan.maas.qianwenaiapi.com/compatible-mode/v1/systemone
图像生成https://token-plan.maas.qianwenaiapi.com/api/v1/services/aigc/multimodal-generation/generation
视频生成(提交)https://token-plan.maas.qianwenaiapi.com/api/v1/services/aigc/video-generation/video-synthesis
视频生成(查询)https://token-plan.maas.qianwenaiapi.com/api/v1/tasks/{task_id}
语音合成https://token-plan.maas.qianwenaiapi.com/api/v1/services/audio/tts/SpeechSynthesizer
语音识别https://token-plan.maas.qianwenaiapi.com/api/v1/services/aigc/multimodal-generation/generation
实时语音对话wss://token-plan.maas.qianwenaiapi.com/api-ws/v1/realtime?model=qwen-audio-3.0-realtime-plus

快速接入

按要接入的能力选择对应文档,具体配置步骤见各文档。

前提

  • 已订阅 Token Plan。个人版在 我的订阅(个人版) 获取以 sk-sp- 开头的 API Key;团队版在 成员管理 分配席位后获取 API Key。
  • 使用的工具支持上表中的扩展方式。

工具配置路径

下表以图像生成为例。接入其他能力时,将 text-to-image 替换为对应能力的命令名,将 token-plan-image 替换为对应的 Skill 名。
工具扩展机制配置文件路径
Claude CodeSlash Command.claude/commands/text-to-image.md
CodexSkill~/.codex/skills/token-plan-image/SKILL.md
Qwen CodeSkill~/.qwen/skills/text-to-image/SKILL.md
OpenCodeAgent.opencode/agents/text-to-image.md
OpenClawSkill~/.openclaw/workspace/skills/token-plan-image/SKILL.md
Hermes AgentSkill~/.hermes/skills/media/text-to-image/SKILL.md
QoderSkill~/.qoder/skills/text-to-image/SKILL.md

计费与安全

  • 各能力的计费方式不同,实际 Credits 消耗以控制台用量统计为准。
  • API Key 只在工具配置或环境变量中使用,不要写入命令文件、代码仓库或日志。
  • 生成结果的 URL 有时效,使用后及时下载。