Credyt Documentation

website·Indexed 33 days ago

https://docs.credyt.ai

Billing and monetization infrastructure for AI assistants and tools. Features include real-time usage-based prepaid billing, a TypeScript/JavaScript SDK, and an MCP Server for connecting AI assistants to billing infrastructure. The platform supports managing customers, products, custom assets (such as GPU hours), auto top-ups, and financial adjustments via its API.

Tokens
37.9K
Snippets
118
Records
244
Agent score
59%

What's inside Credyt

  1. Overview of Credyt MCP Server capabilities

    The Credyt MCP Server implements the Model Context Protocol (MCP), allowing AI assistants to interact directly with billing infrastructure. It enables the AI to perform the following operations via natural language:

    • Products & Pricing: Create and manage products with usage-based, fixed, or hybrid pricing; simulate usage events.
    • Customers: Create, look up, and update customer details and external IDs.
    • Subscriptions: Manage subscriptions, including activation, deactivation, and version upgrades/downgrades.
    • Wallets: Inspect balances and pending transactions.
    • Usage Events: Submit metered usage, retrieve fees, and review profitability stats.
    • Charges & Adjustments: Create ad-hoc charges, credits, debits, and refunds.
    • Vendors: Track costs and measure profitability.
    • Profitability: Query revenue, costs, and margins across products, customers, and vendors.
    • Assets: Manage custom credit units (e.g., tokens, minutes) with exchange rates.
  2. Overview of Credyt for Platforms (C4P)

    Credyt for Platforms (C4P) allows software platforms to embed Credyt's capabilities—such as usage-based billing, reward programs, store credits, and wallet infrastructure—into their own products. Each platform customer is treated as a 'Connected Account,' which is a fully partitioned Credyt account. This allows the platform to manage its customers, who in turn can manage their own end-users and billing products.
  3. Overview of Credyt's wallet-native billing architecture

    Credyt is a real-time billing infrastructure for AI products that uses a 'wallet-native' architecture. Unlike invoice-native systems (like Stripe Billing or Lago) that collect payment at the end of a cycle, Credyt requires customers to prepay. Usage is authorized and debited in real time as it occurs, ensuring that infrastructure costs (tokens, API calls, GPU hours) are covered before the service is provided. This prevents the provider from fronting costs and eliminates the need for end-of-period reconciliation.
  4. Understand credit grant consumption and revenue recognition

    In Credyt, an account balance is the sum of its active grants. Usage draws down from these grants based on platform rules (e.g., prioritizing promotional credits or earliest-expiring grants).

    Key behaviors include:

    • Revenue Recognition: Revenue is recognized at the time of consumption or expiry, not at purchase. Top-ups are initially recorded as deferred revenue.
    • Cost Basis: Each grant retains the transaction price and exchange rate from the time of purchase, ensuring accurate fiat calculation regardless of later rate changes.
    • Expiry: When a grant expires, it is flagged as inactive. Remaining deferred revenue is recognized as actual revenue. Credyt implements a grace period of several hours to accommodate late event submissions.
  5. Understand Credyt Usage-Based Billing model

    Credyt uses a real-time, prepaid model. It does not support post-usage invoicing (billing in arrears). Usage events immediately debit the customer's wallet balance.

    Billing can be configured in two ways:

    1. Fiat pricing: Deductions are made in standard currency (e.g., USD, EUR).
    2. Custom units: Deductions are made in abstract assets (e.g., tokens, credits, minutes). You define the asset and its exchange rate against fiat, which Credyt applies during top-ups.
  6. Track deliverable profitability using Tasks

    Tasks in Credyt are automatic collections of all usage events that share the same customer_id and subject. They allow platforms to view the total economics of a multi-step process (e.g., a video production pipeline) rather than looking at isolated events.

    Tasks are read-only views that are continuously updated as new events arrive. They aggregate:

    • All associated events in chronological order.
    • Total profitability stats: gross revenue, total costs, net revenue, and margin.
    • A per-vendor cost breakdown.

    There is no separate resource to create; tasks are formed automatically if the subject field is included in usage events.

  7. Understand Credyt's security infrastructure and data encryption

    Credyt is hosted on Microsoft Azure using virtual networks (VNets) to segregate components from the public internet. Managed infrastructure utilizes private endpoints. Internal access is governed by Microsoft Entra, while external dashboard access is managed via Auth0. All external traffic is routed through a central reverse proxy protected by HTTPS. Customer data is stored in a multi-tenant environment and is encrypted in transit using TLS 1.2+ and at rest using AES-256.
  8. Handle payments and PCI compliance via Stripe Connect

    Credyt utilizes the Stripe Connect (Standard Accounts model) for payment processing. Under this model, customers maintain their own direct relationship and account with Stripe. Credyt does not process, store, or have access to raw payment card data, meaning no PCI data is held by Credyt. The platform only uses tokenized references, such as Stripe customer IDs and masked card numbers, for reconciliation and display.
  9. Define products and pricing in the Product Catalog

    The Product Catalog defines the services or resources offered and how they are billed. Each product is identified by a unique code and includes a pricing configuration (rate plan) that specifies metering and billing units. Products are automatically versioned to allow pricing changes without affecting existing customers. A product requires a customer-facing name, a unique code, and one or more prices with associated usage calculations.
  10. Manage and query Credit Grants

    Wallet balances are composed of discrete credit grants rather than a single pool. This architecture enables:

    • Expiry/Breakage: Grants have expiry dates; unused value becomes breakage revenue.
    • Rate Locking: The exchange rate is locked at the time of purchase for each grant.
    • Revenue Recognition: Value is recorded as deferred revenue at top-up and recognized as revenue upon consumption or expiry.

    Grants are issued via top-ups (default 1-year expiry), wallet adjustments (promotional/manual), or entitlements (bundled credits). Credyt consumes grants in order of expiration (earliest first).

  11. Implement Auto Top-up for prepaid balances

    Auto top-up allows customers to define rules that trigger a top-up when their balance drops below a specific threshold. This prevents service interruptions for real-time usage-based products. Auto top-up is configured per asset (e.g., USD, tokens) via the Billing Portal and requires the use of Credyt's built-in payment processing (powered by Stripe).