Minds Team

Minds API

以编程方式创建和管理带有自定义配置与人格的 AI mind。

以编程方式创建和管理 AI Minds(agent)。Minds 是具备特定专长、个性与知识的可定制 AI 助手。

Base URL: https://getminds.ai/api/v1 或 https://api.getminds.ai/v1

获取 Mind

获取单个 mind 的完整详情,包含 system prompt、共享设置以及知识条目数量。

Endpoint: GET /api/v1/minds/{mindId}

Headers:

Authorization: Bearer minds_your_api_key

响应

{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Marketing Expert",
    "description": "Experienced marketing director",
    "type": "expert",
    "discipline": "Marketing",
    "systemPrompt": "## Core Identity & Personality\n\nYou are a seasoned marketing director...",
    "tags": ["marketing", "b2b"],
    "isPublic": false,
    "isLinkSharingEnabled": false,
    "publicShareId": null,
    "profileImageUrl": "https://...",
    "phoneNumber": null,
    "clonedVoiceStatus": null,
    "profitSplitOptIn": false,
    "createdAt": "2025-12-10T12:00:00.000Z",
    "updatedAt": "2025-12-10T12:00:00.000Z",
    "knowledgeItemCount": 12
  }
}

响应字段

字段类型说明
idstring唯一 mind 标识符
namestringMind 名称
descriptionstringMind 描述
typestringcreative、expert 或 user
disciplinestring专业领域
systemPromptstring定义 mind 行为的完整 system prompt
tagsarray分类标签
isPublicbooleanMind 是否公开可访问
isLinkSharingEnabledboolean是否启用链接分享
publicShareIdstring公共访问的分享 ID(未分享时为 null)
profileImageUrlstring头像图片 URL
phoneNumberstring关联手机号(无则为 null)
clonedVoiceStatusstring语音克隆状态(未克隆则为 null)
profitSplitOptInboolean是否启用分润
knowledgeItemCountnumber已关联的知识条目数量

请求示例

curl -X GET "https://getminds.ai/api/v1/minds/{mindId}" \
  -H "Authorization: Bearer minds_your_api_key"

错误响应

400 Bad Request - mind ID 格式无效

401 Unauthorized - API key 无效或缺失

403 Forbidden - 无权访问此 mind

404 Not Found - Mind 不存在


列出 Mind

获取已认证用户拥有的所有 mind。

Endpoint: GET /api/v1/minds

Headers:

Authorization: Bearer minds_your_api_key

查询参数

参数类型默认值说明
searchstring—按名称、描述或领域过滤 mind(不区分大小写)
limitnumber100返回的最大 mind 数量(1–100)
offsetnumber0分页跳过的 mind 数量

响应

{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Marketing Expert",
      "description": "Experienced marketing director",
      "type": "expert",
      "discipline": "Marketing",
      "tags": ["marketing", "b2b"],
      "profileImageUrl": "https://...",
      "createdAt": "2025-12-10T12:00:00.000Z",
      "updatedAt": "2025-12-10T12:00:00.000Z"
    }
  ],
  "pagination": {
    "total": 42,
    "limit": 100,
    "offset": 0
  }
}

响应字段

字段类型说明
dataarrayMind 对象数组
pagination.totalnumber匹配查询的 mind 总数
pagination.limitnumber每页最大结果数
pagination.offsetnumber已跳过的结果数

请求示例

curl -X GET "https://getminds.ai/api/v1/minds?limit=10&offset=0" \
  -H "Authorization: Bearer minds_your_api_key"

创建 Mind

使用不同训练模式以自定义配置创建新的 AI mind。

Endpoint: POST /api/v1/minds

为安全重试,可发送可选的 X-Minds-Idempotency-Key 请求头(1–128 个字符),并在超时后使用相同的键和请求正文。键以已认证的所有者为作用域。只要原 Mind 仍然存在,即使稍后重试,相同的键也会以 HTTP 200 返回该 Mind,而不会更新它。创建另一个 Mind 时请使用新键(HTTP 201)。超过 128 个字符的键会返回 400,不会被截断。

受管理工作区会对每个请求(包括重试)应用当前的创建权限。新建 Mind 归属于该工作区。重试键不能返回另一个受管理工作区中的 Mind;此类请求会返回 404。如果创建功能已禁用或工作区未激活,则会在创建前返回 403。

Headers:

Authorization: Bearer minds_your_api_key
Content-Type: application/json

请求体

{
  "name": "My AI Expert",
  "description": "An expert in renewable energy",
  "mode": "keywords",
  "type": "expert",
  "discipline": "Renewable Energy",
  "keywords": ["solar", "wind energy", "sustainability", "green tech"],
  "personaContext": "Ada Lovelace, pioneering computer scientist",
  "contextLink": "https://example.com/profile",
  "tags": ["energy", "solar", "sustainability"],
  "profileImageUrl": "https://example.com/avatar.jpg"
}

参数

参数类型必填说明
namestring是Mind 名称(2-100 字符)
disciplinestring是Mind 的专业领域(例如 "Marketing"、"Engineering")
modestring否训练模式:keywords、clone、link 或 manual。默认:keywords
typestring否Mind 类型:creative、expert 或 user。默认:creative
descriptionstring否Mind 的用途描述
keywordsarray条件必填关键词数组(当 mode 为 keywords 时必填)
personaContextstring条件必填要模仿的人物名称/上下文(当 mode 为 clone 时必填;也用于自动派生关键词)
contextLinkstring条件必填Profile/内容 URL(当 mode 为 link 时必填;服务器抓取该 URL 以派生关键词)
tagsarray否分类标签数组(最多 20 个)
profileImageUrlstring否外部头像图片 URL(将被下载并存储)
generateImageboolean否为 true 时,在后台触发 AI 头像生成
cloneVoiceboolean否为 true 时,通过 YouTube 搜索触发语音克隆(实验性)

Mode 取值

mode 参数决定你的 mind 如何训练:

  • keywords(默认)- 使用逗号分隔的关键词训练 mind。AI 将基于这些关键词从不同来源收集相关信息,以构建 mind 的知识库。
    • 必填字段: keywords - 关键词/主题数组
    • 最适合: 特定主题或领域的通用专业能力
  • clone - 通过提供某人的名称和上下文来克隆其风格与知识。AI 将研究并构建模仿其专业能力和沟通风格的完整 profile。
    • 必填字段: personaContext - 名称及简要上下文(例如 "Ada Lovelace, pioneering computer scientist")
    • 最适合: 模仿特定个人、历史人物或知名专家
  • link - 使用特定 URL 的内容训练 mind。提供 profile、作品集或网站链接,AI 将分析并提取相关信息。
    • 必填字段: contextLink - 内容源 URL
    • 最适合: 基于特定网站、作品集或在线 profile 进行训练
  • manual - 创建不进行自动训练的 mind。你将手动配置所有设置,并稍后通过 knowledge API 添加知识。
    • 无额外必填字段
    • 最适合: 希望完全控制训练数据的自定义配置

自动处理: 当你使用 keywords、clone 或 link 时,后端行为与产品内 Add Mind 表单一致 —— 派生 entity 关键词(clone/link 使用 AI 辅助)并异步训练该 mind。可通过创建响应中的 training 区块以及下文 Mind 训练生命周期 中描述的专用端点来跟踪训练进度。manual 模式跳过该自动化,以便你稍后通过 Knowledge API 进行训练。

Type 取值

  • creative - 面向艺术家、设计师、作家等创意工作者
  • expert - 面向专家、顾问及领域专家
  • user - 面向用户 persona、客户与目标受众原型

响应

{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "My AI Expert",
    "description": "An expert in renewable energy",
    "type": "expert",
    "discipline": "Renewable Energy",
    "tags": ["energy", "solar", "sustainability"],
    "profileImageUrl": "https://...",
    "createdAt": "2025-12-10T12:00:00.000Z",
    "updatedAt": "2025-12-10T12:00:00.000Z"
  },
  "training": {
    "status": "queued",
    "readyToChat": false,
    "message": "Queued for data collection",
    "startedAt": null,
    "completedAt": null,
    "error": null
  }
}

training 区块报告 mind 在创建时的生命周期。keywords、clone 和 link 模式以 queued 开始并在后台训练;manual mind 返回时即为 completed,且 readyToChat 已为 true。mind 的 id 在此调用返回时即存在,但只有当 readyToChat 为 true 时该 mind 才能作答。轮询方式见下文 Mind 训练生命周期。

示例:使用 Keywords 模式创建 Mind

curl -X POST "https://getminds.ai/api/v1/minds" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Marketing Expert",
    "description": "Experienced marketing director with expertise in B2B SaaS",
    "mode": "keywords",
    "type": "expert",
    "discipline": "Marketing",
    "keywords": ["B2B marketing", "SaaS", "growth marketing", "content strategy", "brand positioning", "ROI"],
    "tags": ["marketing", "b2b", "saas", "growth"]
  }'

示例:使用 Clone 模式创建 Mind

curl -X POST "https://getminds.ai/api/v1/minds" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Ada Lovelace AI",
    "description": "AI trained to emulate Ada Lovelace",
    "mode": "clone",
    "type": "expert",
    "discipline": "Computer Science Pioneer",
    "personaContext": "Ada Lovelace, pioneering computer scientist and mathematician, first computer programmer",
    "tags": ["computer science", "mathematics", "history"]
  }'
curl -X POST "https://getminds.ai/api/v1/minds" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Brand Voice Expert",
    "description": "Trained on company brand guidelines",
    "mode": "link",
    "type": "creative",
    "discipline": "Brand Strategy",
    "contextLink": "https://example.com/brand-guidelines",
    "tags": ["branding", "copywriting"]
  }'

示例:使用 Manual 模式创建 Mind

curl -X POST "https://getminds.ai/api/v1/minds" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Custom Assistant",
    "description": "Custom configured assistant",
    "mode": "manual",
    "type": "creative",
    "discipline": "General Assistant",
    "tags": ["custom"]
  }'

Mind 训练生命周期

创建 mind 是异步的。POST /v1/minds 会立即返回一个 id,但对于 keywords、clone 和 link 模式,mind 仍在后台训练。mind 的 id 存在并不意味着该 mind 已就绪 —— 只有当 readyToChat 为 true 时该 mind 才能作答。唯一的例外是 manual 模式:这类 mind 跳过数据收集,在创建的那一刻即为 completed。

轮询专用的训练端点,直到 mind 就绪:

curl "https://getminds.ai/api/v1/minds/{mindId}/training" \
  -H "Authorization: Bearer minds_your_api_key"
{
  "status": "running",
  "readyToChat": false,
  "message": "Collecting knowledge...",
  "startedAt": "2025-12-10T12:00:01.000Z",
  "completedAt": null,
  "error": null
}

状态值

状态含义readyToChat
queued训练已入队但尚未开始。false
runningmind 正在主动收集知识并构建其 persona。false
completed训练完成。mind 已就绪可作答。true
failed训练未完成。请检查 error,若可重试则重新训练。false

GET /v1/minds/{id} 也会随 mind 的其余信息一起返回 readyToChat(和 trainingStatus),因此一次读取即可同时告诉你该 mind 是谁以及它是否已能作答。

训练失败时

当 status 为 failed 时,响应会包含一个带有 code 和 retryable 标志的 error 对象:

错误代码含义retryable
COLLECTION_FAILED知识收集未能完成。true
PROFILE_GEN_FAILED无法生成 persona 档案。true
TIMEOUT训练超出时间预算并被停止。true
INTERNAL发生了意外的内部错误。false

重新训练

如果某个 mind 以 failed 结束(或你只是想重建一个 completed 的 mind),可重新训练它:

curl -X POST "https://getminds.ai/api/v1/minds/{mindId}/retrain" \
  -H "Authorization: Bearer minds_your_api_key"

这会将该 mind 重新入队,并返回一个 status 为 queued 的全新 training 区块。重新训练仅对已完成的 mind 有效:仍处于 queued 或 running 的 mind 会返回 409 Conflict,因为已有一次训练正在进行。重新训练后,请再次轮询 GET /v1/minds/{id}/training,直到 readyToChat 为 true。

头像图片

当你提供 profileImageUrl 时:

  1. 图片从外部 URL 下载
  2. 上传到安全存储
  3. 响应中返回存储后的 URL

支持的格式:JPG、PNG、GIF、WEBP

外部下载需要公开的 HTTP(S) 位图 URL。私有网络地址(包括重定向目标)和 SVG 内容会被拒绝。下载上限为 50 MiB,时限为 30 秒。如果下载或存储失败,Mind 仍会使用原始 URL 创建;返回 URL 并不代表图片已成功存储。

训练原理

系统根据你选择的 mode、type 和 discipline 自动生成智能 system prompt:

  • Keywords 模式:围绕你指定的关键词构建专业能力
  • Clone 模式:构建模仿指定人物风格与知识的 profile
  • Link 模式:从所提供的 URL 提取知识
  • Manual 模式:创建一个基础助手,你将使用自定义知识进行训练

你可以在创建后 上传知识 进一步增强 mind。

计划限制

请查看生成的套餐限制表了解当前公共默认值。合同覆盖值可能不同;集成应使用认证 PLAN_LIMIT 响应中的 data.limit 和 data.current。Starter 套餐在 API payload 中表示为 "premium"。

达到上限时,你将收到 403 Forbidden 错误:

{
  "statusCode": 403,
  "statusMessage": "Starter plan limit reached",
  "message": "Starter plan limit reached",
  "url": "/api/v1/minds",
  "error": true,
  "data": {
    "code": "PLAN_LIMIT",
    "limitType": "minds",
    "currentPlan": "premium",
    "limit": 100,
    "current": 100
  }
}

错误响应

400 Bad Request

参数缺失或无效。

{
  "statusCode": 400,
  "statusMessage": "Name is required"
}

401 Unauthorized

API key 无效或缺失。

403 Forbidden

达到计划限制。

500 Internal Server Error

服务器端错误(罕见)。

更新 Mind

更新已存在 mind 的配置,包括名称、描述、system prompt 及其他设置。

Endpoint: PUT /api/v1/minds/{mindId}

Headers:

Authorization: Bearer minds_your_api_key
Content-Type: application/json

请求体

{
  "name": "Updated Name",
  "description": "Updated description",
  "type": "expert",
  "discipline": "Updated Discipline",
  "systemPrompt": "Custom system prompt instructions...",
  "tags": ["tag1", "tag2"],
  "isPublic": false
}

参数

参数类型必填说明
namestring否Mind 名称(2-100 字符)
descriptionstring否Mind 的用途描述
typestring否类型:creative、expert 或 user
disciplinestring否Mind 的专业领域
systemPromptstring否定义 mind 行为与人格的自定义 system prompt
tagsarray否分类标签数组(最多 20 个)
isPublicboolean否Mind 是否公开可访问

System Prompt

systemPrompt 字段允许你自定义 mind 的行为与响应方式。适用于:

  • Persona 自定义:定义特定的人格特征、沟通风格或专业领域
  • 响应格式:指示 mind 以特定格式回答(例如点列表、编号列表)
  • 领域约束:将响应限制在特定主题或视角
  • 语言/语调:设定响应的语言、正式程度或语调

System prompt 示例:

# Survey Response Expert
Du bist ein erfahrener Handwerker. Bei Umfragen antworte immer aus deiner
persönlichen Erfahrung, nicht mit allgemeinen Branchendurchschnittswerten.
Wähle bei Multiple-Choice-Fragen immer genau eine Option.
# Technical Expert
You are a senior software architect. Always provide concrete,
actionable advice. Include code examples when relevant.
Avoid vague statements.

响应

{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Updated Name",
    "description": "Updated description",
    "type": "expert",
    "discipline": "Updated Discipline",
    "systemPrompt": "Custom system prompt...",
    "tags": ["tag1", "tag2"],
    "isPublic": false,
    "profileImageUrl": "https://...",
    "createdAt": "2025-12-10T12:00:00.000Z",
    "updatedAt": "2025-12-29T15:30:00.000Z"
  }
}

示例:更新 System Prompt

curl -X PUT "https://getminds.ai/api/v1/minds/{mindId}" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "systemPrompt": "Du bist ein erfahrener Handwerker im Sanitärbereich. Antworte immer aus deiner persönlichen Praxiserfahrung."
  }'

示例:更新多个字段

curl -X PUT "https://getminds.ai/api/v1/minds/{mindId}" \
  -H "Authorization: Bearer minds_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Senior Plumber Expert",
    "description": "Expert plumber with 20 years of experience",
    "discipline": "Plumbing & Sanitary Installation",
    "tags": ["plumbing", "sanitary", "renovation"]
  }'

错误响应

400 Bad Request - 无有效字段可更新或字段值无效

401 Unauthorized - API key 无效或缺失

403 Forbidden - 无权更新此 mind(必须是 owner)

404 Not Found - Mind 不存在

获取 Mind 知识模式

获取特定 mind 按框架组织的思维模式与知识。

Endpoint: GET /api/v1/minds/{mindId}/knowledge/patterns

Headers:

Authorization: Bearer minds_your_api_key

响应结构

该 endpoint 返回按框架分组的模式(例如 AOX Internal、OCEAN、DISC 等),其中的方法与能力包含出现次数与证据。

{
  "success": true,
  "data": {
    "mindId": "550e8400-e29b-41d4-a716-446655440000",
    "mindName": "Marketing Expert",
    "totalPatterns": 47,
    "frameworks": [
      {
        "id": "aox-internal",
        "name": "AOX Internal Framework",
        "totalOccurrences": 32,
        "methods": [
          {
            "id": "strategic-thinking",
            "name": "Strategic Thinking",
            "description": "Ability to think strategically and plan long-term",
            "occurrences": 15,
            "competencies": [
              {
                "id": "market-analysis",
                "name": "Market Analysis",
                "description": "Understanding market dynamics and trends",
                "occurrences": 8,
                "evidence": [
                  {
                    "mind": "Market segmentation requires understanding customer pain points and aligning product features with specific needs...",
                    "portfolioItemId": "abc-123",
                    "createdAt": "2025-12-10T15:30:00.000Z"
                  },
                  {
                    "mind": "Competitive analysis shows that timing and positioning are critical for market entry...",
                    "portfolioItemId": "def-456",
                    "createdAt": "2025-12-10T14:20:00.000Z"
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

理解响应

  • frameworks:包含该 mind 模式的框架数组
    • totalOccurrences:该框架下的模式总数
    • methods:检测到的思维方法或路径
      • occurrences:该方法出现的次数
      • competencies:该方法下的具体技能或子领域
        • occurrences:该能力下的模式数量
        • evidence:展示该模式的引用/片段数组
          • mind:内容中的实际片段或洞察
          • portfolioItemId:源材料引用
          • createdAt:该模式被识别的时间

请求示例

curl -X GET "https://getminds.ai/api/v1/minds/{mindId}/knowledge/patterns" \
  -H "Authorization: Bearer minds_your_api_key"

使用场景

  • 了解 mind 的专业能力:查看你的 mind 已学到哪些方法与能力
  • 质量保障:验证模式是否正确从训练数据中提取
  • 知识缺口:识别需要更多训练数据的领域
  • 框架对比:比较一个 mind 在不同框架下的表现

错误响应

401 Unauthorized - API key 无效或缺失

403 Forbidden - 无权访问此 mind

404 Not Found - Mind 不存在

重新生成 System Prompt

使用 mind 的现有知识库重新生成全部 system prompt 组件。该过程使用与 UI 中 "Generate All" 按钮相同的 AI 生成逻辑。

Endpoint: POST /api/v1/minds/{mindId}/regenerate-prompt

Headers:

Authorization: Bearer minds_your_api_key

工作原理

该 endpoint 分析 mind 的知识库(portfolio items、patterns、embeddings)并生成全部 prompt 组件:

对于 user 类型 mind:

  • Core Identity & Demographics
  • Needs & Motivations
  • Pain Points & Challenges
  • Tone & Communication Style
  • Goals & Desires
  • Behavioral Patterns

对于 expert 类型 mind:

  • Core Identity & Personality
  • Professional Expertise & Credentials
  • Tone & Communication Style
  • Professional Approach & Methods
  • Domain Knowledge

对于 creative 类型 mind:

  • Core Identity & Personality
  • Creative Philosophy & Values
  • Tone & Communication Style
  • Creative Approach & Methods
  • Domain Expertise

响应

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "My Mind",
    "systemPrompt": "## Core Identity & Demographics\n\n...",
    "promptLength": 2847
  }
}

请求示例

curl -X POST "https://getminds.ai/api/v1/minds/{mindId}/regenerate-prompt" \
  -H "Authorization: Bearer minds_your_api_key"

使用场景

  • 添加知识之后:重新生成 prompt 以纳入新添加的知识条目
  • Persona 调优:基于当前知识模式更新 persona
  • 重置自定义内容:清除手动编辑内容,并基于知识库重新生成 prompt

错误响应

401 Unauthorized - API key 无效或缺失

403 Forbidden - 无权修改此 mind(必须是 owner)

404 Not Found - Mind 不存在

500 Internal Server Error - 生成 prompt 失败(例如知识不足)

删除 Mind

永久删除 mind 及所有相关数据,包括知识、portfolio 条目和文件。

Endpoint: DELETE /api/v1/minds/{mindId}

Headers:

Authorization: Bearer minds_your_api_key

响应

成功时返回 204 No Content,响应体为空。

请求示例

curl -X DELETE "https://getminds.ai/api/v1/minds/{mindId}" \
  -H "Authorization: Bearer minds_your_api_key"

哪些内容会被删除

删除 mind 时,以下内容会被永久删除:

  • Mind 本身及其所有配置
  • 所有知识与训练数据
  • 所有 portfolio 条目及关联文件
  • 所有聊天历史与消息
  • 头像与已上传文件

警告: 此操作无法撤销。

错误响应

400 Bad Request - mind ID 格式无效

401 Unauthorized - API key 无效或缺失

403 Forbidden - 无权删除此 mind(必须是 owner)

404 Not Found - Mind 不存在

下一步