Add billing with Java
Add subscriptions, usage-based pricing, metered billing, and payments to your Java application using the Commet Java SDK.
Billing that fits your stack
Builder pattern initialization, typed response objects, and standard exception handling. Works with Spring Boot, Quarkus, Micronaut, or plain Java.
import co.commet.Commet;import co.commet.params.CreateCustomerParams;import co.commet.params.CreateSubscriptionParams;Commet commet = Commet.builder().apiKey(System.getenv("COMMET_API_KEY")).build();commet.customers().create(CreateCustomerParams.builder("user@example.com").id("user_123").build());var subscription = commet.subscriptions().create(CreateSubscriptionParams.builder("user_123").planCode("pro").build());String checkoutUrl = subscription.checkoutUrl();
implementation("co.commet:commet-java:8.0.0")
Install in seconds
Install the Commet Java SDK and start billing. Subscriptions, usage tracking, and checkout with Maven or Gradle.
Frequently Asked Questions
Install the Commet SDK, add your API key, and start billing. Follow the Java integration guide for a step-by-step walkthrough with code examples.
Commet supports metered (pay for what you use), credits (block when exhausted), balance (spend across features), seats (per-user pricing), and boolean (feature gating). Learn more in the consumption models guide.
Yes. Call the usage tracking method whenever a billable event happens. Commet aggregates usage and bills it at the end of each billing period. Works for API calls, AI tokens, storage, or any custom metric. See the usage tracking guide for details.
Yes. Commet has a built-in AI model catalog with per-token pricing. You can track input, output, and cache tokens with configurable margins. See the AI token billing guide for setup instructions.
Yes. Commet is a Merchant of Record that handles taxes, compliance, refunds, and payouts. Stripe Tax is integrated for automatic tax calculation. Read more about the Merchant of Record model.
Commet has no setup fees and no monthly minimums. You only pay 5% + $0.40 per successful transaction. You can start building and testing for free using the sandbox environment. See pricing for details.