Token导航 LogoToken导航

Agent Skill · 前端设计

tl-openmeter-api(TL openmeter API 文档)

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

tl-openmeter-api 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在前端设计类的 10,216 个 Skill 里排第 8,413。

总安装 288周安装 12GitHub Stars 公开资料未说明下载 96核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tl-openmeter-api(TL openmeter API 文档)
来源仓库:https://github.com/toddlevy/tl-agent-skills
仓库路径:skills/tl-openmeter-api
安装命令:
npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-openmeter-api
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-openmeter-api

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

tl-openmeter-api 用于辅助 API 设计、接口文档、请求响应结构和服务集成说明,适合梳理 endpoint 或生成 OpenAPI 草稿。适用于前后端联调和接口开发场景,需确认真实业务语义和鉴权方式。通过 npx skills add 命令从 GitHub 安装,支持主流 AI 宿主环境。

涉及生成接口文档时应避免凭空补字段,安装前建议确认权限和维护状态。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/tl-openmeter-api

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-openmeter-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

tl-openmeter-api 怎么安装?

在终端执行 npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-openmeter-api。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

tl-openmeter-api 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

tl-openmeter-api 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

tl-openmeter-api 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

tl-openmeter-api 用的人多吗?

公开数据是累计安装 288 次,近一周安装 12 次,下载 96 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

tl-openmeter-api 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
tl-openmeter-api

TL openmeter API 文档 · 本页

288—接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

OpenMeter API

Project-agnostic reference for the OpenMeter REST API. Organized by the official API tags from the OpenAPI 3.0 spec.

Suite

SkillPurpose
tl-openmeter-apiThis skill: REST API reference
tl-openmeter-local-devLocal dev setup: Docker, ngrok, Stripe App, webhooks
tl-openmeter-api-mcp-serverMCP server for calling local OpenMeter from Cursor

When to Use

  • "How do I ingest events into OpenMeter?"
  • "Create an OpenMeter customer with subscription"
  • "Query usage for a meter"
  • "Set up notification rules for threshold alerts"
  • "Manage billing invoices"
  • "Install the Stripe marketplace app"
  • Debugging metering, billing, or subscription lifecycle

Resources

Official API Tags

The OpenMeter API organizes endpoints into these 15 tags:

#TagDescription
1AppsManage app integrations (list, get, update, uninstall)
2App: Custom InvoicingInterface third-party invoicing and payment systems
3App: StripeStripe billing support (API key, webhook, checkout)
4BillingBilling profiles, invoices, customer overrides, pending lines
5CustomersCustomer lifecycle, app data, Stripe linking, entitlement values
6DebugInternal metrics (Prometheus format)
7EntitlementsUsage limits, quota-based pricing, feature access
8EventsCloudEvents ingestion and listing
9Lookup InformationStatic data (currencies, progress)
10MetersAggregation rules, usage queries, group-by
11NotificationsChannels, rules, events for threshold alerts
12PortalConsumer-facing usage dashboards via scoped tokens
13Product CatalogPlans, features, addons (versioning, rate cards, publish lifecycle)
14SubjectsDeprecated — use Customers with usageAttribution.subjectKeys
15SubscriptionsCustomer plan assignments, cancel, change, migrate, restore

Base URL and Auth

  • Base URL: OPENMETER_URL (e.g. http://localhost:8888 for local, or your deployed URL)
  • Auth: Authorization: Bearer <OPENMETER_API_KEY>. Local self-hosted often runs unauthenticated.
  • Content-Type: application/json for most endpoints; application/cloudevents+json for POST /api/v1/events

Concepts

Meter (aggregates events) → Feature (metered entitlement) → Plan (limits + pricing)
                                                                    ↓
Customer (subject keys) ←→ Subscription (customer + plan = active entitlements)
                                    ↓
                              Billing Profile → Invoices (via Stripe/Sandbox/Custom App)
  • Meter: Aggregation rule for events (COUNT, SUM, etc.). Events reference a meter via type matching eventType.
  • Feature: Tied to a meter or boolean; used in plan rate cards for quotas and overage.
  • Plan: Contains phases and rate cards. Part of the Product Catalog alongside Features and Addons.
  • Addon: Modular rate card bundle, attachable to plans or subscriptions.
  • Customer: Has usageAttribution.subjectKeys; event subject must match for usage to attach.
  • Subscription: Links customer to plan; active subscription grants entitlements.
  • Entitlement: Per-customer access to a feature with usage tracking and limits.
  • Grant: One-time credit or usage allocation against an entitlement.
  • Notification: Automated alert when entitlement thresholds are reached.
  • App: Billing provider integration (Stripe, Sandbox, Custom Invoicing).

1. Events

Ingest: POST /api/v1/events | Content-Type: application/cloudevents+json

{
  "specversion": "1.0",
  "id": "unique-event-id",
  "type": "api_request",
  "source": "my-app",
  "subject": "user_abc123",
  "time": "2026-02-14T12:00:00Z",
  "data": { "value": 1, "path": "/v1/events", "method": "GET" }
}
FieldRequiredNotes
typeYesMust match meter's eventType
subjectYesMust match customer's usageAttribution.subjectKeys
sourceYesIdentifies the producing system
idYesIdempotency key (deduplication within 24h)
timeRecommendedISO 8601 timestamp
dataRecommendedArbitrary payload; meters use $.path for groupBy

List events: GET /api/v1/events?from=...&to=...&subject=...&hasError=...


2. Meters

OperationMethodPath
ListGET/api/v1/meters
CreatePOST/api/v1/meters
GetGET/api/v1/meters/{meterIdOrSlug}
UpdatePUT/api/v1/meters/{meterIdOrSlug}
DeleteDELETE/api/v1/meters/{meterIdOrSlug}
Query usageGET/api/v1/meters/{meterIdOrSlug}/query?subject=...&from=...&to=...&windowSize=HOUR
Query (POST)POST/api/v1/meters/{meterIdOrSlug}/query
Group-by valuesGET/api/v1/meters/{meterIdOrSlug}/group-by/{groupBy}/values
List subjectsGET/api/v1/meters/{meterIdOrSlug}/subjects

Aggregation types: COUNT, SUM, AVG, MIN, MAX, UNIQUE_COUNT

Window sizes: MINUTE, HOUR, DAY, MONTH


3. Product Catalog

Plans, Features, and Addons all live under this tag. See references/product-catalog.md for versioning lifecycle, rate cards, and detailed examples.

Features

OperationMethodPath
ListGET/api/v1/features
CreatePOST/api/v1/features
GetGET/api/v1/features/{featureId}
DeleteDELETE/api/v1/features/{featureId}

Plans

OperationMethodPath
ListGET/api/v1/plans
CreatePOST/api/v1/plans
GetGET/api/v1/plans/{planIdOrKey}
UpdatePUT/api/v1/plans/{planIdOrKey}
DeleteDELETE/api/v1/plans/{planIdOrKey}
Next versionPOST/api/v1/plans/{planIdOrKey}/next
PublishPOST/api/v1/plans/{planIdOrKey}/publish
ArchivePOST/api/v1/plans/{planIdOrKey}/archive
Plan AddonsCRUD/api/v1/plans/{planIdOrKey}/addons/...

Addons

OperationMethodPath
ListGET/api/v1/addons
CreatePOST/api/v1/addons
GetGET/api/v1/addons/{addonIdOrKey}
UpdatePUT/api/v1/addons/{addonIdOrKey}
DeleteDELETE/api/v1/addons/{addonIdOrKey}
PublishPOST/api/v1/addons/{addonIdOrKey}/publish
ArchivePOST/api/v1/addons/{addonIdOrKey}/archive

Critical: Plan/addon keys must be snake_case (^[a-z0-9]+(?:_[a-z0-9]+)*$). Rate card upToAmount must be a string. Subscription creation uses plan: {"key": "plan_key"}, not a raw planId. Plans follow a draft -> published -> archived lifecycle.


4. Customers

OperationMethodPath
ListGET/api/v1/customers?page=...&pageSize=...&subject=...&planKey=...
CreatePOST/api/v1/customers
GetGET/api/v1/customers/{customerIdOrKey}
DeleteDELETE/api/v1/customers/{id}
Get accessGET/api/v1/customers/{id}/access
SubscriptionsGET/api/v1/customers/{id}/subscriptions
Entitlement valueGET/api/v1/customers/{id}/entitlements/{featureKey}/value
Stripe dataGET/PUT/api/v1/customers/{id}/stripe
Stripe portalPOST/api/v1/customers/{id}/stripe/portal
App dataGET/PUT/DELETE/api/v1/customers/{id}/apps/{appIdOrType}

Gotcha: DELETE returns 409 if customer has active subscriptions or non-final invoices. See references/billing.md for the customer delete flow.


5. Subscriptions

OperationMethodPath
CreatePOST/api/v1/subscriptions
GetGET/api/v1/subscriptions/{id}
EditPATCH/api/v1/subscriptions/{id}
DeleteDELETE/api/v1/subscriptions/{id}
CancelPOST/api/v1/subscriptions/{id}/cancel
Change planPOST/api/v1/subscriptions/{id}/change
MigratePOST/api/v1/subscriptions/{id}/migrate
RestorePOST/api/v1/subscriptions/{id}/restore
Unschedule cancelPOST/api/v1/subscriptions/{id}/unschedule-cancelation
Subscription addonsGET/POST/api/v1/subscriptions/{id}/addons

PATCH Subscription Customizations

The PATCH /api/v1/subscriptions/{id} endpoint supports a customizations array for modifying subscription items without changing plans. This is useful for admin operations like adding bonus quota.

Request body:

{
  "customizations": [
    {
      "op": "add_item",
      "path": "/phases/0/items/{featureKey}",
      "value": {
        "createInput": {
          "type": "boolean" | "static" | "metered",
          "issueAfterReset": 55000,
          "isSoftLimit": false
        }
      }
    }
  ]
}

Use cases:

  • Add quota bonus: Increase issueAfterReset to give extra API calls for the current period
  • Revert quota: Reset issueAfterReset to plan base value at period end

Key fields:

FieldDescription
opOperation type: add_item, remove_item
pathJSONPath to the item, e.g. /phases/0/items/api_requests
value.createInput.issueAfterResetQuota issued at start of each period
value.createInput.isSoftLimitfalse = hard limit, true = overage allowed

Response includes:

  • items[].entitlement.currentUsagePeriod — Start/end of current billing period
  • items[].entitlement.issueAfterReset — Updated quota value

Verified behavior: When issueAfterReset is modified via PATCH, the change is immediately reflected in totalAvailableGrantAmount balance without requiring a period reset.

stretch_phase Operation

The stretch_phase operation extends a subscription phase duration without affecting quota periods. Useful for trial extensions.

Request body:

{
  "customizations": [
    {
      "op": "stretch_phase",
      "phaseKey": "trial",
      "extendBy": "P7D"
    }
  ]
}

Critical: Phase key must match exactly. The phaseKey must match the subscription's actual phase key:

# Check subscription's phase keys first
curl http://localhost:8888/api/v1/subscriptions/{id} | jq '.phases[].key'

Common pitfall: If you update your plan to have different phase keys (e.g., changing from "standard" to "trial"), existing subscriptions retain their original phase keys. The stretch_phase operation will fail with a 400 error if the phase key doesn't exist.

Subscription State Limitations

StatusAllowed Operations
activePATCH, cancel, change, migrate
inactiveNone (must create new subscription)
canceledrestore, then other operations

Key insight: Inactive subscriptions (e.g., ended trials) cannot be modified. To "reactivate" an expired trial, create a new subscription on the current plan version.

Legacy Subscription Migration Pattern

When plan versions change (e.g., adding new phases), existing subscriptions are NOT automatically migrated. For admin tools that modify subscriptions:

const omStatus = await getSubscriptionStatus(subscriptionId);

if (omStatus.status === "inactive" || omStatus.phaseKey !== expectedPhaseKey) {
  // Create new subscription on current plan version
  const newSub = await createSubscription(customerId, planKey);
  // Update local DB with new OpenMeter subscription ID
} else {
  // Use normal modification (stretch_phase, add_item, etc.)
  await patchSubscription(subscriptionId, customizations);
}

6. Entitlements

OperationMethodPath
List allGET/api/v1/entitlements
Get by idGET/api/v1/entitlements/{id}
Per-customer valueGET/api/v1/customers/{id}/entitlements/{featureKey}/value
HistoryGET/api/v1/subjects/{subjectIdOrKey}/entitlements/{idOrKey}/history
Reset usagePOST/api/v1/subjects/{subjectIdOrKey}/entitlements/{id}/reset
OverridePUT/api/v1/subjects/{subjectIdOrKey}/entitlements/{idOrKey}/override
GrantsPOST/GET/DELETE/api/v1/subjects/.../entitlements/.../grants, /api/v1/grants/...

7. Billing

See references/billing.md for invoice lifecycle, customer delete flow, and rate card schemas.

ResourceOperationsBase Path
ProfilesList, Create, Get, Update, Delete/api/v1/billing/profiles
Customer overridesList, Upsert, Get, Delete/api/v1/billing/profiles/{id}/customer-overrides
InvoicesList, Get, Update, Delete, Simulate/api/v1/billing/invoices
Invoice actionsAdvance, Approve, Retry, Void, Snapshot, Recalculate taxPOST on /api/v1/billing/invoices/{id}/{action}
Pending linesCreate, Invoice/api/v1/billing/customers/{id}/invoices/pending-lines

Invoice lifecycle: gathering → draft → issuing → issued → (paid | void | uncollectible)


8. Notifications

See references/notifications.md for channels, rules, and event details.

ResourceOperationsBase Path
ChannelsList, Create, Get, Update, Delete/api/v1/notification/channels
RulesList, Create, Get, Update, Delete, Test/api/v1/notification/rules
EventsList, Get, Resend/api/v1/notification/events

Note: Channel creation via API is Cloud-only (Svix-backed). Self-hosted uses YAML config.


9. Apps

OperationMethodPath
List appsGET/api/v1/apps
Get appGET/api/v1/apps/{id}
Update appPUT/api/v1/apps/{id}
UninstallDELETE/api/v1/apps/{id}

App: Stripe

OperationMethodPath
Update Stripe keyPUT/api/v1/apps/{id}/stripe/api-key
Stripe webhookPOST/api/v1/apps/{id}/stripe/webhook
Checkout sessionPOST/api/v1/stripe/checkout/sessions

App: Custom Invoicing

OperationMethodPath
Draft syncedPOST/api/v1/apps/{id}/custom-invoicing/draft-synchronized
Issuing syncedPOST/api/v1/apps/{id}/custom-invoicing/issuing-synchronized
Update paymentPOST/api/v1/apps/{id}/custom-invoicing/update-payment-status

Marketplace

OperationMethodPath
List listingsGET/api/v1/marketplace/listings
Get listingGET/api/v1/marketplace/listings/{type}
Install (generic)POST/api/v1/marketplace/listings/{type}/install
Install (API key)POST/api/v1/marketplace/listings/{type}/install/apikey
Install (OAuth2 URL)GET/api/v1/marketplace/listings/{type}/install/oauth2
Install (OAuth2 auth)POST/api/v1/marketplace/listings/{type}/install/oauth2/authorize

10. Portal

OperationMethodPath
Create tokenPOST/api/v1/portal/tokens
List tokensGET/api/v1/portal/tokens
Invalidate tokensPOST/api/v1/portal/tokens/invalidate
Query meterGET/api/v1/portal/meters/{meterSlug}/query

11. Lookup Information

OperationMethodPath
List currenciesGET/api/v1/currencies
Get progressGET/api/v1/progress

12. Debug

OperationMethodPath
Get metricsGET/api/v1/debug/metrics

13. Subjects (Deprecated)

Use Customers with usageAttribution.subjectKeys instead.

OperationMethodPath
ListGET/api/v1/subjects
UpsertPOST/api/v1/subjects
GetGET/api/v1/subjects/{subjectIdOrKey}
DeleteDELETE/api/v1/subjects/{subjectIdOrKey}

Gotchas and Errors

SymptomCauseFix
409 on DELETE customerActive subscriptions or non-final invoicesCancel subs, void/delete invoices first
400 "single draft version"Duplicate plan draftSkip creation if plan key exists
400 "only Plans in [draft scheduled] can be published"Plan already activeExpected — skip publish
500 on POST /notification/channelsSelf-hosted: not implementedUse YAML config for local; API for Cloud only
405 on PATCH invoicePATCH not supportedUse POST subpaths: /advance, /approve, /void
Usage not attributedSubject mismatchEvent subject must match usageAttribution.subjectKeys
Plan not foundWrong key formatUse snake_case: pro, pro_plus
Event not meteredType mismatchEvent type must equal meter's eventType
Overage not billedTier formatupToAmount must be string; include both flatPrice and unitPrice
IDs look like 01G65Z...ULID formatStandard; regex: ^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$

Self-Hosted Troubleshooting: Railway/Kafka

Events Not Metering (0 Usage, Empty /api/v1/events)

Root Cause: Kafka has no persistent volume. Topics are lost on every Kafka restart.

Symptoms:

  • OpenMeter logs: kafka delivery failed: Broker: Unknown topic or partition
  • Sink worker logs: no topics found to be subscribed to or partitions=[]
  • ClickHouse has 0 tables
  • /api/v1/events returns []

Architecture:

Event → OpenMeter API → Kafka → Sink Worker → ClickHouse → Meters

If any link breaks, events don't meter.

Fix:

  1. Add Kafka volume at /var/lib/kafka/data

- Railway: Service → Settings → Volumes → Add - For Confluent images: Set RAILWAY_RUN_UID=0 for volume permissions

  1. Provision topics explicitly (if KAFKA_AUTO_CREATE_TOPICS_ENABLE=false): om_default_events (namespace events - sink worker consumes) om_sys.api_events om_sys.ingest_events
  2. Restart OpenMeter + sink-worker after Kafka restarts to refresh metadata
  3. Verify:

- Restart Kafka twice → topics persist - Send test event → appears in /api/v1/events

Kafka Environment Variables (Railway):

KAFKA_AUTO_CREATE_TOPICS_ENABLE=true  # Or provision topics explicitly
KAFKA_LOG_DIRS=/var/lib/kafka/data/logs-v2  # Use subdirectory if cluster ID conflicts
RAILWAY_RUN_UID=0  # Confluent images need root for volume permissions

Sink Worker Partition Instability

Symptom: Sink worker gets partition assignment, loses it within seconds.

Cause: Multiple sink-worker instances competing for single partition (Railway rolling deploys).

Fix: Ensure only 1 sink-worker instance runs. Check Kafka logs for "group... with N members" where N > 1.


References

First-Party Documentation

SDKs

Related Skills

Reference

The full OpenAPI 3.0 spec is bundled at assets/openapi-spec.json. Use it as the source of truth for request/response schemas, query parameters, and error codes.

平台分布

Codex

34.5%
按下载量换算33

Claude

30.03%
按下载量换算29

Cursor

18.52%
按下载量换算18

Gemini CLI

9.2%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills