@commet/node 8.0.1 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.d.mts +514 -206
- package/dist/index.d.ts +514 -206
- package/dist/index.js +202 -88
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +202 -88
- package/dist/index.mjs.map +1 -1
- package/docs/README.md +20 -0
- package/docs/ai-onboarding/ai-onboarding.md +90 -0
- package/docs/ai-onboarding/billing-best-practices-skill.md +29 -0
- package/docs/ai-onboarding/commet-skill.md +58 -0
- package/docs/ai-onboarding/mcp-server.md +207 -0
- package/docs/ai-onboarding/meta.json +17 -0
- package/docs/ai-onboarding/pricing-models-skill.md +29 -0
- package/docs/ai-onboarding/subscription-patterns-skill.md +29 -0
- package/docs/api-reference/addons.md +127 -0
- package/docs/api-reference/api-keys.md +57 -0
- package/docs/api-reference/credit-packs.md +80 -0
- package/docs/api-reference/customers.md +274 -0
- package/docs/api-reference/feature-access.md +36 -0
- package/docs/api-reference/features.md +94 -0
- package/docs/api-reference/generated-webhooks.md +120 -0
- package/docs/api-reference/index.md +31 -0
- package/docs/api-reference/invoices.md +123 -0
- package/docs/api-reference/markets.md +92 -0
- package/docs/api-reference/meta.json +7 -0
- package/docs/api-reference/offers.md +104 -0
- package/docs/api-reference/payments.md +106 -0
- package/docs/api-reference/payouts.md +66 -0
- package/docs/api-reference/plan-groups.md +157 -0
- package/docs/api-reference/plans.md +358 -0
- package/docs/api-reference/portal.md +30 -0
- package/docs/api-reference/promo-codes.md +86 -0
- package/docs/api-reference/provisioning.md +19 -0
- package/docs/api-reference/quota.md +120 -0
- package/docs/api-reference/seats.md +123 -0
- package/docs/api-reference/subscriptions.md +387 -0
- package/docs/api-reference/test-clock.md +59 -0
- package/docs/api-reference/transactions.md +78 -0
- package/docs/api-reference/usage.md +83 -0
- package/docs/documentation/api-versioning.md +100 -0
- package/docs/documentation/better-auth.md +361 -0
- package/docs/documentation/choose-a-billing-model.md +38 -0
- package/docs/documentation/cli.md +1024 -0
- package/docs/documentation/create-api-key.md +47 -0
- package/docs/documentation/customers/customer-credits.md +48 -0
- package/docs/documentation/customers/customer-portal.md +107 -0
- package/docs/documentation/customers/manage-customers.md +346 -0
- package/docs/documentation/customers/meta.json +5 -0
- package/docs/documentation/error-handling.md +239 -0
- package/docs/documentation/examples.md +37 -0
- package/docs/documentation/finance/acceptable-use.md +145 -0
- package/docs/documentation/finance/finance-overview.md +32 -0
- package/docs/documentation/finance/local-currency-taxes.md +40 -0
- package/docs/documentation/finance/merchant-of-record.md +48 -0
- package/docs/documentation/finance/meta.json +13 -0
- package/docs/documentation/finance/payouts-verification.md +186 -0
- package/docs/documentation/finance/payouts.md +41 -0
- package/docs/documentation/finance/supported-countries.md +28 -0
- package/docs/documentation/go/integrate-with-encore.md +229 -0
- package/docs/documentation/go/integrate-with-go.md +258 -0
- package/docs/documentation/go/meta.json +5 -0
- package/docs/documentation/introduction.md +58 -0
- package/docs/documentation/invoicing/handle-failed-payments.md +283 -0
- package/docs/documentation/invoicing/invoices-and-billing-cycles.md +73 -0
- package/docs/documentation/invoicing/manage-invoices.md +340 -0
- package/docs/documentation/invoicing/meta.json +9 -0
- package/docs/documentation/java/integrate-with-java.md +117 -0
- package/docs/documentation/java/meta.json +5 -0
- package/docs/documentation/meta.json +36 -0
- package/docs/documentation/nodejs/integrate-with-astro.md +129 -0
- package/docs/documentation/nodejs/integrate-with-bun.md +113 -0
- package/docs/documentation/nodejs/integrate-with-express.md +127 -0
- package/docs/documentation/nodejs/integrate-with-hono.md +141 -0
- package/docs/documentation/nodejs/integrate-with-nextjs.md +118 -0
- package/docs/documentation/nodejs/integrate-with-nuxt.md +125 -0
- package/docs/documentation/nodejs/integrate-with-remix.md +136 -0
- package/docs/documentation/nodejs/integrate-with-sveltekit.md +127 -0
- package/docs/documentation/nodejs/meta.json +14 -0
- package/docs/documentation/payments/accept-one-time-payments.md +314 -0
- package/docs/documentation/payments/meta.json +10 -0
- package/docs/documentation/payments/payment-orchestration.md +43 -0
- package/docs/documentation/payments/payment-providers.md +59 -0
- package/docs/documentation/payments/transactions-refunds-and-retries.md +199 -0
- package/docs/documentation/php/integrate-with-laravel.md +222 -0
- package/docs/documentation/php/integrate-with-php.md +103 -0
- package/docs/documentation/php/integrate-with-symfony.md +214 -0
- package/docs/documentation/php/meta.json +9 -0
- package/docs/documentation/plans/add-ons.md +257 -0
- package/docs/documentation/plans/balance-and-top-ups.md +169 -0
- package/docs/documentation/plans/configure-features.md +335 -0
- package/docs/documentation/plans/consumption-models.md +93 -0
- package/docs/documentation/plans/create-plans.md +162 -0
- package/docs/documentation/plans/credit-packs.md +89 -0
- package/docs/documentation/plans/meta.json +14 -0
- package/docs/documentation/plans/one-time-payments.md +142 -0
- package/docs/documentation/plans/plan-groups.md +31 -0
- package/docs/documentation/platform/custom-domains.md +27 -0
- package/docs/documentation/platform/dashboard-metrics-and-events.md +25 -0
- package/docs/documentation/platform/members-and-permissions.md +21 -0
- package/docs/documentation/platform/meta.json +10 -0
- package/docs/documentation/platform/organization-settings.md +29 -0
- package/docs/documentation/python/integrate-with-django.md +161 -0
- package/docs/documentation/python/integrate-with-fastapi.md +164 -0
- package/docs/documentation/python/integrate-with-flask.md +153 -0
- package/docs/documentation/python/integrate-with-python.md +90 -0
- package/docs/documentation/python/meta.json +10 -0
- package/docs/documentation/sales/card-promotions.md +41 -0
- package/docs/documentation/sales/introductory-offers.md +64 -0
- package/docs/documentation/sales/meta.json +13 -0
- package/docs/documentation/sales/offers.md +65 -0
- package/docs/documentation/sales/promo-codes.md +65 -0
- package/docs/documentation/sales/promotional-offers.md +58 -0
- package/docs/documentation/sales/regional-prices.md +100 -0
- package/docs/documentation/sales/trial-periods.md +88 -0
- package/docs/documentation/sdk-reference.md +68 -0
- package/docs/documentation/subscriptions/manage-subscriptions.md +505 -0
- package/docs/documentation/subscriptions/meta.json +9 -0
- package/docs/documentation/subscriptions/plan-grants.md +132 -0
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +35 -0
- package/docs/documentation/testing-sandbox.md +251 -0
- package/docs/documentation/usage/ai-token-billing.md +294 -0
- package/docs/documentation/usage/meta.json +10 -0
- package/docs/documentation/usage/quota-management.md +341 -0
- package/docs/documentation/usage/seat-management.md +377 -0
- package/docs/documentation/usage/track-usage.md +282 -0
- package/docs/errors/addon_already_active.md +22 -0
- package/docs/errors/addon_has_activations.md +22 -0
- package/docs/errors/addon_not_active.md +22 -0
- package/docs/errors/addon_not_found.md +22 -0
- package/docs/errors/already_has_active_subscription.md +22 -0
- package/docs/errors/already_scheduled.md +22 -0
- package/docs/errors/api_key_not_found.md +22 -0
- package/docs/errors/card_promotions_not_available.md +22 -0
- package/docs/errors/charge_failed.md +22 -0
- package/docs/errors/charge_in_progress.md +22 -0
- package/docs/errors/claim_not_pending.md +22 -0
- package/docs/errors/credit_pack_not_found.md +22 -0
- package/docs/errors/customer_not_found.md +22 -0
- package/docs/errors/duplicate.md +22 -0
- package/docs/errors/endpoint_deprecated.md +22 -0
- package/docs/errors/endpoint_not_available.md +22 -0
- package/docs/errors/feature_already_exists.md +22 -0
- package/docs/errors/feature_disabled.md +22 -0
- package/docs/errors/feature_in_use.md +22 -0
- package/docs/errors/feature_not_found.md +22 -0
- package/docs/errors/feature_not_in_plan.md +22 -0
- package/docs/errors/forbidden.md +22 -0
- package/docs/errors/free_plan_change_not_supported.md +22 -0
- package/docs/errors/idempotency_in_progress.md +22 -0
- package/docs/errors/idempotency_key_mismatch.md +22 -0
- package/docs/errors/idempotency_unavailable.md +22 -0
- package/docs/errors/included_limit_reached.md +22 -0
- package/docs/errors/index.md +89 -0
- package/docs/errors/insufficient_balance.md +22 -0
- package/docs/errors/insufficient_credits.md +22 -0
- package/docs/errors/insufficient_seats.md +22 -0
- package/docs/errors/internal_error.md +22 -0
- package/docs/errors/invalid_json.md +22 -0
- package/docs/errors/invalid_subscription_status.md +22 -0
- package/docs/errors/invoice_not_found.md +22 -0
- package/docs/errors/market_group_in_use.md +22 -0
- package/docs/errors/market_group_not_found.md +22 -0
- package/docs/errors/market_in_use.md +22 -0
- package/docs/errors/market_not_found.md +22 -0
- package/docs/errors/missing_regional_price.md +22 -0
- package/docs/errors/model_not_found.md +22 -0
- package/docs/errors/no_active_subscription.md +22 -0
- package/docs/errors/no_change_requested.md +22 -0
- package/docs/errors/no_outstanding_invoice.md +22 -0
- package/docs/errors/no_payment_method.md +22 -0
- package/docs/errors/no_prices_configured.md +22 -0
- package/docs/errors/not_found.md +22 -0
- package/docs/errors/not_scheduled_for_cancellation.md +22 -0
- package/docs/errors/offer_not_applicable.md +22 -0
- package/docs/errors/offer_not_found.md +22 -0
- package/docs/errors/one_time_subscription_not_cancelable.md +22 -0
- package/docs/errors/organization_already_claimed.md +22 -0
- package/docs/errors/payment_failed.md +22 -0
- package/docs/errors/payment_method_not_found.md +22 -0
- package/docs/errors/payment_not_cancelable.md +22 -0
- package/docs/errors/payment_not_found.md +22 -0
- package/docs/errors/payouts_not_available_in_sandbox.md +22 -0
- package/docs/errors/plan_change_scheduled.md +22 -0
- package/docs/errors/plan_group_not_found.md +22 -0
- package/docs/errors/plan_not_found.md +22 -0
- package/docs/errors/plan_unavailable.md +22 -0
- package/docs/errors/plans_not_in_same_group.md +22 -0
- package/docs/errors/price_in_use.md +22 -0
- package/docs/errors/price_not_found.md +22 -0
- package/docs/errors/pricing_mode_mismatch.md +22 -0
- package/docs/errors/promo_code_expired.md +22 -0
- package/docs/errors/promo_code_not_found.md +22 -0
- package/docs/errors/provider_unsupported.md +22 -0
- package/docs/errors/rate_limited.md +22 -0
- package/docs/errors/sandbox_only.md +22 -0
- package/docs/errors/seat_limit_exceeded.md +22 -0
- package/docs/errors/subscription_activation_failed.md +22 -0
- package/docs/errors/subscription_already_canceled.md +22 -0
- package/docs/errors/subscription_cancel_failed.md +22 -0
- package/docs/errors/subscription_creation_failed.md +22 -0
- package/docs/errors/subscription_has_open_dispute.md +22 -0
- package/docs/errors/subscription_not_active.md +22 -0
- package/docs/errors/subscription_not_found.md +22 -0
- package/docs/errors/subscription_required.md +22 -0
- package/docs/errors/subscription_uncancel_failed.md +22 -0
- package/docs/errors/transaction_not_found.md +22 -0
- package/docs/errors/unauthorized.md +22 -0
- package/docs/errors/validation_error.md +22 -0
- package/docs/errors/webhook_not_found.md +22 -0
- package/docs/errors.md +34 -0
- package/docs/getting-started.md +35 -0
- package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +22 -0
- package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +20 -0
- package/docs/knowledge-base/how-do-discounts-work.md +65 -0
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +88 -0
- package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +77 -0
- package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +20 -0
- package/docs/knowledge-base/how-do-trial-periods-work.md +54 -0
- package/docs/knowledge-base/how-does-billing-work.md +73 -0
- package/docs/knowledge-base/how-does-payment-routing-work.md +17 -0
- package/docs/knowledge-base/how-does-quota-based-billing-work.md +106 -0
- package/docs/knowledge-base/how-does-seat-based-billing-work.md +88 -0
- package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +89 -0
- package/docs/knowledge-base/meta.json +29 -0
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +110 -0
- package/docs/knowledge-base/what-happens-when-a-payment-fails.md +40 -0
- package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +74 -0
- package/docs/knowledge-base/what-happens-when-you-refund-or-retry-a-transaction.md +21 -0
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +101 -0
- package/docs/manifest.json +1677 -0
- package/docs/meta.json +11 -0
- package/docs/platform-documentation.md +175 -0
- package/docs/schemas.md +995 -0
- package/docs/webhooks/addon-activated.md +44 -0
- package/docs/webhooks/addon-deactivated.md +40 -0
- package/docs/webhooks/balance-depleted.md +37 -0
- package/docs/webhooks/balance-low.md +39 -0
- package/docs/webhooks/balance-topped-up.md +41 -0
- package/docs/webhooks/checkout-ready.md +43 -0
- package/docs/webhooks/credits-depleted.md +35 -0
- package/docs/webhooks/credits-expired.md +35 -0
- package/docs/webhooks/credits-granted.md +37 -0
- package/docs/webhooks/credits-low.md +39 -0
- package/docs/webhooks/credits-purchased.md +41 -0
- package/docs/webhooks/customer-created.md +49 -0
- package/docs/webhooks/customer-state-changed.md +134 -0
- package/docs/webhooks/customer-updated.md +49 -0
- package/docs/webhooks/introduction.md +499 -0
- package/docs/webhooks/invoice-created.md +45 -0
- package/docs/webhooks/invoice-overdue.md +53 -0
- package/docs/webhooks/invoice-upcoming.md +43 -0
- package/docs/webhooks/invoice-voided.md +53 -0
- package/docs/webhooks/meta.json +78 -0
- package/docs/webhooks/payment-dispute-resolved.md +52 -0
- package/docs/webhooks/payment-disputed.md +49 -0
- package/docs/webhooks/payment-failed.md +37 -0
- package/docs/webhooks/payment-link-canceled.md +41 -0
- package/docs/webhooks/payment-link-completed.md +47 -0
- package/docs/webhooks/payment-link-created.md +41 -0
- package/docs/webhooks/payment-link-failed.md +45 -0
- package/docs/webhooks/payment-method-attached.md +40 -0
- package/docs/webhooks/payment-method-updated.md +38 -0
- package/docs/webhooks/payment-received.md +45 -0
- package/docs/webhooks/payment-recovered.md +39 -0
- package/docs/webhooks/payment-refunded.md +47 -0
- package/docs/webhooks/payment-retry-failed.md +39 -0
- package/docs/webhooks/payout-available.md +33 -0
- package/docs/webhooks/payout-created.md +48 -0
- package/docs/webhooks/payout-failed.md +52 -0
- package/docs/webhooks/payout-paid.md +48 -0
- package/docs/webhooks/quota-exceeded.md +44 -0
- package/docs/webhooks/quota-threshold-reached.md +41 -0
- package/docs/webhooks/seats-limit-reached.md +39 -0
- package/docs/webhooks/seats-updated.md +39 -0
- package/docs/webhooks/subscription-activated.md +43 -0
- package/docs/webhooks/subscription-canceled.md +57 -0
- package/docs/webhooks/subscription-cancellation-revoked.md +37 -0
- package/docs/webhooks/subscription-cancellation-scheduled.md +45 -0
- package/docs/webhooks/subscription-created.md +35 -0
- package/docs/webhooks/subscription-past-due.md +43 -0
- package/docs/webhooks/subscription-plan-change-revoked.md +50 -0
- package/docs/webhooks/subscription-plan-change-scheduled.md +55 -0
- package/docs/webhooks/subscription-plan-changed.md +43 -0
- package/docs/webhooks/subscription-reactivated.md +53 -0
- package/docs/webhooks/subscription-updated.md +39 -0
- package/docs/webhooks/trial-checkout-ready.md +39 -0
- package/docs/webhooks/trial-converted.md +39 -0
- package/docs/webhooks/trial-expired.md +39 -0
- package/docs/webhooks/trial-started.md +46 -0
- package/docs/webhooks/trial-will-end.md +41 -0
- package/docs/webhooks/usage-recorded.md +41 -0
- package/docs/webhooks.md +782 -0
- package/package.json +2 -1
package/docs/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Commet Node SDK
|
|
2
|
+
|
|
3
|
+
This documentation is installed with `@commet/node` and matches the API contract used by this package.
|
|
4
|
+
|
|
5
|
+
Start here:
|
|
6
|
+
|
|
7
|
+
- [Getting started](./getting-started.md)
|
|
8
|
+
- [Errors and request IDs](./errors.md)
|
|
9
|
+
- [Complete documentation](./platform-documentation.md)
|
|
10
|
+
- [Generated API reference](./api-reference/index.md)
|
|
11
|
+
- [Generated webhook reference](./webhooks.md)
|
|
12
|
+
- [Machine-readable manifest](./manifest.json)
|
|
13
|
+
|
|
14
|
+
Integration-specific behavior remains documented by the installed integration package:
|
|
15
|
+
|
|
16
|
+
- `node_modules/@commet/next/README.md`
|
|
17
|
+
- `node_modules/@commet/ai-sdk/README.md`
|
|
18
|
+
- `node_modules/@commet/better-auth/README.md`
|
|
19
|
+
|
|
20
|
+
Use `commet doctor --output agent` to validate the installed package versions and documentation without changing the project or contacting Commet.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
lastModified: 2026-08-16
|
|
3
|
+
title: AI Onboarding
|
|
4
|
+
description: Give an AI agent the product knowledge, tools, environment, and safety boundaries it needs to implement Commet.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
An agent needs two kinds of context to work with Commet: curated knowledge that explains billing behavior, and versioned contracts that define exact operations. Give it both instead of asking it to infer business rules from API schemas.
|
|
8
|
+
|
|
9
|
+
## Choose how the organization is created
|
|
10
|
+
|
|
11
|
+
### Human-first
|
|
12
|
+
|
|
13
|
+
Create an account at [commet.co](https://commet.co), open the sandbox organization, and create an API key under **Settings → API Keys**. Use OAuth when the agent's MCP client can open a browser; use the sandbox API key for headless clients.
|
|
14
|
+
|
|
15
|
+
### Agent-first
|
|
16
|
+
|
|
17
|
+
A headless agent can provision paired live and sandbox organizations before a human signs in:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
curl -X POST https://commet.co/api/v1/provision \
|
|
21
|
+
-H "Content-Type: application/json" \
|
|
22
|
+
-H "Idempotency-Key: 3f5ebf70-8afd-4fc0-ae6e-6eaf0f647c91" \
|
|
23
|
+
-d '{"name":"Acme","country":"US","businessType":"company"}'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The response contains one live key, one sandbox key, and a claim URL. Store the keys immediately, use sandbox for implementation, and give the claim URL to the human owner. Repeating the same UUID and body returns the same result; reusing it with another body fails.
|
|
27
|
+
|
|
28
|
+
## Connect the MCP server
|
|
29
|
+
|
|
30
|
+
Use the hosted endpoint:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"commet": {
|
|
36
|
+
"url": "https://commet.co/mcp/v2"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
OAuth fixes an interactive connection to the organization selected in the browser. An `x-api-key` connection is fixed to the key's organization. Always confirm whether that organization is sandbox or live before a write.
|
|
43
|
+
|
|
44
|
+
MCP v2 generates one `api_*` tool per current OpenAPI operation and also exposes documentation search. See [MCP Server](/docs/mcp-server) for client-specific configuration.
|
|
45
|
+
|
|
46
|
+
## Give the agent the right documentation
|
|
47
|
+
|
|
48
|
+
Use the smallest source that answers the task:
|
|
49
|
+
|
|
50
|
+
1. `node_modules/@commet/node/docs/README.md` for the API that matches the installed SDK version.
|
|
51
|
+
2. [Documentation index](https://commet.co/docs/llms.txt) to discover the right curated concept or business rule.
|
|
52
|
+
3. Append `.md` to a page URL for focused Markdown, such as `https://commet.co/docs/how-does-billing-work.md`.
|
|
53
|
+
4. [Full documentation](https://commet.co/docs/llms-full.txt) only when the task genuinely needs the complete curated corpus.
|
|
54
|
+
5. [OpenAPI](https://commet.co/openapi.json) and generated API Reference for the exact current platform contract.
|
|
55
|
+
|
|
56
|
+
Installed SDK docs are version-matched. The curated Documentation explains how dashboard and API work together. The Knowledge Base defines business rules. API Reference and Webhooks define the current generated contracts.
|
|
57
|
+
|
|
58
|
+
Prepare an existing repository with a managed, reversible block in `AGENTS.md`:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
commet agents setup
|
|
62
|
+
commet agents setup --check --output agent
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then validate the local integration without changing files, contacting Commet, or printing secret values:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
commet doctor --output agent
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`@commet/next`, `@commet/ai-sdk`, and `@commet/better-auth` keep their integration-specific guidance in their package READMEs and share the Node SDK contract above.
|
|
72
|
+
|
|
73
|
+
## Install billing skills
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npx skills add commet-labs/skills
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Skills provide task-specific instructions for SDK integration, billing behavior, webhooks, CLI workflows, and AI billing. Universal pricing and subscription knowledge is available from the standalone packages listed in [Commet Skills](/docs/commet-skill).
|
|
80
|
+
|
|
81
|
+
## Use a safe implementation loop
|
|
82
|
+
|
|
83
|
+
1. Ask the agent to identify the billing model and the customer-visible outcome.
|
|
84
|
+
2. Configure or inspect the catalog in sandbox.
|
|
85
|
+
3. Implement one canonical flow with stable customer IDs and idempotency keys.
|
|
86
|
+
4. Confirm asynchronous outcomes from signed webhooks, not redirects.
|
|
87
|
+
5. Advance the Test Clock and verify renewal, failure, and recovery.
|
|
88
|
+
6. Review every intended live mutation before changing credentials.
|
|
89
|
+
|
|
90
|
+
Start with [Choose a Billing Model](/docs/choose-a-billing-model) and the runnable [Examples](/docs/examples).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
lastModified: 2026-07-31
|
|
3
|
+
title: Billing Best Practices Skill
|
|
4
|
+
description: Comprehensive guide for building production-ready billing systems with AI agents.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The Billing Best Practices skill provides AI agents with comprehensive knowledge for building production-ready billing integrations. It covers subscription lifecycle, failed payments, proration, multi-currency, tax compliance, and invoicing.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Install the skill using the following command:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx skills add commet-labs/billing-best-practices
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Advantages
|
|
18
|
+
|
|
19
|
+
- **Subscription lifecycle management**: Patterns for handling every state transition from trial to cancellation.
|
|
20
|
+
- **Failed payment recovery**: Dunning flows, retry schedules, grace periods, and involuntary churn prevention.
|
|
21
|
+
- **Proration logic**: How mid-cycle upgrades, downgrades, and plan changes affect invoicing.
|
|
22
|
+
- **Multi-currency support**: Currency Pricing, request-country Markets, zero-decimal currencies.
|
|
23
|
+
- **Tax compliance**: Merchant of Record model, automatic tax calculation, when you need MoR vs DIY.
|
|
24
|
+
- **Pre-launch checklist**: Step-by-step verification before going live with billing.
|
|
25
|
+
|
|
26
|
+
## Learn More
|
|
27
|
+
|
|
28
|
+
- [**View on GitHub**](https://github.com/commet-labs/billing-best-practices)
|
|
29
|
+
- [**View on skills.sh**](https://skills.sh/commet-labs/billing-best-practices)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
lastModified: 2026-07-31
|
|
3
|
+
title: Commet Skills
|
|
4
|
+
description: Give AI agents expert-level billing knowledge with Agent Skills.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Agent Skills give AI agents modular billing capabilities — SDK integration, pricing models, subscription patterns, and billing best practices. Install all skills with a single command.
|
|
8
|
+
|
|
9
|
+
## Install all skills
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx skills add commet-labs/skills
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Install a single skill
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx skills add commet-labs/skills --skill commet
|
|
19
|
+
npx skills add commet-labs/skills --skill ai-billing
|
|
20
|
+
npx skills add commet-labs/skills --skill billing-behaviors
|
|
21
|
+
npx skills add commet-labs/skills --skill commet-webhooks
|
|
22
|
+
npx skills add commet-labs/skills --skill commet-cli
|
|
23
|
+
npx skills add commet-labs/skills --skill migrate-commet-v7-to-v8
|
|
24
|
+
npx skills add commet-labs/skills --skill migrate-commet-v8-to-v9
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Available skills
|
|
28
|
+
|
|
29
|
+
| Skill | Description |
|
|
30
|
+
| ------------------------- | ----------------------------------------------------------------------------------------- |
|
|
31
|
+
| `commet` | Core SDK — @commet/node, @commet/next, @commet/ai-sdk, @commet/better-auth |
|
|
32
|
+
| `billing-behaviors` | Business rules — proration, plan changes, subscription lifecycle |
|
|
33
|
+
| `commet-cli` | CLI — config-as-code: pull and push `commet.config.ts` with `commet pull` / `commet push` |
|
|
34
|
+
| `commet-webhooks` | Webhooks — event handling, signature verification, framework handlers |
|
|
35
|
+
| `ai-billing` | AI billing — tracked() middleware, balance model, cost calculation |
|
|
36
|
+
| `migrate-commet-v7-to-v8` | Migration — upgrade SDK v7 and API `2026-07-11` integrations to v8 and `2026-07-24` |
|
|
37
|
+
| `migrate-commet-v8-to-v9` | Migration — upgrade v8 Offers and Markets to SDK v9 and API `2026-07-31` |
|
|
38
|
+
|
|
39
|
+
## Standalone skills
|
|
40
|
+
|
|
41
|
+
Universal billing knowledge that works with any stack. Code examples use `@commet/node`.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx skills add commet-labs/billing-best-practices
|
|
45
|
+
npx skills add commet-labs/pricing-models
|
|
46
|
+
npx skills add commet-labs/subscription-patterns
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Supported agents
|
|
50
|
+
|
|
51
|
+
Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot, Windsurf, OpenCode, and 40+ more.
|
|
52
|
+
|
|
53
|
+
## Learn More
|
|
54
|
+
|
|
55
|
+
- [**commet-labs/skills on skills.sh**](https://skills.sh/commet-labs/skills)
|
|
56
|
+
- [**billing-best-practices**](https://skills.sh/commet-labs/billing-best-practices)
|
|
57
|
+
- [**pricing-models**](https://skills.sh/commet-labs/pricing-models)
|
|
58
|
+
- [**subscription-patterns**](https://skills.sh/commet-labs/subscription-patterns)
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
---
|
|
2
|
+
lastModified: 2026-07-31
|
|
3
|
+
title: MCP Server
|
|
4
|
+
description: Use the MCP Server to manage billing infrastructure.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What is an MCP Server?
|
|
8
|
+
|
|
9
|
+
MCP is an open protocol that standardizes how applications provide context to LLMs. Among other benefits, it provides LLMs tools to act on your behalf.
|
|
10
|
+
|
|
11
|
+
## What can Commet's MCP Server do?
|
|
12
|
+
|
|
13
|
+
Commet's MCP server gives your AI agent native access to the full Commet platform through a single integration. You can manage all aspects of your billing infrastructure using natural language.
|
|
14
|
+
|
|
15
|
+
- **Organization** — See the live or sandbox organization fixed to the connection
|
|
16
|
+
- **Commet API** — Use every operation in the current public OpenAPI document
|
|
17
|
+
- **Docs** — Search the live Commet documentation
|
|
18
|
+
|
|
19
|
+
As an example, you could use this to create a full billing setup, manage plans and features, inspect customer subscriptions, or review invoices and usage data.
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
The MCP endpoint is the same for sandbox and live data:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
https://commet.co/mcp/v2
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
OAuth opens Commet in the browser and asks you to choose one organization for the connection. The connection stays fixed to that organization even if you later switch organizations in the dashboard; reconnect to choose another one. API key authentication uses the exact sandbox or live organization that created the key. OAuth currently exposes the same API tools to owners, admins, and members.
|
|
30
|
+
|
|
31
|
+
To use it, you'll need to:
|
|
32
|
+
|
|
33
|
+
- [Create a Commet account](https://commet.co)
|
|
34
|
+
- Have an MCP-compatible client (Cursor, Claude Code, Claude Desktop, etc.)
|
|
35
|
+
|
|
36
|
+
> **Note**
|
|
37
|
+
>
|
|
38
|
+
> Browser-based clients can use OAuth with no API key. If your client runs in CI, on a server, or anywhere browser login is not possible, pass a Commet API key in the `x-api-key` header.
|
|
39
|
+
|
|
40
|
+
> **Warning**
|
|
41
|
+
>
|
|
42
|
+
> Switch to a sandbox organization when experimenting or setting up billing for the first time. Operations on a live organization affect real customers immediately.
|
|
43
|
+
|
|
44
|
+
## How to use the MCP Server
|
|
45
|
+
|
|
46
|
+
Choose your preferred client below.
|
|
47
|
+
|
|
48
|
+
### cursor
|
|
49
|
+
|
|
50
|
+
Open the command palette and choose "Cursor Settings" > "MCP" > "Add new global MCP server".
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"commet": {
|
|
56
|
+
"url": "https://commet.co/mcp/v2"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### claude-code
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
claude mcp add --transport http commet https://commet.co/mcp/v2
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### claude-desktop
|
|
69
|
+
|
|
70
|
+
Open Claude Desktop settings > "Developer" tab > "Edit Config".
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"mcpServers": {
|
|
75
|
+
"commet": {
|
|
76
|
+
"url": "https://commet.co/mcp/v2"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### codex
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
codex mcp add commet --url https://commet.co/mcp/v2
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The command opens the browser for OAuth authentication. Once complete, verify with:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
codex mcp list
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### copilot
|
|
95
|
+
|
|
96
|
+
Add the following to your VS Code `settings.json`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcp": {
|
|
101
|
+
"servers": {
|
|
102
|
+
"commet": {
|
|
103
|
+
"type": "http",
|
|
104
|
+
"url": "https://commet.co/mcp/v2"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### gemini
|
|
112
|
+
|
|
113
|
+
Add the following to `~/.gemini/settings.json`:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"commet": {
|
|
119
|
+
"httpUrl": "https://commet.co/mcp/v2"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### opencode
|
|
126
|
+
|
|
127
|
+
Add the following to `opencode.json`:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"mcp": {
|
|
132
|
+
"commet": {
|
|
133
|
+
"type": "remote",
|
|
134
|
+
"url": "https://commet.co/mcp/v2"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### windsurf
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"mcpServers": {
|
|
145
|
+
"commet": {
|
|
146
|
+
"serverUrl": "https://commet.co/mcp/v2"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### API key authentication
|
|
153
|
+
|
|
154
|
+
For clients that cannot open browser login, add an `x-api-key` header:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
claude mcp add --transport http commet https://commet.co/mcp/v2 --header "x-api-key: ck_xxxxxxxxx"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
For JSON-based clients:
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"mcpServers": {
|
|
165
|
+
"commet": {
|
|
166
|
+
"url": "https://commet.co/mcp/v2",
|
|
167
|
+
"headers": {
|
|
168
|
+
"x-api-key": "ck_xxxxxxxxx"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
API-key sessions authenticate as the user who created the key and use the exact organization that created the key. A sandbox key can only act on its sandbox organization; a live key can only act on its live organization. Create the key from a sandbox organization when experimenting.
|
|
176
|
+
|
|
177
|
+
## Available Tools
|
|
178
|
+
|
|
179
|
+
MCP v2 exposes one generated tool for every operation in the current Commet OpenAPI document. The generated names use `api_` plus the operation ID in snake case:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
list-plans → api_list_plans
|
|
183
|
+
create-plan → api_create_plan
|
|
184
|
+
track-usage → api_track_usage
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Each generated tool groups its input the same way:
|
|
188
|
+
|
|
189
|
+
- `path` for URL parameters
|
|
190
|
+
- `query` for filters, cursors, and pagination
|
|
191
|
+
- `body` for the endpoint's exact OpenAPI request body
|
|
192
|
+
- `idempotencyKey` for optional POST, PUT, and PATCH idempotency
|
|
193
|
+
|
|
194
|
+
Generated tools always execute the latest API version published by Commet. They do not read or change an older API version pinned for the organization's SDKs.
|
|
195
|
+
|
|
196
|
+
The following Commet-specific tools remain available:
|
|
197
|
+
|
|
198
|
+
| Tool | Description |
|
|
199
|
+
| -------------------------- | ------------------------------------------------------ |
|
|
200
|
+
| `get_current_organization` | Get the organization used by API tools |
|
|
201
|
+
| `search_docs` | Search the live Commet documentation by semantic query |
|
|
202
|
+
|
|
203
|
+
The previous MCP endpoint remains available at `https://commet.co/mcp` with its original tools and behavior. New connections should use v2.
|
|
204
|
+
|
|
205
|
+
> **Warning**
|
|
206
|
+
>
|
|
207
|
+
> Before calling a write or delete tool, check `get_current_organization`. Operations on a live organization affect real customers and money immediately.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Build with AI",
|
|
3
|
+
"description": "Tools and resources for AI agents using Commet",
|
|
4
|
+
"icon": "Robot",
|
|
5
|
+
"root": true,
|
|
6
|
+
"pages": [
|
|
7
|
+
"---Getting Started---",
|
|
8
|
+
"ai-onboarding",
|
|
9
|
+
"---AI Tools---",
|
|
10
|
+
"mcp-server",
|
|
11
|
+
"---Agent Skills---",
|
|
12
|
+
"commet-skill",
|
|
13
|
+
"billing-best-practices-skill",
|
|
14
|
+
"pricing-models-skill",
|
|
15
|
+
"subscription-patterns-skill"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
lastModified: 2026-04-03
|
|
3
|
+
title: Pricing Models Skill
|
|
4
|
+
description: Choose and implement the right pricing model for your SaaS with AI agents.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The Pricing Models skill helps AI agents choose and implement the right pricing model for any SaaS product. It covers metered, credits, balance, seats, and boolean models with decision frameworks and implementation patterns.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Install the skill using the following command:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx skills add commet-labs/pricing-models
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Advantages
|
|
18
|
+
|
|
19
|
+
- **Decision framework**: Three-question flowchart to pick the right model for any product.
|
|
20
|
+
- **Metered billing**: Pay-per-use with included amounts and overage pricing.
|
|
21
|
+
- **Credits model**: Prepaid blocks that stop when exhausted — ideal for generation-based products.
|
|
22
|
+
- **Balance model**: Dollar-denominated prepaid spend — ideal for AI token billing.
|
|
23
|
+
- **Seat-based pricing**: Per-user billing with hybrid advance and true-up charging.
|
|
24
|
+
- **Hybrid patterns**: Combining models — base plan + metered, seats + usage, addons.
|
|
25
|
+
|
|
26
|
+
## Learn More
|
|
27
|
+
|
|
28
|
+
- [**View on GitHub**](https://github.com/commet-labs/pricing-models)
|
|
29
|
+
- [**View on skills.sh**](https://skills.sh/commet-labs/pricing-models)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
lastModified: 2026-04-03
|
|
3
|
+
title: Subscription Patterns Skill
|
|
4
|
+
description: Universal subscription billing patterns for trials, proration, dunning, and more.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The Subscription Patterns skill provides AI agents with universal patterns for the full subscription lifecycle. It covers trials, intro offers, upgrades, downgrades, proration, dunning, cancellation flows, and add-ons.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Install the skill using the following command:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx skills add commet-labs/subscription-patterns
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Advantages
|
|
18
|
+
|
|
19
|
+
- **Free trials and intro offers**: Trial setup, conversion flows, discounted first cycles, eligibility rules.
|
|
20
|
+
- **Upgrades and downgrades**: When to apply immediately vs at renewal, feature access during transition.
|
|
21
|
+
- **Proration logic**: Time-based credit formula, edge cases, multiple changes in the same period.
|
|
22
|
+
- **Dunning and retries**: Failed payment recovery, retry schedules, grace period access, notification patterns.
|
|
23
|
+
- **Cancellation flows**: Immediate vs end-of-period, save offers, reactivation, data retention.
|
|
24
|
+
- **Add-ons**: Purchasable feature extensions, prorated activation, consumption model compatibility.
|
|
25
|
+
|
|
26
|
+
## Learn More
|
|
27
|
+
|
|
28
|
+
- [**View on GitHub**](https://github.com/commet-labs/subscription-patterns)
|
|
29
|
+
- [**View on skills.sh**](https://skills.sh/commet-labs/subscription-patterns)
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Addons
|
|
2
|
+
|
|
3
|
+
API version: `2026-07-31`
|
|
4
|
+
|
|
5
|
+
## listActive
|
|
6
|
+
|
|
7
|
+
`commet.addons.listActive(params)`
|
|
8
|
+
|
|
9
|
+
`GET /active-addons` · operation `list-active-addons`
|
|
10
|
+
|
|
11
|
+
List all active add-ons for a customer's subscription.
|
|
12
|
+
|
|
13
|
+
### Parameters
|
|
14
|
+
|
|
15
|
+
- `customerId` (`string`, required)
|
|
16
|
+
|
|
17
|
+
### Returns
|
|
18
|
+
|
|
19
|
+
`{ object: "list"; data: Array<ActiveAddon>; hasMore: boolean; nextCursor?: string }`
|
|
20
|
+
|
|
21
|
+
## get
|
|
22
|
+
|
|
23
|
+
`commet.addons.get(params)`
|
|
24
|
+
|
|
25
|
+
`GET /addons/{id}` · operation `get-addon`
|
|
26
|
+
|
|
27
|
+
Retrieve an add-on by its public ID or slug.
|
|
28
|
+
|
|
29
|
+
### Parameters
|
|
30
|
+
|
|
31
|
+
- `id` (`string`, required)
|
|
32
|
+
|
|
33
|
+
### Returns
|
|
34
|
+
|
|
35
|
+
`Addon`
|
|
36
|
+
|
|
37
|
+
## update
|
|
38
|
+
|
|
39
|
+
`commet.addons.update(params, options?)`
|
|
40
|
+
|
|
41
|
+
`PATCH /addons/{id}` · operation `update-addon`
|
|
42
|
+
|
|
43
|
+
Update an add-on's name, description, or pricing.
|
|
44
|
+
|
|
45
|
+
### Parameters
|
|
46
|
+
|
|
47
|
+
- `id` (`string`, required)
|
|
48
|
+
- `name` (`string`, optional)
|
|
49
|
+
- `description` (`string`, optional)
|
|
50
|
+
- `basePrice` (`number`, optional)
|
|
51
|
+
- `includedUnits` (`number`, optional)
|
|
52
|
+
- `overageRate` (`number`, optional)
|
|
53
|
+
|
|
54
|
+
### Request options
|
|
55
|
+
|
|
56
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
57
|
+
|
|
58
|
+
### Returns
|
|
59
|
+
|
|
60
|
+
`Addon`
|
|
61
|
+
|
|
62
|
+
## delete
|
|
63
|
+
|
|
64
|
+
`commet.addons.delete(params, options?)`
|
|
65
|
+
|
|
66
|
+
`DELETE /addons/{id}` · operation `delete-addon`
|
|
67
|
+
|
|
68
|
+
Soft-delete an add-on. Fails if the add-on has active subscriptions.
|
|
69
|
+
|
|
70
|
+
### Parameters
|
|
71
|
+
|
|
72
|
+
- `id` (`string`, required)
|
|
73
|
+
|
|
74
|
+
### Returns
|
|
75
|
+
|
|
76
|
+
`DeletedObject`
|
|
77
|
+
|
|
78
|
+
## list
|
|
79
|
+
|
|
80
|
+
`commet.addons.list(params?)`
|
|
81
|
+
|
|
82
|
+
`GET /addons` · operation `list-addons`
|
|
83
|
+
|
|
84
|
+
List all add-ons with cursor-based pagination.
|
|
85
|
+
|
|
86
|
+
### Parameters
|
|
87
|
+
|
|
88
|
+
- `cursor` (`string`, optional)
|
|
89
|
+
- `limit` (`number`, optional)
|
|
90
|
+
|
|
91
|
+
### Returns
|
|
92
|
+
|
|
93
|
+
`{ object: "list"; data: Array<Addon>; hasMore: boolean; nextCursor?: string }`
|
|
94
|
+
|
|
95
|
+
## create
|
|
96
|
+
|
|
97
|
+
`commet.addons.create(params, options?)`
|
|
98
|
+
|
|
99
|
+
`POST /addons` · operation `create-addon`
|
|
100
|
+
|
|
101
|
+
Create a new add-on linked to a feature. Each feature can only be assigned to one add-on.
|
|
102
|
+
|
|
103
|
+
### Parameters
|
|
104
|
+
|
|
105
|
+
- `name` (`string`, required)
|
|
106
|
+
- `description` (`string`, optional)
|
|
107
|
+
- `basePrice` (`number`, required)
|
|
108
|
+
- `featureId` (`string`, required)
|
|
109
|
+
- `consumptionModel` (`"boolean" | "metered" | "credits" | "balance"`, required)
|
|
110
|
+
- `includedUnits` (`number`, optional)
|
|
111
|
+
- `overageRate` (`number`, optional)
|
|
112
|
+
- `creditCost` (`number`, optional)
|
|
113
|
+
|
|
114
|
+
### Valid parameter combinations
|
|
115
|
+
|
|
116
|
+
- `name` + `basePrice` + `featureId` + `consumptionModel`
|
|
117
|
+
- `name` + `basePrice` + `featureId` + `consumptionModel` + `includedUnits` + `overageRate`
|
|
118
|
+
- `name` + `basePrice` + `featureId` + `consumptionModel` + `creditCost`
|
|
119
|
+
- `name` + `basePrice` + `featureId` + `consumptionModel` + `overageRate`
|
|
120
|
+
|
|
121
|
+
### Request options
|
|
122
|
+
|
|
123
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
124
|
+
|
|
125
|
+
### Returns
|
|
126
|
+
|
|
127
|
+
`Addon`
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Api Keys
|
|
2
|
+
|
|
3
|
+
API version: `2026-07-31`
|
|
4
|
+
|
|
5
|
+
## delete
|
|
6
|
+
|
|
7
|
+
`commet.apiKeys.delete(params, options?)`
|
|
8
|
+
|
|
9
|
+
`DELETE /api-keys/{id}` · operation `delete-api-key`
|
|
10
|
+
|
|
11
|
+
Permanently revoke and delete an API key.
|
|
12
|
+
|
|
13
|
+
### Parameters
|
|
14
|
+
|
|
15
|
+
- `id` (`string`, required)
|
|
16
|
+
|
|
17
|
+
### Returns
|
|
18
|
+
|
|
19
|
+
`DeletedObject`
|
|
20
|
+
|
|
21
|
+
## list
|
|
22
|
+
|
|
23
|
+
`commet.apiKeys.list(params?)`
|
|
24
|
+
|
|
25
|
+
`GET /api-keys` · operation `list-api-keys`
|
|
26
|
+
|
|
27
|
+
List API keys with cursor-based pagination. Keys are returned without the full secret.
|
|
28
|
+
|
|
29
|
+
### Parameters
|
|
30
|
+
|
|
31
|
+
- `cursor` (`string`, optional)
|
|
32
|
+
- `limit` (`number`, optional)
|
|
33
|
+
|
|
34
|
+
### Returns
|
|
35
|
+
|
|
36
|
+
`{ object: "list"; data: Array<ApiKey>; hasMore: boolean; nextCursor?: string }`
|
|
37
|
+
|
|
38
|
+
## create
|
|
39
|
+
|
|
40
|
+
`commet.apiKeys.create(params, options?)`
|
|
41
|
+
|
|
42
|
+
`POST /api-keys` · operation `create-api-key`
|
|
43
|
+
|
|
44
|
+
Create a new API key. The full key is only returned once in the response.
|
|
45
|
+
|
|
46
|
+
### Parameters
|
|
47
|
+
|
|
48
|
+
- `name` (`string`, required)
|
|
49
|
+
- `expiresInDays` (`number`, optional)
|
|
50
|
+
|
|
51
|
+
### Request options
|
|
52
|
+
|
|
53
|
+
- `idempotencyKey` (`string`, optional) — Unique key used to safely retry this write for 24 hours without applying it twice.
|
|
54
|
+
|
|
55
|
+
### Returns
|
|
56
|
+
|
|
57
|
+
`CreatedApiKey`
|