Sophclaw
  • 模型
  • 价格
  • 文档
  • Yunclaw Cloud

    • 企业云端 AI 方案
  • Yunclaw Local

    • 企业私有化 AI 方案
  • Openclaw 一体机

    • 企业本地算力一体机
  • Coding Plan
  • Coding 插件

    • SophCode CLI
    • SophCode WebIDE
    • ClaudeCode
    • OpenCode
    • Codex
  • SophCode Desktop
Sophclaw
  • 模型
  • 价格
  • 文档
  • Yunclaw Cloud

    • 企业云端 AI 方案
  • Yunclaw Local

    • 企业私有化 AI 方案
  • Openclaw 一体机

    • 企业本地算力一体机
  • Coding Plan
  • Coding 插件

    • SophCode CLI
    • SophCode WebIDE
    • ClaudeCode
    • OpenCode
    • Codex
  • SophCode Desktop
  • 🎉 精选教程

    • Sophclaw 创建
  • 概览

    • 简介
    • 快速开始
    • 更新日志
    • 价格
  • API参考

    • 普通模型
    • 视觉模型
    • 音频模型
    • 平台管理
    • 私有知识
  • 最佳实践

    • 智能体
    • function call
    • MCP使用案例
  • 项目管理

    • 创建或加入组织
    • 创建项目
    • 选择服务
    • 设置API Key
  • 体验

    • 如何进入试验场
    • Chat
  • 热门工具接入

    • SophCode CLI
    • LiteLLM
    • OfficeAI助手
    • CC Switch
    • Claude Code
    • CodeBuddy
    • Tencent WorkBuddy
    • OpenAI Codex 使用指南
    • ChatGPT Codex 客户端
    • Cursor
    • Cursor 助手
    • ZCode
    • OpenCode
    • Qoder
    • Trae
    • Coze
    • ARGO
    • Dify
    • Bob翻译
    • ChatGPT Box
    • 沉浸式导读
    • 沉浸式翻译
    • 馆长
    • 划词翻译
    • 流畅阅读
    • Chatbox
    • ChatGPT-Next-Web
    • Cherry Studio
    • Easydict
    • Enconvo
    • Pal - AI Chat Client
    • RSS翻译器
    • 思源笔记
    • ToMemo
    • Cline
    • AI-commit

平台管理

Usage Detail

请求说明

  • 基本信息

查询APIKEY对应项目的使用情况

请求地址:https://www.sophnet.com/api/open-apis/projects/usage_detail

请求方式:GET

  • Path参数:
名称类型必填描述
beginTimeString是起始日期,格式为"yyyy-MM-dd",例如"2025-07-01"
endTimeString是终止日期,格式为"yyyy-MM-dd",例如"2025-07-31"
  • Header参数
名称类型必填描述
AuthorizationString是"Bearer" + Apikey

响应说明

  • 响应头参数
名称值描述
Content-Typeapplication/json
  • 响应体参数
名称类型描述
statusint请求状态
messagestring请求信息
result.servicearray(object)服务列表
result.datesarray(string)日期列表
result.invokeDetailsobject各个服务的请求数
result.invokeSummaryinteger所有服务的总请求数
result.costDetailsobject各个服务的费用
result.costSummarynumber所有服务的总费用
result.tokenDetailsobject各个服务的Token用量
result.tokenSummaryinteger所有服务的Token总用量
result.latency90Detailsobject90%的请求完成响应所需的时间
result.latency50Detailsobject50%的请求完成响应所需的时间
result.latency99Detailsobject99%的请求完成响应所需的时间

Balance Query

请求说明

  • 基本信息

查询APIKEY对应项目所属组织的余额信息

请求地址:https://www.sophnet.com/api/open-apis/projects/balance

请求方式:GET

  • Header参数
名称类型必填描述
AuthorizationString是"Bearer" + Apikey

响应说明

  • 响应头参数
名称值描述
Content-Typeapplication/json
  • 响应体参数
名称类型描述
statusint请求状态
messagestring请求信息
result.currentBalancenumber余额
result.currentBalanceWithoutGiftnumber充值余额
result.currentGiftBalancenumber赠送余额
result.balanceThresholdnumber余额提醒阈值

Model Pricing Query

请求说明

  • 基本信息

查询当前组织可用模型的定价与折扣信息

请求地址:https://www.sophnet.com/api/open-apis/v1/models/pricing

请求方式:GET

  • Header参数
名称类型必填描述
AuthorizationString是"Bearer" + Apikey

响应说明

  • 响应头参数
名称值描述
Content-Typeapplication/json
  • 响应体参数
名称类型描述
orgIdnumber组织ID
modelsarray(object)组织可用模型列表
models[].modelFamilystring模型标识
models[].displayNamestring模型展示名
models[].priceobject模型价格(阶梯价格)
models[].price.currencystring币种,CNY 或 USD
models[].price.rulesarray(object)价格规则(阶梯档位)列表
models[].price.rules[].maxInputTokensnumber输入 token 上限,0 / null / 负数表示不限
models[].price.rules[].maxOutputTokensnumber输出 token 上限,0 / null / 负数表示不限
models[].price.rules[].startTimestring生效起始时间,格式 HH:mm,null 表示全天
models[].price.rules[].endTimestring生效结束时间,格式 HH:mm,null 表示全天,endTime 早于 startTime 表示跨零点
models[].price.rules[].inputCostPerThousandTokensnumber每千输入 token 价格
models[].price.rules[].inputCostPerThousandCachedTokensnumber每千缓存命中输入 token 价格
models[].price.rules[].inputCostPerThousandExplicitCachedTokensnumber每千显式缓存输入 token 价格
models[].price.rules[].inputCostPerThousandCacheCreationTokensnumber每千缓存创建输入 token 价格
models[].price.rules[].outputCostPerThousandTokensnumber每千输出 token 价格
models[].price.rules[].outputCostPerThousandReasoningTokensnumber每千思考(reasoning)token 价格
models[].price.rules[].outputCostPerThousandImageTokensnumber每千图像 token 价格
models[].discountnumber费率系数:<1 打折(如 0.8 表示 8 折)、>1 加价、null 无折扣
aigcModelsarray(object)组织可用 AIGC 模型列表(图片/视频/语音)
aigcModels[].modelFamilystring模型标识:图片/视频为 externalId,语音为 modelFamily
aigcModels[].displayNamestring模型展示名
aigcModels[].categorystring子类型:IMAGE_GENERATOR / VIDEO_GENERATOR / AUDIO_TTS / AUDIO_ASR
aigcModels[].billingTypestring计费类型(如 PER_IMAGE、DURATION_RESOLUTION);语音模型为 null
aigcModels[].priceobjectAIGC 价格,结构见下方补充说明
aigcModels[].discountnumber费率系数,同 models[].discount;语音模型恒为 null(语音无折扣机制)

补充说明:

  • 所有单价单位为每千 token。
  • 档位规则:按输入 / 输出 token 上限选「最小可覆盖」档(0 / null 表示不限);分时段档优先,未命中回退全天档。
  • discount 为费率系数:0.8 表示 8 折,null 表示无折扣;最终费用 = 价格 × 用量 × discount。
  • aigcModels 为 AIGC 模型(图片/视频/语音)的价格列表,与 models 平行返回,结构不同:
    • 图片/视频条目:price.rules 为计费档位数组(原样透出计费规则),每条含 conditions(档位条件,如 taskType/resolution)、price、priceUnit(PER_IMAGE 按张 / PER_SECOND 按秒 / FIXED 固定价 / PER_CREDIT 按积分 / PER_MILLION_TOKENS 按百万 token / VIDEO_COMPOSITE 视频合成 / PER_MILLION_MULTI_TOKENS 多维 token,复合计费的额外字段:inputPrice 每张输入参考图、inputFreeCount 免费参考图张数、outputSecondPrice/inputVideoSecondPrice 每秒价、prices 多维单价映射);discount 为组织折扣,与实际扣费一致。
    • 语音条目:价格为扁平结构,TTS 用 price.inputPricePerTenThousandChar(每万字符,CNY),ASR 用 price.inputPricePerHour(每小时,CNY);billingType 与 discount 恒为 null(语音无折扣机制)。

请求示例

curl --location -g --request GET 'https://www.sophnet.com/api/open-apis/v1/models/pricing' \
--header "Authorization: Bearer <API_KEY>"

响应示例

{
    "orgId": 1024,
    "models": [
        {
            "modelFamily": "qwen3.5",
            "displayName": "Qwen3.5",
            "price": {
                "currency": "CNY",
                "rules": [
                    {
                        "maxInputTokens": 128000,
                        "maxOutputTokens": 16000,
                        "startTime": null,
                        "endTime": null,
                        "inputCostPerThousandTokens": 0.012,
                        "inputCostPerThousandCachedTokens": 0.004,
                        "inputCostPerThousandExplicitCachedTokens": 0.004,
                        "inputCostPerThousandCacheCreationTokens": 0.03,
                        "outputCostPerThousandTokens": 0.03,
                        "outputCostPerThousandReasoningTokens": 0.03,
                        "outputCostPerThousandImageTokens": 0.03
                    }
                ]
            },
            "discount": 0.8
        }
    ],
    "aigcModels": [
        {
            "modelFamily": "Qwen-Image",
            "displayName": "Qwen Image",
            "category": "IMAGE_GENERATOR",
            "billingType": "PER_IMAGE",
            "price": {
                "currency": "CNY",
                "rules": [
                    {
                        "conditions": {},
                        "price": 0.25,
                        "priceUnit": "PER_IMAGE"
                    }
                ]
            },
            "discount": 0.8
        },
        {
            "modelFamily": "cosyvoice-v1",
            "displayName": "CosyVoice v1",
            "category": "AUDIO_TTS",
            "billingType": null,
            "price": {
                "currency": "CNY",
                "inputPricePerTenThousandChar": 2.0
            },
            "discount": null
        }
    ]
}

请将 <API_KEY> 替换为你的 API Key。该接口无需其他请求参数。

批量导出脚本:curl_query_model_price.sh —— 输出按模型/档位整理的价格表:

SOPH_API_KEY=<你的_API_KEY> ./curl_query_model_price.sh

Usage Detail Export

请求说明

  • 基本信息

导出组织用量明细(行级请求记录,用于对账)。单次时间窗上限 7 天(带 projectId / model 过滤时 1 小时),每页最多 100 条;配套批量导出脚本见下方「批量导出脚本」

请求地址:https://www.sophnet.com/api/open-apis/usages/detail

请求方式:GET

  • Path参数
名称类型必填描述
requestIdString否请求 ID 精确查单条;提供时忽略时间与过滤参数
projectIdLong否项目过滤;与 model 同时提供时时间窗上限降为 1 小时
modelString否模型过滤
beginTimeString否起始时间(ISO 8601,如 2026-09-01T00:00:00.000Z);缺省为当前时间前 10 分钟
endTimeString否结束时间(ISO 8601);缺省为当前时间;必须晚于 beginTime
pageint否页码,0 起,默认 0,最大 100
sizeint否每页条数,默认 10,最大 100
  • Header参数
名称类型必填描述
AuthorizationString是"Bearer" + Apikey,需为组织管理员身份的 Apikey

响应说明

  • 响应头参数
名称值描述
Content-Typeapplication/json
  • 响应体参数
名称类型描述
statusint请求状态
messagestring请求信息
result.contentarray(object)明细列表(分页)
result.content[].requestIdstring请求唯一标识
result.content[].orgIdnumber组织 ID
result.content[].projectIdnumber项目 ID
result.content[].modelstring模型标识
result.content[].apikeyIdnumber使用的 Apikey ID
result.content[].apikeyNamestring使用的 Apikey 名称
result.content[].inputTokensnumber输入 token 数
result.content[].inputCachedTokensnumber输入 token 中隐式缓存命中数量
result.content[].inputExplicitCachedTokensnumber输入 token 中显式缓存命中数量
result.content[].cacheCreationTokensnumber缓存创建 token 数
result.content[].outputTokensnumber输出 token 数
result.content[].outputReasoningTokensnumber输出中思考(reasoning)token 数
result.content[].outputImageTokensnumber输出中图像 token 数
result.content[].costInCnynumber实付金额(人民币)
result.content[].currencystring计费单价币种(CNY/USD),计费时刻冻结;费用字段恒为人民币
result.content[].preDiscountCostInCnynumber折前金额(人民币);null 表示该行无折前概念,对账按 costInCny
result.content[].billingRulestring计费规则快照(JSON 字符串,阶梯价格与档位);null 表示无规则快照
result.content[].requestTimestring请求发起时间
result.content[].finishTimestring请求完成时间
result.content[].finishReasonstring结束原因(stop/length 等)
result.totalElementsnumber总条数
result.totalPagesnumber总页数
result.numbernumber当前页码
result.sizenumber当前页条数
  • 限制说明

  • 仅支持查询当月与上月数据,更早数据已归档

请求示例

curl -s --get 'https://www.sophnet.com/api/open-apis/usages/detail' \
  --data-urlencode 'beginTime=2026-09-09T00:00:00.000Z' \
  --data-urlencode 'endTime=2026-09-10T00:00:00.000Z' \
  --data-urlencode 'page=0' \
  --data-urlencode 'size=100' \
  -H "Authorization: Bearer <API_KEY>"

批量导出脚本:curl_export_usage_detail.sh —— 自动切分时间窗并翻页,拉全量数据到本地 JSON(依赖 curl / jq):

SOPH_API_KEY=<你的_API_KEY> BEGIN_TIME=2026-09-09 END_TIME=2026-09-10 ./curl_export_usage_detail.sh

错误说明:401 为 Apikey 无效;403 为该 Apikey 对应账号不是组织管理员

Usage Billing Export

请求说明

  • 基本信息

导出组织账单汇总(按 hour / day / month 聚合,每个时间桶一行)。单次时间窗上限 180 天,每页最多 100 条;配套批量导出脚本见下方「批量导出脚本」

请求地址:https://www.sophnet.com/api/open-apis/usages/billing

请求方式:GET

  • Path参数
名称类型必填描述
projectIdLong否项目过滤(组织级汇总时返回各项目行)
resourceUuidString否资源(服务)过滤;必须与 projectId 同时提供
periodString否聚合粒度:hour / day / month,默认 day
beginTimeString否起始时间(ISO 8601);缺省为当前时间前 30 天
endTimeString否结束时间(ISO 8601);缺省为当前时间;必须晚于 beginTime
pageint否页码,0 起,默认 0,最大 100
sizeint否每页条数,默认 10,最大 100
  • Header参数
名称类型必填描述
AuthorizationString是"Bearer" + Apikey,需为组织管理员身份的 Apikey

响应说明

  • 响应头参数
名称值描述
Content-Typeapplication/json
  • 响应体参数
名称类型描述
statusint请求状态
messagestring请求信息
result.contentarray(object)汇总列表(分页,展平宽表)
result.content[].projectIdnumber项目 ID(组织级聚合时为 null)
result.content[].resourceUuidstring资源 UUID(组织级/项目级聚合时为 null)
result.content[].periodStartTimestring时间桶起点
result.content[].requestCountnumber该桶内请求次数
result.content[].tokenTotalnumber该桶内总 token
result.content[].inputTokensnumber输入 token
result.content[].outputTokensnumber输出 token
result.content[].inputCachedTokensnumber输入 token 中缓存命中数量
result.content[].costnumber实付金额(人民币)
result.content[].estimateCostnumber预估金额(人民币)
result.totalElementsnumber总条数
result.totalPagesnumber总页数
result.numbernumber当前页码
result.sizenumber当前页条数

请求示例

curl -s --get 'https://www.sophnet.com/api/open-apis/usages/billing' \
  --data-urlencode 'period=day' \
  --data-urlencode 'beginTime=2026-08-01T00:00:00.000Z' \
  --data-urlencode 'endTime=2026-09-01T00:00:00.000Z' \
  --data-urlencode 'page=0' \
  --data-urlencode 'size=100' \
  -H "Authorization: Bearer <API_KEY>"

批量导出脚本:curl_export_usage_billing.sh —— 自动切分时间窗并翻页,拉全量数据到本地 JSON(依赖 curl / jq):

SOPH_API_KEY=<你的_API_KEY> BEGIN_TIME=2026-08-01 END_TIME=2026-09-01 PERIOD=day ./curl_export_usage_billing.sh

错误说明:401 为 Apikey 无效;403 为该 Apikey 对应账号不是组织管理员

Prev
音频模型
Next
私有知识