profound-logoProfound CMS
⌘K
Admin
Theme
DocsTutorialBlogPhilosophy
DocsTutorialBlogPhilosophy

Hybrid

Collection of Pages with ComponentsTypes of ComponentsSetup server sent events (SSE) content refetchInstall Profound CMS as a proxyCEL Scripting in Template BuilderProject ScaffoldingMedia Library

Headless

Quick startJSON 与 Claude 代码组件 Zod 拉取

REST API

REST API 概览get连接网站 APIgetGET /routesgetGET /routegetGET /blocksget获取带有 CEL 缓存的区块getGET /blocks/generatedgetGET /componentsgetGET /components/{name}getGET /dataset/{schema_name}get获取内容变更 SSEpatchPATCH /dataset/{schema_name}postPOST /translationpatchPATCH /translationsgetGET /usagepostPOST /csvpatch修补 CSV
All Systems Operational
Powered Byprofound-logo
Theme

GET /usage

报告组织的估算翻译令牌使用量和每个数据表的数据库字节使用量。

报告 WorkOS 组织按语言的估算翻译令牌使用量以及按表的数据库字节使用量。

认证: Bearer JWT(WorkOS)。

查询参数

参数类型必填说明
orgIduuid是要生成报告的 WorkOS 组织。

响应

{
  "orgId": "...",
  "translations": {
    "translations": 120,
    "estimatedPromptTokens": 45000,
    "estimatedCompletionTokens": 42000,
    "estimatedTotalTokens": 87000,
    "byLanguage": [
      {
        "language": "fr",
        "translations": 40,
        "estimated_prompt_tokens": 15000,
        "estimated_completion_tokens": 14000,
        "estimated_total_tokens": 29000
      }
    ],
    "note": "..."
  },
  "database": {
    "totalBytes": 1048576,
    "totalHuman": "1.0 MB",
    "byTable": [ { "table": "文档", "rows": 42, "bytes": 500000 } ],
    "note": "..."
  }
}

令牌计数是估算值(基于约每个令牌 4 个字符的启发式算法,加上每次调用固定的系统提示配额),并非提供商的计费用量。数据库使用量按所拥有的数据表汇总 pg_column_size;存储在对象存储中的图像二进制文件不计入。请注意序列化/反序列化的差异:在 byLanguage 内部,令牌相关键使用蛇形命名(estimated_prompt_tokens 等),而父对象使用驼峰命名。

示例

curl '{CMS_API_URL}/usage?orgId=<uuid>' \
  -H 'Authorization: Bearer <workos-jwt>'

错误

  • 400 — 缺少或无效的 orgId
  • 401 — 缺少或无效的 JWT
  • 500 — 查询失败
Continue Reading
Previous‹PATCH /translationsNextPOST /csv›