Token导航 LogoToken导航

Agent Skill · 研究检索

api-monetization(API monetization 搜索)

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

api-monetization 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 37,066。

总安装 1,811周安装 77GitHub Stars 134下载 634核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/absolutelyskilled/absolutelyskilled --skill api-monetization

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

设计 API 使用计费模型与用量计量基础设施。涵盖开发者分级定价、配额管理和 Stripe 账单对接。提供完整的收入转化全流程技术实现路径。

安装方式:通过 GitHub 仓库添加,命令为 npx skills add https://github.com/absolutelyskilled/absolutelyskilled --skill api-monetization。适用宿主包括 Codex、Claude、Cursor 和 Gemini CLI。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

api-monetization 怎么安装?

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

api-monetization 支持哪些 AI 工具?

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

api-monetization 需要什么权限?

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

api-monetization 是免费的吗?

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

api-monetization 用的人多吗?

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

api-monetization 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

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

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
api-monetization

API monetization 搜索 · 本页

1,811134接触敏感数据未明确有提醒

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

SKILL.md 原文

When this skill is activated, always start your first response with the 🧢 emoji.

API Monetization

API monetization is the practice of turning API usage into a revenue stream through pricing models, metering, and billing infrastructure. It spans from defining developer tiers and rate limits to integrating with payment providers like Stripe for usage-based billing. This skill covers the full stack: pricing model design, quota enforcement, metered usage tracking, and Stripe integration for automated invoicing.


When to use this skill

Trigger this skill when the user:

  • Wants to design a pricing model for a public or partner API
  • Needs to implement usage-based or metered billing for API calls
  • Asks about rate limiting strategies tied to paid tiers
  • Wants to integrate Stripe metering or usage records into an API
  • Needs to build a developer tier system (free, pro, enterprise)
  • Asks about tracking API consumption per customer
  • Wants to handle overage billing or throttling for quota breaches
  • Needs to design a developer portal with tiered access

Do NOT trigger this skill for:

  • General Stripe payments unrelated to API billing (use a Stripe skill)
  • API gateway configuration without a monetization component

Key principles

  1. Meter before you bill - Never charge for usage you cannot accurately measure. Instrument every billable endpoint with reliable counters before enabling paid tiers. Lost meter events mean lost revenue or customer disputes.
  2. Tiers define the product, not just the price - Each developer tier should differ in meaningful capabilities (rate limits, endpoints available, SLA, support level), not just volume. This prevents a race-to-the-bottom on price.
  3. Rate limits are a feature, not just protection - Rate limits serve dual duty: they protect infrastructure AND enforce tier boundaries. Design them as a first-class part of the product, with clear headers and upgrade paths.
  4. Idempotent usage reporting - Usage records must be idempotent. Network retries, duplicate webhook deliveries, and reprocessed queues should never double-count usage. Use idempotency keys on every usage report call.
  5. Graceful degradation over hard cutoffs - When a customer hits a quota, prefer throttling or overage billing over immediately blocking access. Hard cutoffs break production systems and destroy trust.

Core concepts

Pricing models fall into three categories: flat-rate (fixed monthly fee per tier), usage-based (pay per API call or resource unit), and hybrid (base fee plus usage overage). Most successful API businesses use hybrid pricing because it provides revenue predictability while rewarding growth.

Metering is the infrastructure that counts billable events. A meter sits between the API gateway and the billing system. It must be durable (no lost events), idempotent (no double-counts), and near-real-time (customers see current usage). Common implementations use a message queue (Kafka, SQS) feeding an aggregation service that reports to Stripe.

Developer tiers are named bundles of quotas, rate limits, and feature flags. A typical structure is Free (heavily rate-limited, basic endpoints), Pro (higher limits, all endpoints, email support), and Enterprise (custom limits, SLA, dedicated support). Each tier maps to a Stripe Price with optional metered components.

Rate limiting enforces tier boundaries at the API gateway level. The standard approach is token bucket or sliding window per API key, returning 429 Too Many Requests with Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers.

Stripe metering connects API usage to invoices. The flow is: create a metered Price on a Product, subscribe customers, then report usage via stripe.subscriptionItems.createUsageRecord(). Stripe aggregates usage and generates invoices at the billing cycle end.


Common tasks

Design a tier structure

Define tiers based on target customer segments. Each tier needs: a name, monthly base price, included API calls, rate limit (requests/minute), overage rate, and available endpoints.

tiers:
  free:
    price: 0
    included_calls: 1000/month
    rate_limit: 10/min
    endpoints: [/v1/basic/*]
    support: community
  pro:
    price: 49/month
    included_calls: 50000/month
    rate_limit: 100/min
    endpoints: [/v1/*]
    support: email
    overage: $0.002/call
  enterprise:
    price: custom
    included_calls: custom
    rate_limit: custom
    endpoints: [/v1/*, /v1/admin/*]
    support: dedicated
    sla: 99.9%

Set up Stripe metered billing

Create a Product and a metered Price, then subscribe a customer.

const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);

// 1. Create product
const product = await stripe.products.create({
  name: 'API Access - Pro Tier',
});

// 2. Create metered price (per-unit usage)
const meteredPrice = await stripe.prices.create({
  product: product.id,
  currency: 'usd',
  recurring: {
    interval: 'month',
    usage_type: 'metered',
    aggregate_usage: 'sum',
  },
  unit_amount: 0.2, // $0.002 per call (in cents: 0.2)
  billing_scheme: 'per_unit',
});

// 3. Create base price for the tier
const basePrice = await stripe.prices.create({
  product: product.id,
  currency: 'usd',
  recurring: { interval: 'month' },
  unit_amount: 4900, // $49.00
});

// 4. Subscribe the customer to both prices
const subscription = await stripe.subscriptions.create({
  customer: 'cus_xxx',
  items: [
    { price: basePrice.id },
    { price: meteredPrice.id },
  ],
});

Report usage to Stripe

Report API call counts to Stripe periodically (hourly or daily). Always use action: 'increment' for safe idempotent reporting.

// Find the metered subscription item
const subscription = await stripe.subscriptions.retrieve('sub_xxx');
const meteredItem = subscription.items.data.find(
  (item) => item.price.recurring.usage_type === 'metered'
);

// Report usage - increment by the count since last report
await stripe.subscriptionItems.createUsageRecord(meteredItem.id, {
  quantity: 1250, // API calls in this reporting period
  timestamp: Math.floor(Date.now() / 1000),
  action: 'increment',
});
Always use action: 'increment' rather than action: 'set'. With 'set', a retry after a network failure would silently overwrite the correct total.

Implement rate limiting middleware

Express middleware that enforces per-tier rate limits using a sliding window with Redis.

const Redis = require('ioredis');
const redis = new Redis(process.env.REDIS_URL);

const TIER_LIMITS = {
  free: { rpm: 10, window: 60 },
  pro: { rpm: 100, window: 60 },
  enterprise: { rpm: 1000, window: 60 },
};

async function rateLimiter(req, res, next) {
  const apiKey = req.headers['x-api-key'];
  const tier = await getTierForApiKey(apiKey); // your lookup
  const limit = TIER_LIMITS[tier];
  const key = `ratelimit:${apiKey}`;
  const now = Date.now();

  // Sliding window using sorted set
  await redis.zremrangebyscore(key, 0, now - limit.window * 1000);
  const count = await redis.zcard(key);

  if (count >= limit.rpm) {
    res.set('Retry-After', String(limit.window));
    res.set('X-RateLimit-Limit', String(limit.rpm));
    res.set('X-RateLimit-Remaining', '0');
    return res.status(429).json({ error: 'Rate limit exceeded' });
  }

  await redis.zadd(key, now, `${now}-${Math.random()}`);
  await redis.expire(key, limit.window);

  res.set('X-RateLimit-Limit', String(limit.rpm));
  res.set('X-RateLimit-Remaining', String(limit.rpm - count - 1));
  next();
}

Track usage for billing

Middleware that counts API calls per customer and flushes to Stripe on a schedule.

const usageBuffer = new Map(); // apiKey -> count

function usageTracker(req, res, next) {
  const apiKey = req.headers['x-api-key'];
  usageBuffer.set(apiKey, (usageBuffer.get(apiKey) || 0) + 1);
  next();
}

// Flush every hour
setInterval(async () => {
  for (const [apiKey, count] of usageBuffer.entries()) {
    const subItemId = await getMeteredSubItemForKey(apiKey);
    if (subItemId && count > 0) {
      await stripe.subscriptionItems.createUsageRecord(subItemId, {
        quantity: count,
        timestamp: Math.floor(Date.now() / 1000),
        action: 'increment',
      });
    }
  }
  usageBuffer.clear();
}, 60 * 60 * 1000);
In production, use a durable queue (SQS, Kafka) instead of an in-memory buffer to avoid losing usage data on process restarts.

Handle overage notifications

Notify customers when they approach or exceed their included quota.

async function checkUsageThresholds(customerId, currentUsage, includedCalls) {
  const percentage = (currentUsage / includedCalls) * 100;
  const thresholds = [80, 100, 120];

  for (const threshold of thresholds) {
    if (percentage >= threshold) {
      const alreadyNotified = await hasNotifiedThreshold(customerId, threshold);
      if (!alreadyNotified) {
        await sendUsageAlert(customerId, {
          currentUsage,
          includedCalls,
          percentage,
          threshold,
          message: threshold >= 100
            ? `You have exceeded your included ${includedCalls} API calls. Overage billing is active.`
            : `You have used ${percentage.toFixed(0)}% of your included API calls.`,
        });
        await markThresholdNotified(customerId, threshold);
      }
    }
  }
}

Anti-patterns / common mistakes

MistakeWhy it's wrongWhat to do instead
Billing on gateway logs aloneGateway logs can be incomplete or delayed; disputes become unresolvableUse a dedicated metering service with durable event ingestion
Hard-cutting access at quotaBreaks customer production systems, causes churnThrottle or enable overage billing with clear notifications
Using action: 'set' in Stripe usage recordsRetries overwrite the correct total, causing under-billingAlways use action: 'increment' for idempotent reporting
Same rate limit for all endpointsExpensive endpoints (ML inference) subsidized by cheap ones (health check)Weight rate limits by endpoint cost or use separate quotas
No rate limit headers in 429 responsesClients cannot implement proper backoffAlways return Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining
Reporting usage in real-time per requestCreates enormous Stripe API load, risks rate limiting from Stripe itselfBatch usage reports hourly or daily

Gotchas

  1. In-memory usage buffers are lost on process restart - Buffering usage counts in a Map or similar in-process store means any crash or deploy loses that billing period's data. Use a durable queue (SQS, Redis with AOF, Kafka) as the write-ahead log before aggregating and reporting to Stripe.
  2. action: 'set' on retried Stripe usage reports silently under-bills - If a usage record POST fails and you retry with action: 'set', the retry sets the total to the retry value, discarding any usage already recorded in the current billing period. Always use action: 'increment' so retries are safe.
  3. Redis sorted set race condition in sliding window rate limiter - The ZREMRANGEBYSCORE + ZCARD + ZADD sequence is not atomic. Under high concurrency, two requests can both pass the check before either adds their entry, allowing a brief burst over the limit. Use a Lua script or MULTI/EXEC transaction to make the check-and-increment atomic.
  4. Free tier users who never convert still cost infrastructure - A free tier with no rate limits or usage caps can be abused as free compute. Define hard rate limits even on the free tier, and implement API key rotation or abuse detection before going public.
  5. Stripe metered price aggregate_usage cannot be changed after creation - If you create a metered price with aggregate_usage: 'sum' and later want 'max', you must create a new price and migrate subscribers. Plan the aggregation model before creating prices in production.

References

For detailed content on specific sub-domains, read the relevant file from the references/ folder:

  • references/stripe-metering.md - Deep dive into Stripe metered billing setup, tiered pricing, and invoice lifecycle
  • references/rate-limiting-patterns.md - Advanced rate limiting algorithms, Redis implementations, and distributed rate limiting

Only load a references file if the current task requires it - they are long and will consume context.


Companion check

On first activation of this skill in a conversation: check which companion skills are installed by running ls ~/.claude/skills/ ~/.agent/skills/ ~/.agents/skills/.claude/skills/.agent/skills/.agents/skills/ 2>/dev/null. Compare the results against the recommended_skills field in this file's frontmatter. For any that are missing, mention them once and offer to install: `` npx skills add AbsolutelySkilled/AbsolutelySkilled --skill <name> ` Skip entirely if recommended_skills` is empty or all companions are already installed.

平台分布

Codex

36.5%
按下载量换算231

Claude

30.42%
按下载量换算193

Cursor

19.87%
按下载量换算126

Gemini CLI

8.83%
按下载量换算56

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

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

安装前确认

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

继续浏览同类 Skills