# see2ai_llm_claude_v1

> SEE2AI 高推理多模态大模型对话服务，支持文本、图片、PDF、TXT 输入及流式回复。适合复杂分析、长文档理解和需要高质量推理的 Agent 场景。

## 📖 接入指引

**Endpoint**: `POST /api/v1/actions/see2ai_llm_claude_v1`

**认证方式**: Bearer Token (租户 API Key)

### Endpoints

| Method | Path | Purpose |
| --- | --- | --- |
| `POST` | `/api/v1/actions/see2ai_llm_claude_v1` | Submit the standard action request. |

> **⚠️ 重要提示**
> 
> 本 API 是 SEE2AI 平台标准化封装后的接口，**参数格式与任何上游 API 不同**。
> 请直接使用下方 Schema 中定义的参数，无需参考其他文档。
> 
> *例如：*
> *- 文本模型参数可能是 `query` 而不是 `messages` 数组*
> *- 视频模型参数可能是 `brief` (创意简报) 而不是复杂的配置项*

## 📥 输入参数 (Input Schema)

```json
{
  "properties": {
    "query": {
      "description": "用户提示词或问题。",
      "title": "Query",
      "type": "string"
    },
    "image_urls": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": [],
      "description": "最多 20 个公网 HTTPS 图片 URL。本地文件需先上传后使用。",
      "title": "Image Urls"
    },
    "document_urls": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": [],
      "description": "可选公网 HTTPS 文档 URL，仅支持 PDF 和 TXT。",
      "title": "Document Urls"
    },
    "system_prompt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "可选系统提示词，会置于用户请求之前。",
      "title": "System Prompt"
    },
    "enable_thinking": {
      "default": false,
      "description": "预留的深度思考开关。",
      "title": "Enable Thinking",
      "type": "boolean"
    },
    "max_tokens": {
      "anyOf": [
        {
          "maximum": 16384,
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 4096,
      "description": "最大输出词元数，平台上限 16384。",
      "title": "Max Tokens"
    },
    "temperature": {
      "default": 0.7,
      "description": "采样温度，用于控制回答随机性。",
      "maximum": 1.0,
      "minimum": 0.0,
      "title": "Temperature",
      "type": "number"
    },
    "stream": {
      "default": false,
      "description": "是否返回流式响应。",
      "title": "Stream",
      "type": "boolean"
    }
  },
  "required": [
    "query"
  ],
  "title": "ClaudeOpusChatInput",
  "type": "object"
}
```

### 参数说明

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| `query` | string | ✅ 是 | `-` | 用户提示词或问题。 |
| `image_urls` | array / null | ❌ 否 | `[]` | 最多 20 个公网 HTTPS 图片 URL。本地文件需先上传后使用。 |
| `document_urls` | array / null | ❌ 否 | `[]` | 可选公网 HTTPS 文档 URL，仅支持 PDF 和 TXT。 |
| `system_prompt` | string / null | ❌ 否 | `-` | 可选系统提示词，会置于用户请求之前。 |
| `enable_thinking` | boolean | ❌ 否 | `False` | 预留的深度思考开关。 |
| `max_tokens` | integer / null | ❌ 否 | `4096` | 最大输出词元数，平台上限 16384。 |
| `temperature` | number | ❌ 否 | `0.7` | 采样温度，用于控制回答随机性。 |
| `stream` | boolean | ❌ 否 | `False` | 是否返回流式响应。 |

## 📤 输出结果 (Output Schema)

```json
{
  "$defs": {
    "ClaudeOpusUsageMetadata": {
      "properties": {
        "input_tokens": {
          "default": 0,
          "title": "Input Tokens",
          "type": "integer"
        },
        "output_tokens": {
          "default": 0,
          "title": "Output Tokens",
          "type": "integer"
        },
        "total_tokens": {
          "default": 0,
          "title": "Total Tokens",
          "type": "integer"
        }
      },
      "title": "ClaudeOpusUsageMetadata",
      "type": "object"
    }
  },
  "properties": {
    "input_tokens": {
      "default": 0,
      "description": "输入消耗的词元数量",
      "title": "Input Tokens",
      "type": "integer"
    },
    "output_tokens": {
      "default": 0,
      "description": "输出消耗的词元数量",
      "title": "Output Tokens",
      "type": "integer"
    },
    "total_tokens": {
      "default": 0,
      "description": "总消耗的词元数量",
      "title": "Total Tokens",
      "type": "integer"
    },
    "model": {
      "default": "",
      "description": "实际使用的 SEE2AI 化身模型名称（由各 action 显式填写）",
      "title": "Model",
      "type": "string"
    },
    "source": {
      "default": "see2ai-reasoning-max",
      "description": "SEE2AI 公开模型别名。",
      "title": "Source",
      "type": "string"
    },
    "cost_points": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "预先计算的扣费词元（如果插件内部已经计算好费用，则直接使用此值，忽略基于词元的计算）",
      "title": "Cost Points"
    },
    "response": {
      "description": "SEE2AI 高推理模型回答文本。",
      "title": "Response",
      "type": "string"
    },
    "usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/ClaudeOpusUsageMetadata"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "本次调用的用量统计。"
    },
    "provider_config_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "本次请求使用的内部配置 ID。",
      "title": "Provider Config Id"
    },
    "warnings": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "前置校验器返回的非阻断优化建议。",
      "title": "Warnings"
    }
  },
  "required": [
    "response"
  ],
  "title": "ClaudeOpusChatOutput",
  "type": "object"
}
```

### 输出字段说明

| 字段名 | 类型 | 说明 |
|--------|------|------|
| `input_tokens` | integer | 输入消耗的词元数量 |
| `output_tokens` | integer | 输出消耗的词元数量 |
| `total_tokens` | integer | 总消耗的词元数量 |
| `model` | string | 实际使用的 SEE2AI 化身模型名称（由各 action 显式填写） |
| `source` | string | SEE2AI 公开模型别名。 |
| `cost_points` | integer / null | 预先计算的扣费词元（如果插件内部已经计算好费用，则直接使用此值，忽略基于词元的计算） |
| `response` | string | SEE2AI 高推理模型回答文本。 |
| `usage` | object / null | 本次调用的用量统计。 |
| `provider_config_id` | integer / null | 本次请求使用的内部配置 ID。 |
| `warnings` | array / null | 前置校验器返回的非阻断优化建议。 |

## 💡 调用示例

### cURL 示例

```bash
curl -X POST "https://see2ai.com/api/v1/actions/see2ai_llm_claude_v1" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer sk-your-tenant-api-key" \
     -d '{
  "query": "Explain quantum entanglement in simple terms.",
  "image_urls": [],
  "document_urls": [],
  "enable_thinking": false,
  "max_tokens": 4096,
  "temperature": 0.7,
  "stream": false
}'
```

### Python 示例

```python
import requests

API_KEY = "sk-your-tenant-api-key"
ENDPOINT = "https://see2ai.com/api/v1/actions/see2ai_llm_claude_v1"

headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {API_KEY}"
}

payload = {
  "query": "Explain quantum entanglement in simple terms.",
  "image_urls": [],
  "document_urls": [],
  "enable_thinking": false,
  "max_tokens": 4096,
  "temperature": 0.7,
  "stream": false
}

response = requests.post(ENDPOINT, json=payload, headers=headers)
result = response.json()

print(f"结果：{result}")
```

## 💰 计费说明

> Billed by input/output tokens under the SEE2AI reasoning-max pricing tier.

**注意**: 所有费用都以词元为单位，系统会自动从租户余额中扣除。

## ⚠️ 常见错误码

| HTTP 状态码 | 错误原因 | 解决方案 |
| --- | --- | --- |
| `401` | SEE2AI API key authentication failed. | 检查 API Key 是否正确，或联系管理员充值 |
| `415` | Unsupported document format; only PDF/TXT are accepted. | 请稍后重试 |
| `422` | Input validation failed before the upstream call. | 检查请求参数是否符合 Schema 要求 |
| `429` | SEE2AI LLM service rate limit exceeded. | 降低请求频率，或联系管理员调整限流配置 |
| `500` | SEE2AI LLM upstream request failed or exceeded the context budget. | 稍后重试，如持续失败请联系技术支持 |
| `502` | SEE2AI LLM upstream auth/routing failed. | 请稍后重试 |

## 📞 技术支持

- **文档问题**: 查看 [SEE2AI 官方文档](https://see2ai.com/docs)
- **API 状态**: 访问 [服务状态页面](https://see2ai.com/status)
- **问题反馈**: 联系技术支持团队

---

**API 版本**: see2ai_llm_claude_v1
**最后更新**: 2026-03-23
