openapi: 3.1.0 info: title: Credyt API version: '1.0' tags: - name: Assets description: Asset management endpoints - name: Product Catalog description: Product catalog endpoints - name: Customers description: Customer management endpoints - name: Wallets description: Wallet management endpoints - name: Top-ups description: Top-up management endpoints - name: Events description: Event management endpoints - name: Billing Portal description: Billing portal endpoints - name: Vendors description: Vendor management endpoints - name: Tasks description: Task management endpoints - name: Webhooks description: Webhook management endpoints - name: Accounts description: Account management endpoints paths: /accounts: post: operationId: Accounts_create summary: Create account description: Create a new connected account parameters: [] responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/CreateAccountResponse' examples: Create Connected Account: summary: Create Connected Account description: Provision a new connected account for one of your customers. value: id: acc_4tvras4k598tdb256atm8axemw '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Accounts requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateAccountRequest' examples: Create Connected Account: summary: Create Connected Account description: Provision a new connected account for one of your customers. value: name: BingoLingo external_id: 4bc6fbfc5493 get: operationId: Accounts_list summary: List accounts description: Returns a paged list of connected accounts parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/ListAccountsParams.external_id' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/ConnectedAccount' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of ConnectedAccount tags: - Accounts /accounts/self: get: operationId: Accounts_getContext summary: Get current account context description: Returns context about the current account based on the provided API key parameters: [] responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/AccountContext' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Accounts /accounts/{accountId}: get: operationId: Accounts_get summary: Get an account's details description: Returns a connected account's details parameters: - name: accountId in: path required: true description: The ID of the account to retrieve schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/ConnectedAccount' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Accounts /assets: post: operationId: Assets_create summary: Create an asset description: Create a new custom asset parameters: [] responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/CreateAssetResponse' examples: Video Generation Minutes: summary: Video Generation Minutes description: Create a custom asset for video generation minutes priced at $0.10 per minute. value: code: VIDGENMIN created_at: '2026-02-06T10:01:29.686322Z' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Assets requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateAssetRequest' examples: CREDIT Asset: summary: CREDIT Asset description: Create a custom credit asset where each credit costs $0.05 value: code: CREDIT name: Credits precision: 0 symbol: ⭐ label: CR rates: - source: USD rate: 0.05 Video Generation Minutes: summary: Video Generation Minutes description: Create a custom asset for video generation minutes priced at $0.10 per minute. value: code: VIDGENMIN name: Video Generation Minutes precision: 2 symbol: ⏰ label: MIN rates: - source: USD rate: 0.1 get: operationId: Assets_list summary: List assets description: Returns a paged list of assets sorted by code alphabetically parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/ListAssetsItem' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of ListAssetsItem tags: - Assets /assets/{assetCode}: get: operationId: Assets_get summary: Get an asset's details description: Returns an existing asset parameters: - name: assetCode in: path required: true description: The unique code of the asset schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/GetAssetResponse' examples: Get a Video Generation Minutes Asset: summary: Get a Video Generation Minutes Asset description: Retrieve the details of the VIDGENMIN custom asset including its exchange rate schedule. value: code: VIDGENMIN name: Video Generation Minutes precision: 2 label: MIN symbol: ⏰ rates: - source: USD schedule: - valid_from: '2026-02-06T10:01:29.686322Z' rate: 0.1 inverse_rate: 10 created_at: '2026-02-06T10:01:29.686322Z' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Assets /assets/{assetCode}/quote: post: operationId: Assets_quote summary: Get a quote description: Helper to get a quote for an asset parameters: - name: assetCode in: path required: true description: The unique code of the asset schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/QuoteAssetResponse' examples: Quote Video Generation Minutes: summary: Quote Video Generation Minutes description: Calculate how many Video Generation Minutes a customer receives for $10 USD. value: source: USD source_amount: 10 destination: VIDGENMIN destination_amount: 100 rate: 0.1 inverse_rate: 10 '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Assets requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/QuoteAssetRequest' examples: Quote Video Generation Minutes: summary: Quote Video Generation Minutes description: Calculate how many Video Generation Minutes a customer receives for $10 USD. value: source: USD amount: 10 /assets/{assetCode}/rates: post: operationId: Assets_addRate summary: Add a new asset buy rate description: Adds a new buy rate for an asset parameters: - name: assetCode in: path required: true description: The unique code of the asset schema: type: string responses: '204': description: There is no content to send for this request, but the headers may be useful. '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Assets requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AddAssetRateRequest' /billing-portal/sessions: post: operationId: BillingPortal_createPortalSession summary: Create a portal session description: Creates a new session for the customer billing portal. parameters: [] responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/BillingPortal.CreateSessionResponse' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Billing Portal requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BillingPortal.CreateSessionRequest' examples: Start a Session: summary: Start a Session description: Create a billing portal session for a customer and redirect them to the portal. value: customer_id: '{{customerId}}' return_url: https://glitch.ai/account failure_url: https://glitch.ai/callbacks/credyt/failure /customers: post: operationId: Customers_create summary: Create a customer description: Create a new customer parameters: [] responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/CreateCustomerResponse' examples: Customer Created with Active Subscription: summary: Customer Created with Active Subscription value: id: cust_473cr1y0ghbyc3m1yfbwvn3nxx subscriptions: - id: sub_411xhg4kqakf3d8ybezbzta558 started_at: '2025-08-24T14:15:22Z' status: active products: - id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_payg version: default Customer Created with Pending Subscription: summary: Customer Created with Pending Subscription description: ' This example demonstrates a subscription to a product that requires further action before it can be activated' value: id: cust_473cr1y0ghbyc3m1yfbwvn3nxx subscriptions: - id: sub_411xhg4kqakf3d8ybezbzta558 status: action_required products: - id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_pro version: default required_actions: - type: payment redirect_url: https://billing.credyt.ai/api/sign-in?token=xyz Subscribe to Glitch Pro: summary: Subscribe to Glitch Pro description: Create a customer and subscribe them to a fixed fee product. The subscription starts in action_required status until the customer completes payment. value: id: cust_473cr1y0ghbyc3m1yfbwvn3nxx subscriptions: - id: sub_411xhg4kqakf3d8ybezbzta558 status: action_required products: - id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_pro version: default required_actions: - type: payment redirect_url: https://billing.credyt.ai/api/sign-in?token=xyz Subscribe to Glitch Video: summary: Subscribe to Glitch Video description: Create a customer and subscribe them to the Glitch Video product. value: id: cust_473cr1y0ghbyc3m1yfbwvn3nxx subscriptions: - id: sub_411xhg4kqakf3d8ybezbzta558 started_at: '2025-08-24T14:15:22Z' status: active products: - id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_video_std version: default Create a Customer: summary: Create a Customer description: Create a customer and subscribe them to a product using the product code and version. value: id: cust_473cr1y0ghbyc3m1yfbwvn3nxx subscriptions: - id: sub_411xhg4kqakf3d8ybezbzta558 started_at: '2025-08-24T14:15:22Z' status: active products: - id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_video_std version: default Create End User: summary: Create End User description: Create a customer record for an end user under a connected account. value: id: cust_4s8epv6ej86aeep682pmcbhhm6 subscriptions: [] '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Customers requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateCustomerRequest' examples: example0: value: name: John Doe external_id: '18991' email: j.doe@gmail.com subscriptions: - products: - code: glitch_payg Subscribe to Premium Plan: summary: Subscribe to Premium Plan description: Create a customer and subscribe them to the Premium Plan product. value: name: John Doe external_id: '18991' email: j.doe@gmail.com subscriptions: - return_url: https://glitch.ai/account failure_url: https://glitch.ai/callbacks/credyt/failure redirect_to: portal products: - code: premium_monthly_01 Subscribe to Glitch Pro: summary: Subscribe to Glitch Pro description: Create a customer and subscribe them to a fixed fee product. The subscription starts in action_required status until the customer completes payment. value: name: John Doe external_id: '18991' email: j.doe@gmail.com subscriptions: - return_url: https://glitch.ai/account failure_url: https://glitch.ai/callbacks/credyt/failure products: - code: glitch_pro Subscribe to Glitch Video: summary: Subscribe to Glitch Video description: Create a customer and subscribe them to the Glitch Video product. value: name: John Doe external_id: '18991' subscriptions: - products: - code: glitch_video_std Create a Customer: summary: Create a Customer description: Create a customer and subscribe them to a product using the product code and version. value: name: Walter Kreiger external_id: '18991' subscriptions: - products: - code: glitch_video_std version: default Create End User: summary: Create End User description: Create a customer record for an end user under a connected account. value: name: Francis Gutmann DDS external_id: b7bac50a20bf44aa893bfd614d7631ae get: operationId: Customers_list summary: List customers description: |- Returns a paged list of customers. When `external_id` is provided, the response will be a 303 See Other redirect to the specific customer resource if a match is found, or a 404 Not Found if no match exists. When `email` is provided, the response will be a filtered list of customers with that email address (which may be empty if no match is found). parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/ListCustomersParams.customer_id' - $ref: '#/components/parameters/ListCustomersParams.external_id' - $ref: '#/components/parameters/ListCustomersParams.email' - $ref: '#/components/parameters/ListCustomersParams.name' - $ref: '#/components/parameters/ListCustomersParams.status' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/CustomerSummary' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of CustomerSummary tags: - Customers /customers/stats: get: operationId: Customers_listStats summary: All customer stats description: Returns a paged list of customers with their profitability stats and an aggregate summary. parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/ListCustomerStatsParams.period_from' - $ref: '#/components/parameters/ListCustomerStatsParams.period_to' responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/CustomerStatsPage' tags: - Customers /customers/{customerId}: get: operationId: Customers_get summary: Get a customer's details description: Returns a customer's details parameters: - name: customerId in: path required: true description: The ID of the customer to retrieve schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/GetCustomerResponse' examples: Get a Customer: summary: Get a Customer description: Retrieve a customer's details including their active subscriptions. value: id: cust_4qh0wajx2n9qtazh2tghzkyan2 external_id: 951832085fee4033a2878f841a24149a name: Joan Parker active_subscription_count: 1 created_at: '2025-11-14T03:25:02.885Z' external_accounts: [] subscriptions: - id: sub_4t2fz8a57hje7fjazkrc08jg5n started_at: '2025-10-23T11:11:40.100Z' status: active products: - id: prp_4t2fz8a57hje7fjazkrc08jg5n code: glitch_video_std version: 1 '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Customers patch: operationId: Customers_update summary: Update a customer description: Update a customer parameters: - name: customerId in: path required: true schema: type: string responses: '204': description: There is no content to send for this request, but the headers may be useful. '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '404': description: 404 Not Found '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Customers requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateCustomerRequest' /customers/{customerId}/stats: get: operationId: Customers_getStats summary: Get a customer's stats description: Returns a customer's stats parameters: - name: customerId in: path required: true description: The ID of the customer to retrieve schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/CustomerProfitability' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Customers /customers/{customerId}/subscriptions: post: operationId: Customers_createSubscription summary: Add a subscription to a customer description: Adds a new subscription to a customer parameters: - name: customerId in: path required: true description: The ID of the customer schema: type: string responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/CustomerSubscription' examples: Active Subscription: summary: Active Subscription value: id: sub_411xhg4kqakf3d8ybezbzta558 started_at: '2025-08-24T14:15:22Z' status: active products: - id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_payg version: default Pending Subscription: summary: Pending Subscription description: ' This example demonstrates a subscription to a product that requires further action before it can be activated' value: id: sub_411xhg4kqakf3d8ybezbzta558 status: action_required products: - id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_pro version: default required_actions: - type: payment redirect_url: https://billing.credyt.ai/api/sign-in?token=xyz '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Customers requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateCustomerSubscription' /customers/{customerId}/subscriptions/{subscriptionId}: patch: operationId: Customers_updateSubscription summary: Update a subscription description: Updates a customer's subscription parameters: - name: customerId in: path required: true description: The ID of the customer schema: type: string - name: subscriptionId in: path required: true description: The ID of the subscription schema: type: string responses: '204': description: There is no content to send for this request, but the headers may be useful. '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '404': description: 404 Not Found '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Customers requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateCustomerSubscriptionRequest' /customers/{customerId}/subscriptions/{subscriptionId}/products/{productId}: patch: operationId: Customers_updateSubscriptionProduct summary: Update a subscription product description: Updates a customer's subscription product parameters: - name: customerId in: path required: true description: The ID of the customer schema: type: string - name: subscriptionId in: path required: true description: The ID of the subscription schema: type: string - name: productId in: path required: true description: The ID of the product schema: type: string responses: '204': description: There is no content to send for this request, but the headers may be useful. '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '404': description: 404 Not Found '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Customers requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateCustomerSubscriptionProductRequest' /customers/{customerId}/wallet: get: operationId: CustomerWalletOps_getCustomerWallet summary: Get a customer's wallet description: Returns the available balances of the accounts in a customer's wallet parameters: - $ref: '#/components/parameters/Wallets.CustomerWalletParams' responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/Wallets.GetWalletResponse' examples: Get Wallet: summary: Get Wallet description: Retrieve a customer's wallet showing their available balances. value: accounts: - id: default:USD name: default asset: USD available: 998.5 Get Wallet with Custom Asset: summary: Get Wallet with Custom Asset description: Retrieve a customer's wallet showing balances in both fiat currency and a custom asset. value: accounts: - id: default:USD name: default asset: USD available: 14.566678 - id: default:TOK name: default asset: TOK available: 993450234 Get Wallet with VIDGENMIN: summary: Get Wallet with VIDGENMIN description: Retrieve a customer's wallet showing balances in both USD and a VIDGENMIN custom asset account. value: accounts: - id: default:USD name: default asset: USD available: 14.57 - id: default:VIDGENMIN name: default asset: VIDGENMIN available: 320 '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Wallets /customers/{customerId}/wallet/adjustments: post: operationId: CustomerWalletOps_createAdjustment summary: Create adjustment description: |- Adjustments allow you to directly impact the balance of an account outside of normal usage processing. This might be necessary to reflect out-of-bound operations such as refunds, or if you operate a hybrid setup and collect funds outside of Credyt. Every adjustment must have a corresponding `reason` that influences how revenue is ultimately recognized. The adjustment `transaction_id` is used as an idempotency key to ensure safe retries. parameters: - $ref: '#/components/parameters/Wallets.CustomerWalletParams' responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/Wallets.CreateAdjustmentResponse' examples: Pre-fund Balance: summary: Pre-fund Balance description: Pre-fund a customer's wallet balance using an external top-up. value: id: 61e15192-a156-4af4-a3cc-ec6c937795fa created_at: '2025-10-17T21:00:56.743379Z' External PSP Payment: summary: External PSP Payment description: Record a payment processed by your own PSP to credit the customer's USD wallet. value: id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 created_at: '2024-07-29T15:51:28.071Z' Refund: summary: Refund description: Subtract funds from a customer's wallet to reflect an externally processed refund. value: id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 created_at: '2024-07-29T15:51:28.071Z' Signup Gift: summary: Signup Gift description: Credit a customer's token wallet with a promotional signup bonus. value: id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 created_at: '2024-07-29T15:51:28.071Z' Credit End User Balance: summary: Credit End User Balance description: Credit a connected account end user's wallet after a subscription payment is collected. value: id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 created_at: '2026-04-14T10:00:00Z' Reflect External Topup: summary: Reflect External Topup description: Credit a customer wallet after processing a payment externally (e.g. ad-hoc topup via your PSP). value: id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 created_at: '2024-07-29T15:51:28.071Z' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Wallets requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Wallets.CreateAdjustmentRequest' examples: Pre-fund Balance: summary: Pre-fund Balance description: Pre-fund a customer's wallet balance using an external top-up. value: transaction_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 asset: USD amount: 20 reason: external_topup metadata: psp: stripe payment_intent: pi_3RjbbNJNSIruR1rb0GwMGpH0 External PSP Payment: summary: External PSP Payment description: Record a payment processed by your own PSP to credit the customer's USD wallet. value: transaction_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 account_name: default asset: USD amount: 25 description: Monthly Subscription reason: external_topup expires_at: '2024-07-29T15:51:28.071Z' metadata: psp: stripe payment_intent: pi_3RjbbNJNSIruR1rb0GwMGpH0 Refund: summary: Refund description: Subtract funds from a customer's wallet to reflect an externally processed refund. value: transaction_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 account_name: default asset: USD amount: -20 description: Technical failure reason: external_refund expires_at: '2024-07-29T15:51:28.071Z' Signup Gift: summary: Signup Gift description: Credit a customer's token wallet with a promotional signup bonus. value: transaction_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 account_name: default asset: TOKENS amount: 1000 description: Signup bonus reason: gift expires_at: '2024-07-29T15:51:28.071Z' metadata: signup_channel: referral referral_id: 2c963f66afa6 Credit End User Balance: summary: Credit End User Balance description: Credit a connected account end user's wallet after a subscription payment is collected. value: transaction_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 asset: USD amount: 20 reason: external_topup metadata: payment_id: 4c81c0ff-d050-4e85-b111-13a7f3f251fa Reflect External Topup: summary: Reflect External Topup description: Credit a customer wallet after processing a payment externally (e.g. ad-hoc topup via your PSP). value: transaction_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 account_name: default asset: USD amount: 25 description: Ad-hoc usage reason: external_topup expires_at: '2024-07-29T15:51:28.071Z' metadata: psp: stripe payment_intent: pi_3RjbbNJNSIruR1rb0GwMGpH0 /customers/{customerId}/wallet/charges: post: operationId: CustomerWalletOps_createCharge summary: Create a charge description: |- Charges allow you to charge ad-hoc fees to an account outside of normal usage processing. The charge `transaction_id` is used as an idempotency key to ensure safe retries. parameters: - $ref: '#/components/parameters/Wallets.CustomerWalletParams' responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/Wallets.CreateChargeResponse' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Wallets requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Wallets.CreateChargeRequest' examples: Ad-hoc Charge: summary: Ad-hoc Charge description: Apply a manual volume-based charge to a customer's wallet outside of normal usage processing. value: transaction_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 account_name: default asset: USD subject: chat_5f53d23a4958 description: Overage costs for GPT-4 usage metadata: model: gpt-4-1 input_units: null input_volume: 2652000 unit_price: null volume_rate: 0.5 package_size: 1000000 amount: 1.326 /customers/{customerId}/wallet/transactions/{transactionId}: get: operationId: CustomerWalletOps_getTransaction summary: Get a wallet transaction description: Returns the details of a wallet transaction parameters: - $ref: '#/components/parameters/Wallets.CustomerWalletParams' - name: transactionId in: path required: true description: The ID of the transaction schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/Wallets.GetTransactionResponse' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Wallets /customers/{customerId}/wallet/{accountId}: get: operationId: CustomerWalletOps_getAccount summary: Get a customer's wallet account description: Returns the detailed balances of a specific account in a customer's wallet parameters: - $ref: '#/components/parameters/Wallets.CustomerWalletParams' - name: accountId in: path required: true description: The ID of the account in the wallet schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/Wallets.GetAccountDetailsResponse' examples: Get Account: summary: Get Account description: Retrieve the detailed balance of a specific wallet account. value: id: default:USD name: default asset: USD available: 998.5 pending_in: 0 pending_out: 0 Check VIDGENMIN Balance: summary: Check VIDGENMIN Balance description: Retrieve the detailed balance of a VIDGENMIN account, including pending transactions. value: id: default:VIDGENMIN name: default asset: VIDGENMIN available: 320 pending_in: 100 pending_out: 0 Get Custom Unit Account: summary: Get Custom Unit Account description: Retrieve balance for a custom asset account (e.g. tokens). value: id: default:TOK name: default asset: TOK available: 993450234 pending_in: 50000 pending_out: 10000 '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Wallets /customers/{customerId}/wallet/{accountId}/grants: get: operationId: CustomerWalletOps_getCreditGrants summary: Get credit grants for a wallet account description: Returns credit grants associated with the customer's account. parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/Wallets.GetCreditGrantsParams.purpose' - $ref: '#/components/parameters/Wallets.GetCreditGrantsParams.exclude_expired' - $ref: '#/components/parameters/Wallets.GetCreditGrantsParams.effective_from' - $ref: '#/components/parameters/Wallets.GetCreditGrantsParams.effective_to' - $ref: '#/components/parameters/Wallets.GetCreditGrantsParams.expired_from' - $ref: '#/components/parameters/Wallets.GetCreditGrantsParams.expired_to' - name: customerId in: path required: true description: The ID of the customer schema: $ref: '#/components/schemas/customerId' - name: accountId in: path required: true description: The ID of the account within the wallet schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/Wallets.CreditGrantItem' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of CreditGrantItem examples: Get Credit Grants: summary: Get Credit Grants description: Retrieve active credit grants for a customer's wallet account, ordered by expiry. value: {} '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: 404 Not Found tags: - Wallets /events: post: operationId: Events_send_usage summary: Submit events description: Submit usage events for a customer. parameters: [] responses: '204': description: There is no content to send for this request, but the headers may be useful. '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Events requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UsageRequest' examples: Video Generated: summary: Video Generated description: Submit a dimensional usage event for a video generation with speed and minutes. value: customer_id: cust_4td6grpw680sgewcaz5p89pf40 events: - id: ba15987a-7b68-4a9d-b2e6-eadeff29e657 event_type: video_generated occurred_at: '2025-11-04T21:53:21.392Z' subject: video_defc8524 description: Video Generated data: minutes: 10 speed: fast Video Promoted: summary: Video Promoted description: Submit a video promoted usage event for a customer using their customer ID. value: customer_id: cust_473cr1y0ghbyc3m1yfbwvn3nxx events: - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 event_type: video_promoted occurred_at: '2025-10-17T21:21:27.024729Z' subject: video_5f53d23a4958 description: Video Promoted data: promo_id: pro_4tbftjwzxja1h71nzas1g0g1xm Video Promoted by External ID: summary: Video Promoted by External ID description: Submit a video promoted usage event using the customer's external ID. value: customer_external_id: events: - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 event_type: video_promoted occurred_at: '2025-10-17T21:21:27.024729Z' subject: video_5f53d23a4958 description: Video Promoted data: promo_id: pro_4tbftjwzxja1h71nzas1g0g1xm Video Generated with Costs: summary: Video Generated with Costs description: Submit a usage event with vendor cost data attached for profitability tracking. value: customer_id: cust_4zrjbt38gmpb55h95ygp38sp40 events: - id: 9c2c8e3a-7f6b-4f5e-9c1f-2e6b6a4a9f21 event_type: video_generated occurred_at: '2026-01-05T14:32:18Z' subject: chat_videoId39854734 description: Video gen completed costs: - id: 68116730-e125-408b-8f75-90f1fb9aa7dd vendor_id: vnd_4rcmsv3fagtvha1j05q4fymsmw description: OpenAI Sora metadata: model: sora-fast resolution: 1080p billing_type: per_minute amount: 0.16 currency: USD data: model: video fast speed: fast minutes: 2 Message Completed: summary: Message Completed description: Report a chat message completion event to deduct from wallet balance. value: customer_id: cust_473cr1y0ghbyc3m1yfbwvn3nxx events: - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 event_type: message_completed occurred_at: '2024-07-29T15:51:28.071Z' subject: chat_5f53d23a4958 description: Chat message completed data: model: gpt-4-1 input_tokens: 2353 output_tokens: 34697 description: The customer usage data get: operationId: Events_list summary: List events description: Returns a paged list of events ordered by submission date in descending order. parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/ListEventsParams.event_id' - $ref: '#/components/parameters/ListEventsParams.customer_id' - $ref: '#/components/parameters/ListEventsParams.customer_external_id' - $ref: '#/components/parameters/ListEventsParams.subject' - $ref: '#/components/parameters/ListEventsParams.period_from' - $ref: '#/components/parameters/ListEventsParams.period_to' - $ref: '#/components/parameters/ListEventsParams.event_types' - $ref: '#/components/parameters/ListEventsParams.has_fees' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/ListEventsItem' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of ListEventsItem tags: - Events /events/{eventId}: get: operationId: Events_get summary: Get an event's details description: Returns an event's details and any generated usage fees parameters: - name: eventId in: path required: true description: The ID of the event to retrieve schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/GetEventResponse' examples: Get Event with Profitability: summary: Get Event with Profitability description: Retrieve a usage event showing the generated fees, vendor costs, and profitability metrics. value: id: 9c2c8e3a-7f6b-4f5e-9c1f-2e6b6a4a9f21 event_type: video_generated occurred_at: '2026-01-05T14:32:18Z' subject: chat_videoId39854734 description: Video gen completed data: model: video fast speed: fast minutes: 2 customer_id: cust_4zrjbt38gmpb55h95ygp38sp40 created_at: '2026-01-05T14:32:18Z' fees: - id: fee_5a1s2xq3ky8z16b1enqybz1qdn product_id: prp_42b28p940qcq31r7amf2729snb product_code: glitch_video_adv_1 product_version: 1 price_id: prc_475p31bj838yec0q2fy66snbcy price_name: Video Generation Compute currency: MIN usage_type: volume volume_field: minutes input_volume: 2 volume_rate: 1 description: Video gen completed amount: 2 costs: - id: 68116730-e125-408b-8f75-90f1fb9aa7dd vendor_id: vnd_4rcmsv3fagtvha1j05q4fymsmw description: OpenAI Sora metadata: {} amount: 0.16 currency: USD stats: gross_revenue: 0.2 total_costs: 0.16 net_revenue: 0.04 margin: 0.2 currency: USD '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Events /products: post: operationId: Products_create summary: Create a product description: Creates a new product parameters: [] responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/ProductCatalog.CreateProductResponse' examples: Monthly Fixed Fee: summary: Monthly Fixed Fee description: An example of a fixed fee billed on a monthly basis value: id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_pro version: 1 status: published is_default: true Dimensional Usage Based Price: summary: Dimensional Usage Based Price description: |2- This example demonstrates how to price based on different billing dimensions and includes an additional fixed monthly price. value: id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_video_adv version: 1 status: published is_default: true Usage Based Price: summary: Usage Based Price description: An example of usage-based price that occurs for each instant (unit) of an event. value: id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_video_std version: 1 status: published is_default: true Glitch Video: summary: Glitch Video description: Create a usage-based product that charges $1.00 per minute of video generated. value: id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_video_std version: 1 status: published is_default: true Glitch Video VIDGENMIN: summary: Glitch Video VIDGENMIN description: Create a usage-based product that charges 1 VIDGENMIN per minute of video generated. value: id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_video_std version: 1 status: published is_default: true '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Product Catalog requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProductCatalog.CreateProductRequest' examples: Monthly Fixed Fee: summary: Monthly Fixed Fee description: An example of a fixed fee billed on a monthly basis value: name: Glitch Pro Subscription code: glitch_pro prices: - id: prc_4asvwjbgbypk6d9z3xp95ttrc8 name: Monthly Subscription type: fixed billing_model: type: recurring recurring: interval: month pricing: - asset: USD values: - unit_price: 20 publish: true Dimensional Usage Based Price: summary: Dimensional Usage Based Price description: |2- This example demonstrates how to price based on different billing dimensions and includes an additional fixed monthly price. value: name: Glitch Video Advanced code: glitch_video_adv prices: - name: Video Generation Compute type: usage_based billing_model: type: real_time usage_calculation: event_type: video_generated usage_type: unit_and_volume volume_field: minutes billable_dimensions: - speed pricing: - asset: USD values: - name: Video Generation Minutes (Fast) dimensions: speed: fast values: - volume_rate: 1 - name: Video Generation Minutes (Regular) dimensions: speed: regular values: - volume_rate: 0.4 - name: Video Generation Minutes (Default) dimensions: speed: '*' values: - volume_rate: 0.4 publish: true Usage Based Price: summary: Usage Based Price description: An example of usage-based price that occurs for each instant (unit) of an event. value: name: Glitch Video code: glitch_video_std prices: - name: Video Promotion type: usage_based billing_model: type: real_time usage_calculation: event_type: video_promoted usage_type: unit pricing: - asset: USD values: - unit_price: 0.5 publish: true Premium Plan: summary: Premium Plan description: A monthly subscription with bundled credits that refresh each billing cycle. value: name: Premium Plan code: premium_monthly_01 entitlements: - name: Monthly Credit Allowance asset: CREDIT amount: 1000 purpose: bundled lifecycle: duration: month refresh: strategy: expire_and_replace accounting: revenue_basis: 0 cost_basis: auto prices: - name: Monthly Subscription Fee type: fixed billing_model: type: recurring recurring: interval: month pricing: - asset: USD values: - unit_price: 20 - name: Image Generation type: usage_based billing_model: type: real_time usage_calculation: event_type: image_generated usage_type: unit pricing: - asset: CREDIT values: - unit_price: 10 publish: true Free Tier: summary: Free Tier description: A free tier that grants daily promotional credits to customers. value: name: Free Tier Product code: free_tier_01 entitlements: - name: Daily Reward asset: CREDIT amount: 50 purpose: promotion lifecycle: duration: day refresh: strategy: expire_and_replace accounting: revenue_basis: 0 cost_basis: auto prices: - name: Image Generation type: usage_based billing_model: type: real_time usage_calculation: event_type: image_generated usage_type: unit pricing: - asset: CREDIT values: - unit_price: 5 publish: true Glitch Video: summary: Glitch Video description: Create a usage-based product that charges $1.00 per minute of video generated. value: name: Glitch Video code: glitch_video_std prices: - {} publish: true Glitch Video VIDGENMIN: summary: Glitch Video VIDGENMIN description: Create a usage-based product that charges 1 VIDGENMIN per minute of video generated. value: name: Glitch Video code: glitch_video_std prices: - name: Video Generation type: usage_based billing_model: type: real_time usage_calculation: event_type: video_generated usage_type: volume volume_field: minutes pricing: - asset: VIDGENMIN values: - volume_rate: 1 publish: true get: operationId: Products_list summary: List products description: Get all products parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/ProductCatalog.ListProductsParams.code' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/ProductCatalog.GetProductDataResponse' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of GetProductDataResponse tags: - Product Catalog /products/versions: get: operationId: Products_listVersions summary: List product versions description: Get all product versions parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/ProductCatalog.ListProductVersionsParams.status' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/ProductCatalog.ListProductVersionDataResponse' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of ListProductVersionDataResponse tags: - Product Catalog /products/{productId}: get: operationId: Products_get summary: Get a product's details description: Gets the details of an existing product and its versions parameters: - $ref: '#/components/parameters/ProductCatalog.ProductRouteParams' responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/ProductCatalog.GetProductResponse' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Product Catalog delete: operationId: Products_delete summary: Delete or archive a product description: Deletes an existing product. If the product has been used it will be archived. parameters: - $ref: '#/components/parameters/ProductCatalog.ProductRouteParams' responses: '204': description: There is no content to send for this request, but the headers may be useful. '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Product Catalog post: operationId: Products_createVersion summary: Update product description: Updates an existing product creating a new version parameters: - $ref: '#/components/parameters/ProductCatalog.ProductRouteParams' responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/ProductCatalog.CreateProductVersionResponse' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Product Catalog requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProductCatalog.CreateProductVersionRequest' /products/{productId}/subscribers: get: operationId: Products_getSubscribers summary: List product subscribers description: Returns a paginated list of customers subscribed to this product. parameters: - $ref: '#/components/parameters/ProductCatalog.ProductRouteParams' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/ProductCatalog.ProductSubscriberResponse' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of ProductSubscriberResponse tags: - Product Catalog /products/{productId}/{version}: get: operationId: Products_getVersion summary: Get a product version's details description: Get a version of a product. parameters: - $ref: '#/components/parameters/ProductCatalog.ProductRouteParams' - $ref: '#/components/parameters/ProductCatalog.ProductVersionRouteParams.version' responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/ProductCatalog.GetProductVersionResponse' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Product Catalog patch: operationId: Products_updateVersion summary: Update a product version description: Update an existing version of a product. Only unpublished versions can be modified. parameters: - $ref: '#/components/parameters/ProductCatalog.ProductRouteParams' - $ref: '#/components/parameters/ProductCatalog.ProductVersionRouteParams.version' responses: '204': description: There is no content to send for this request, but the headers may be useful. '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '409': description: 409 Conflict '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Product Catalog requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProductCatalog.UpdateProductVersionRequest' delete: operationId: Products_archiveVersion summary: Archive a product version description: Archives an existing product version making it unavailable for subscription parameters: - $ref: '#/components/parameters/ProductCatalog.ProductRouteParams' - $ref: '#/components/parameters/ProductCatalog.ProductVersionRouteParams.version' responses: '204': description: There is no content to send for this request, but the headers may be useful. '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Product Catalog /products/{productId}/{version}/simulate-usage: post: operationId: Products_simulateUsage summary: Simulate usage description: |- Simulate usage calculation for a product by sending test usage events parameters: - $ref: '#/components/parameters/ProductCatalog.ProductRouteParams' - $ref: '#/components/parameters/ProductCatalog.ProductVersionRouteParams.version' responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/ProductCatalog.SimulateUsageResponse' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Product Catalog requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ProductCatalog.SimulateUsageRequest' /tasks: get: operationId: Tasks_list summary: List tasks description: Returns a paged list of tasks ordered by the specified sort field in descending order. parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/ListTasksParams.sort' - $ref: '#/components/parameters/ListTasksParams.last_updated_from' - $ref: '#/components/parameters/ListTasksParams.last_updated_to' - $ref: '#/components/parameters/ListTasksParams.created_from' - $ref: '#/components/parameters/ListTasksParams.created_to' - $ref: '#/components/parameters/ListTasksParams.customer_id' - $ref: '#/components/parameters/ListTasksParams.customer_external_id' - $ref: '#/components/parameters/ListTasksParams.subject' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/TaskSummary' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of TaskSummary tags: - Tasks /tasks/{taskId}: get: operationId: Tasks_get summary: Get a task's details description: |- Returns a task's events, stats, and per-vendor cost breakdown. The `taskId` is `{customer_id}:{subject}` — URL-encode the value before passing it (e.g. `cust_473cr1y0ghbyc3m1yfbwvn3nxx%3Apod_episode_5f53d23a`). parameters: - name: taskId in: path required: true description: The task identifier in the form `{customer_id}:{subject}`, URL-encoded schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/GetTaskResponse' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Tasks /top-ups: post: operationId: TopUps_initiate summary: Initiate top-up description: Initiates a top-up to a customer's wallet. parameters: [] responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/InitiateTopUpResponse' examples: Initiate a Top-up: summary: Initiate a Top-up description: Start a top-up payment flow for a customer, returning a redirect URL to complete payment. value: id: top_473cr1y0ghbyc3m1yfbwvn3nxx status: initiated redirect_url: https://billing.credyt.ai/api/sign-in?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 created_at: '2024-07-29T15:51:28.071Z' expires_at: '2024-07-29T15:51:28.071Z' Initiate Top-up with Credits: summary: Initiate Top-up with Credits description: Initiate a top-up with a custom asset destination and expiry, returning a Stripe Checkout redirect URL. value: id: top_473cr1y0ghbyc3m1yfbwvn3nxx status: initiated redirect_url: https://billing.credyt.ai/api/sign-in?token=xyz created_at: '2024-07-29T15:51:28.071Z' expires_at: '2024-07-29T15:51:28.071Z' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Top-ups requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/InitiateTopUpRequest' examples: Initiate a Top-up: summary: Initiate a Top-up description: Start a top-up payment flow for a customer, returning a redirect URL to complete payment. value: customer_id: cust_473cr1y0ghbyc3m1yfbwvn3nxx amount: 25 currency: USD description: Video Promotion Credits return_url: https://glitch.ai/account failure_url: https://glitch.ai/callbacks/credyt-failure Initiate Top-up with Credits: summary: Initiate Top-up with Credits description: Initiate a top-up with a custom asset destination and expiry, returning a Stripe Checkout redirect URL. value: customer_id: cust_473cr1y0ghbyc3m1yfbwvn3nxx amount: 50 currency: USD description: Image generation credits destination: account_name: default asset: USD exchange_rate: 1000000 return_url: https://glitch.ai/account failure_url: https://glitch.ai/callbacks/credyt-failure metadata: order_id: order_12345 /top-ups/{topUpId}: get: operationId: TopUps_get summary: Get a top-up's details description: Returns an existing top-ups parameters: - name: topUpId in: path required: true description: The ID of the top-up to retrieve schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/GetTopUpResponse' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Top-ups /vendors: post: operationId: VendorsOps_createVendor summary: Create a vendor description: Create a new vendor parameters: [] responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/Vendors.CreateVendorResponse' examples: Create a Vendor: summary: Create a Vendor description: Register an external vendor for cost attribution in profitability tracking. value: id: vnd_4rjb887sb1h4j2m0hdjmh49gdg created_at: '2026-02-17T09:42:22.470555Z' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Vendors requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Vendors.CreateVendorRequest' examples: Create a Vendor: summary: Create a Vendor description: Register an external vendor for cost attribution in profitability tracking. value: name: OpenAI external_id: openai get: operationId: VendorsOps_listVendors summary: List vendors description: Returns a paged list of vendors parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/Vendors.ListVendorsParams.external_id' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count - limit - offset properties: items: type: array items: $ref: '#/components/schemas/Vendors.VendorSummary' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of VendorSummary tags: - Vendors /vendors/{vendorId}: get: operationId: VendorsOps_getVendor summary: Get a vendor's details description: Returns a vendor's details parameters: - name: vendorId in: path required: true description: The ID of the vendor to retrieve schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/Vendors.VendorSummary' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Vendors /vendors/{vendorId}/stats: get: operationId: VendorsOps_getVendorStats summary: Get a vendor's stats description: Returns a vendor's stats parameters: - name: vendorId in: path required: true description: The ID of the vendor to retrieve schema: type: string - $ref: '#/components/parameters/Vendors.GetVendorStatsParams.period_from' - $ref: '#/components/parameters/Vendors.GetVendorStatsParams.period_to' - $ref: '#/components/parameters/Vendors.GetVendorStatsParams.category' responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/Vendors.VendorStats' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Vendors /webhooks: post: operationId: Webhooks_createWebhookDestination summary: Create a webhook destination description: Create a new webhook destination parameters: [] responses: '201': description: The request has succeeded and a new resource has been created as a result. content: application/json: schema: $ref: '#/components/schemas/Credyt.Shared.Webhooks.CreateWebhookDestinationResponse' examples: Create a Webhook Destination: summary: Create a Webhook Destination description: Register an HTTPS endpoint to receive real-time billing event notifications. value: id: whd_01abc123 secret: whsec_•••••• created_at: '2026-04-14T10:00:00Z' Create a Connect Webhook Destination: summary: Create a Connect Webhook Destination description: Create a webhook destination that receives events from connected accounts. value: id: dst_4kf9v6xp00hzc99rdwr5m97wce secret: whsec_abc123def456 created_at: '2026-04-14T10:00:00Z' Create a C4P Webhook Destination: summary: Create a C4P Webhook Destination description: Register an endpoint to receive events from connected accounts. value: id: whd_01abc123 secret: whsec_•••••• created_at: '2026-04-14T10:00:00Z' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Webhooks requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Credyt.Shared.Webhooks.CreateWebhookDestinationRequest' examples: Create a Webhook Destination: summary: Create a Webhook Destination description: Register an HTTPS endpoint to receive real-time billing event notifications. value: url: https://yourplatform.com/webhooks/credyt topics: - '*' Create a Connect Webhook Destination: summary: Create a Connect Webhook Destination description: Create a webhook destination that receives events from connected accounts. value: url: https://yourplatform.com/webhooks/credyt/connect topics: - subscription.activated connect: true Create a C4P Webhook Destination: summary: Create a C4P Webhook Destination description: Register an endpoint to receive events from connected accounts. value: url: https://integrations.tradbill.com/credyt/c4p connect: true get: operationId: Webhooks_listWebhookDestinations summary: List webhook destinations description: Returns a paged list of webhook destinations parameters: - $ref: '#/components/parameters/Credyt.Shared.Webhooks.ListWebhookDestinationsParams.enabled' - $ref: '#/components/parameters/Credyt.Shared.Webhooks.ListWebhookDestinationsParams.connect' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - total_count properties: items: type: array items: $ref: '#/components/schemas/Credyt.Shared.Webhooks.WebhookDestinationWithoutSecret' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 description: Items response of WebhookDestinationWithoutSecret '401': description: 401 Unauthorized tags: - Webhooks /webhooks/events: get: operationId: Webhooks_listEvents summary: List webhook events description: List webhook events with filtering and cursor-based pagination parameters: - $ref: '#/components/parameters/Credyt.Shared.CursorPaginationParameters.limit' - $ref: '#/components/parameters/Credyt.Shared.CursorPaginationParameters.next' - $ref: '#/components/parameters/Credyt.Shared.CursorPaginationParameters.prev' - $ref: '#/components/parameters/Webhooks.ListEventsParams.destination_id' - $ref: '#/components/parameters/Webhooks.ListEventsParams.status' - $ref: '#/components/parameters/Webhooks.ListEventsParams.time_gte' - $ref: '#/components/parameters/Webhooks.ListEventsParams.time_lte' responses: '200': description: The request has succeeded. content: application/json: schema: type: object required: - items - pagination properties: items: type: array items: $ref: '#/components/schemas/Credyt.Shared.Webhooks.WebhookEventListItem' minItems: 0 description: The current page of items pagination: allOf: - $ref: '#/components/schemas/Credyt.Shared.CursorPaginationMetadata' description: Pagination metadata description: Cursor-based paged response of WebhookEventListItem '401': description: 401 Unauthorized tags: - Webhooks /webhooks/test/{topic}: post: operationId: Webhooks_testWebhookDestinations summary: Test webhook destinations description: Test webhook destinations parameters: - name: topic in: path required: true description: The event topic to simulate schema: type: string responses: '202': description: The request has been accepted for processing, but processing has not yet completed. content: application/json: schema: $ref: '#/components/schemas/Webhooks.TestWebhookResponse' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Webhooks requestBody: required: true content: application/json: schema: {} /webhooks/test/{topic}/{connectedAccountId}: post: operationId: Webhooks_testConnectedWebhookDestinations summary: Test connected account webhook destinations description: Test webhook destinations for a connected account parameters: - name: topic in: path required: true description: The event topic to simulate schema: type: string - name: connectedAccountId in: path required: true description: The ID of the connected account schema: type: string responses: '202': description: The request has been accepted for processing, but processing has not yet completed. content: application/json: schema: $ref: '#/components/schemas/Webhooks.TestWebhookResponse' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Webhooks requestBody: required: true content: application/json: schema: {} /webhooks/{webhookId}: get: operationId: Webhooks_getWebhookDestination summary: Get a webhook destination's details description: Returns a webhook destination's details parameters: - name: webhookId in: path required: true description: The ID of the webhook destination to retrieve schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/Credyt.Shared.Webhooks.WebhookDestination' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Webhooks patch: operationId: Webhooks_updateWebhookDestination summary: Update a webhook destination description: Update a webhook destination parameters: - name: webhookId in: path required: true description: The ID of the webhook destination to update schema: type: string responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/Credyt.Shared.Webhooks.WebhookDestination' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Webhooks requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Credyt.Shared.Webhooks.UpdateWebhookDestinationRequest' delete: operationId: Webhooks_deleteWebhookDestination summary: Delete a webhook destination description: Delete a webhook destination parameters: - name: webhookId in: path required: true description: The ID of the webhook destination to delete schema: type: string responses: '204': description: There is no content to send for this request, but the headers may be useful. '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: 401 Unauthorized '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Webhooks /webhooks/{webhookId}/test/{topic}: post: operationId: Webhooks_testWebhookDestination summary: Test a webhook destination description: Test a webhook destination parameters: - name: webhookId in: path required: true description: The ID of the webhook destination to test schema: type: string - name: topic in: path required: true description: The event topic to simulate schema: type: string responses: '202': description: The request has been accepted for processing, but processing has not yet completed. content: application/json: schema: $ref: '#/components/schemas/Webhooks.TestWebhookResponse' examples: Test a Webhook Destination: summary: Test a Webhook Destination description: Send a test event to an existing webhook destination to verify it handles payloads correctly. value: id: evt_01abc123 '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Webhooks requestBody: required: true content: application/json: schema: {} /webhooks/{webhookId}/test/{topic}/{connectedAccountId}: post: operationId: Webhooks_testConnectedWebhookDestination summary: Test a connected account webhook destination description: Test a webhook destination for a connected account parameters: - name: webhookId in: path required: true description: The ID of the webhook destination to test schema: type: string - name: topic in: path required: true description: The event topic to simulate schema: type: string - name: connectedAccountId in: path required: true description: The ID of the connected account schema: type: string responses: '202': description: The request has been accepted for processing, but processing has not yet completed. content: application/json: schema: $ref: '#/components/schemas/Webhooks.TestWebhookResponse' '401': description: 401 Unauthorized '404': description: 404 Not Found tags: - Webhooks requestBody: required: true content: application/json: schema: {} security: - ApiKeyAuth: [] components: parameters: Credyt.Shared.CursorPaginationParameters.limit: name: limit in: query required: false description: The maximum number of items to return schema: type: integer format: int64 minimum: 1 maximum: 1000 default: 100 explode: false Credyt.Shared.CursorPaginationParameters.next: name: next in: query required: false description: Cursor for the next page of results schema: type: string explode: false Credyt.Shared.CursorPaginationParameters.prev: name: prev in: query required: false description: Cursor for the previous page of results schema: type: string explode: false Credyt.Shared.PagingParameters.limit: name: limit in: query required: false description: The number of items to return schema: type: integer format: int64 default: 100 explode: false Credyt.Shared.PagingParameters.offset: name: offset in: query required: false description: The number of items to offset schema: type: integer format: int64 default: 0 explode: false Credyt.Shared.Webhooks.ListWebhookDestinationsParams.connect: name: connect in: query required: false description: Filter by connect status schema: type: boolean explode: false Credyt.Shared.Webhooks.ListWebhookDestinationsParams.enabled: name: enabled in: query required: false description: Filter by webhook destination enabled status schema: type: boolean explode: false ListAccountsParams.external_id: name: external_id in: query required: false description: The external ID of the connected account to search for schema: type: string explode: false ListCustomerStatsParams.period_from: name: period_from in: query required: false description: 'Filter stats to those that occurred on or after this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false ListCustomerStatsParams.period_to: name: period_to in: query required: false description: 'Filter stats to those that occurred on or before this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false ListCustomersParams.customer_id: name: customer_id in: query required: false description: Filter customers by customer ID. Returns a list of matching customers. schema: type: string explode: false ListCustomersParams.email: name: email in: query required: false description: Filter customers by email address. Returns a list of matching customers. schema: type: string format: email explode: false ListCustomersParams.external_id: name: external_id in: query required: false description: The external ID of the customer to search for schema: type: string explode: false ListCustomersParams.name: name: name in: query required: false description: Filter customers by name. Returns a list of matching customers. schema: type: string explode: false ListCustomersParams.status: name: status in: query required: false description: Filter customers by active subcriptions. Returns a list of matching customers. schema: $ref: '#/components/schemas/CustomerSubscriptionStatus' explode: false ListEventsParams.customer_external_id: name: customer_external_id in: query required: false description: The external ID of the customer to filter by schema: type: string explode: false ListEventsParams.customer_id: name: customer_id in: query required: false description: The ID of the customer to filter by schema: $ref: '#/components/schemas/customerId' explode: false ListEventsParams.event_id: name: event_id in: query required: false description: The event ID to filter by schema: $ref: '#/components/schemas/uuid' explode: false ListEventsParams.event_types: name: event_types in: query required: false description: Comma-separated list of event types to filter by schema: type: string explode: false ListEventsParams.has_fees: name: has_fees in: query required: false description: Indicates whether to filter by events that have fees associated with them schema: type: boolean explode: false ListEventsParams.period_from: name: period_from in: query required: false description: 'Filter events to those that occurred on or after this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false ListEventsParams.period_to: name: period_to in: query required: false description: 'Filter events to those that occurred on or before this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false ListEventsParams.subject: name: subject in: query required: false description: The subject to filter by schema: type: string explode: false ListTasksParams.created_from: name: created_from in: query required: false description: 'Filter tasks to those created on or after this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false ListTasksParams.created_to: name: created_to in: query required: false description: 'Filter tasks to those created on or before this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false ListTasksParams.customer_external_id: name: customer_external_id in: query required: false description: The external ID of the customer to filter by schema: type: string explode: false ListTasksParams.customer_id: name: customer_id in: query required: false description: The ID of the customer to filter by schema: $ref: '#/components/schemas/customerId' explode: false ListTasksParams.last_updated_from: name: last_updated_from in: query required: false description: 'Filter tasks to those last updated on or after this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false ListTasksParams.last_updated_to: name: last_updated_to in: query required: false description: 'Filter tasks to those last updated on or before this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false ListTasksParams.sort: name: sort in: query required: false description: The field to sort tasks by. Defaults to `last_updated_at`. Direction is always descending. schema: $ref: '#/components/schemas/TaskSortField' explode: false ListTasksParams.subject: name: subject in: query required: false description: Filter tasks to those with a specific event subject schema: type: string explode: false ProductCatalog.ListProductVersionsParams.status: name: status in: query required: false description: Filter product versions by status schema: $ref: '#/components/schemas/ProductCatalog.ProductVersionStatus' explode: false ProductCatalog.ListProductsParams.code: name: code in: query required: false description: The code of the product to search for schema: type: string explode: false ProductCatalog.ProductRouteParams: name: productId in: path required: true description: The ID of the product to retrieve schema: type: string ProductCatalog.ProductVersionRouteParams.version: name: version in: path required: true description: The version of the product to retrieve. Use `default` for the default version. schema: anyOf: - type: integer format: int16 - type: string default: default Vendors.GetVendorStatsParams.category: name: category in: query required: false description: The category to filter by schema: type: string explode: false Vendors.GetVendorStatsParams.period_from: name: period_from in: query required: false description: 'Filter stats to those that occurred on or after this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false Vendors.GetVendorStatsParams.period_to: name: period_to in: query required: false description: 'Filter stats to those that occurred on or before this date (inclusive). Format: YYYY-MM-DD.' schema: type: string format: date explode: false Vendors.ListVendorsParams.external_id: name: external_id in: query required: false description: The external ID of the vendor to search for schema: type: string explode: false Wallets.CustomerWalletParams: name: customerId in: path required: true description: The ID of the customer schema: $ref: '#/components/schemas/customerId' Wallets.GetCreditGrantsParams.effective_from: name: effective_from in: query required: false description: The UTC start date and time for filtering credit grants by effective date schema: type: string format: date-time explode: false Wallets.GetCreditGrantsParams.effective_to: name: effective_to in: query required: false description: The UTC end date and time for filtering credit grants by effective date schema: type: string format: date-time explode: false Wallets.GetCreditGrantsParams.exclude_expired: name: exclude_expired in: query required: false description: The flag indicating whether to exclude expired credit grants from the results schema: type: boolean explode: false Wallets.GetCreditGrantsParams.expired_from: name: expired_from in: query required: false description: The UTC start date and time for filtering credit grants by expiry date schema: type: string format: date-time explode: false Wallets.GetCreditGrantsParams.expired_to: name: expired_to in: query required: false description: The UTC end date and time for filtering credit grants by expiry date schema: type: string format: date-time explode: false Wallets.GetCreditGrantsParams.purpose: name: purpose in: query required: false description: The purpose of the credit grants to filter by schema: type: string explode: false Webhooks.ListEventsParams.destination_id: name: destination_id in: query required: false description: Filter events by destination ID(s). Provide comma-separated values for multiple destinations. schema: type: string explode: false Webhooks.ListEventsParams.status: name: status in: query required: false description: Filter events by delivery status schema: $ref: '#/components/schemas/Credyt.Shared.Webhooks.WebhookEventStatus' explode: false Webhooks.ListEventsParams.time_gte: name: time_gte in: query required: false description: Filter events with time >= value (ISO 8601 format) schema: type: string format: date-time explode: false Webhooks.ListEventsParams.time_lte: name: time_lte in: query required: false description: Filter events with time <= value (ISO 8601 format) schema: type: string format: date-time explode: false schemas: AccountContext: type: object required: - account_id - environment properties: account_id: type: string description: The unique Credyt identifier for the platform account examples: - acc_46acd5z09yd5hb0f8adfwtd3cw environment: type: string enum: - live - test description: The environment mode (live or test) examples: - live org_id: type: string description: The organization ID associated with the account examples: - org_abcdef1234567890 name: type: string description: The account name examples: - My Platform Account AddAssetRateRequest: type: object required: - source - rate properties: source: allOf: - $ref: '#/components/schemas/currency' description: The asset used to buy. Initially only currencies are supported examples: - USD valid_from: type: string format: date-time description: The timestamp from which the rate applies. Defaults to the current time and closes the previous rate valid_to: type: string format: date-time description: The timestamp to which the rate applies rate: type: number format: decimal description: The buy rate, in the source asset, for one unit of the target asset examples: - 60 AssetBase: type: object required: - code - name properties: code: type: string pattern: ^[A-Z0-9]{2,64}$ description: The unique code of the asset. examples: - VIDGEN name: type: string description: The external facing name of the asset examples: - Video Generation Credits precision: type: integer format: int16 minimum: 0 maximum: 10 description: The precision of the asset (number of decimal places) examples: - 2 default: 0 label: type: string description: The customer-facing label for the asset. Defaults to the code. examples: - vgen symbol: type: string description: The currency symbol for the asset when displaying amounts. Must be a single character or emoji. examples: - 📹 AssetExchangeRate: type: object required: - valid_from - rate properties: valid_from: type: string format: date-time description: The timestamp from which the rate applies valid_to: type: string format: date-time description: The timestamp to which the rate applies rate: type: number format: decimal description: |2- Exchange rate (source -> asset): 1 unit of this asset = X units of source asset. E.g. 0.10 means 1 asset unit costs 0.10 source units. examples: - 1000000 inverse_rate: type: number format: decimal description: |2- Inverse exchange (asset -> source): 1 unit of source asset = X units of this asset. E.g. 100 means 1 source unit buys 100 units. AssetRates: type: object required: - source - schedule properties: source: allOf: - $ref: '#/components/schemas/currency' description: The source asset used to buy the target asset units schedule: type: array items: $ref: '#/components/schemas/AssetExchangeRate' minItems: 1 description: The rates for exchanging between the source asset and the target BillingPortal.CreateSessionRequest: type: object required: - customer_id - return_url - failure_url properties: customer_id: $ref: '#/components/schemas/customerId' return_url: type: string format: uri description: The URL the customer is redirected to when returning to your site from the billing portal examples: - https://glitch.ai/account failure_url: type: string format: uri description: The URL the customer is redirected to when a failure occurs examples: - https://glitch.ai/callbacks/credyt-failure description: The session creation parameters BillingPortal.CreateSessionResponse: type: object required: - redirect_url - expires_at properties: redirect_url: type: string description: The authenticated billing portal URL for the customer examples: - https://billing.credyt.ai/api/sign-in?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 expires_at: type: string format: date-time description: The UTC date and time that the portal session expires description: The billing portal session details ConnectedAccount: type: object required: - id - name - created_at properties: id: type: string description: The unique Credyt identifier for the connected account examples: - acc_46acd5z09yd5hb0f8adfwtd3cw external_id: type: string description: Your external identifier for the account examples: - 4bc6fbfc5493 name: type: string description: The name of the account examples: - BingoLingo created_at: type: string format: date-time description: The date and time the account was created metadata: anyOf: - type: object unevaluatedProperties: type: string - type: 'null' description: Additional metadata about the account examples: - {} CostData: type: object required: - id - amount properties: id: allOf: - $ref: '#/components/schemas/uuid' description: Your unique ID for the cost record examples: - f35db292-fad3-4c28-90f7-43308bfcda11 vendor_id: type: string description: The identifier for the vendor that this cost relates to. Required if `vendor_external_id` is omitted. examples: - vnd_4kf9v6xp00hzc99rdwr5m97wce vendor_external_id: type: string description: Your identifier for the vendor that this cost relates to. Required if `vendor_id` is omitted. examples: - openai category: type: string description: Your category identifier for this cost. Used for cost grouping in analytics. examples: - gpt-5 description: type: string description: A description of the cost metadata: type: object unevaluatedProperties: anyOf: - type: string - type: boolean - type: number description: Additional metadata associated with the cost units: type: number description: The cost represented in units unit_price: type: number description: The unit price of the units input_volume: type: number description: The cost represented by volume examples: - 410 volume_rate: type: number description: The volume rate used examples: - 1.25 package_size: type: number description: Number of volume units per package amount: type: number description: The total amount of the cost. Defaults to USD. examples: - 0.001563 currency: type: string description: The currency of the cost. Defaults to USD. examples: - USD CreateAccountRequest: type: object required: - name properties: name: type: string description: The name of the account examples: - BingoLingo external_id: type: string description: Your external identifier for the connected account. Must be unique across all accounts. examples: - 4bc6fbfc5493 metadata: type: object unevaluatedProperties: type: string description: Additional metadata about the account examples: - config_id: '123456' CreateAccountResponse: type: object required: - id properties: id: type: string description: The unique Credyt identifier for the connected account examples: - acc_46acd5z09yd5hb0f8adfwtd3cw CreateAssetRequest: type: object required: - code - name properties: code: type: string pattern: ^[A-Z0-9]{2,64}$ description: The unique code of the asset. examples: - VIDGEN name: type: string description: The external facing name of the asset examples: - Video Generation Credits precision: type: integer format: int16 minimum: 0 maximum: 10 description: The precision of the asset (number of decimal places) examples: - 2 default: 0 label: type: string description: The customer-facing label for the asset. Defaults to the code. examples: - vgen symbol: type: string description: The currency symbol for the asset when displaying amounts. Must be a single character or emoji. examples: - 📹 rates: type: array items: $ref: '#/components/schemas/StartingExchangeRate' description: The starting exchange rates for the asset CreateAssetResponse: type: object required: - code - created_at properties: code: type: string pattern: ^[A-Z0-9]{2,64}$ description: The unique code of the asset. examples: - VIDGEN created_at: type: string format: date-time description: The date and time the asset was created CreateCustomerRequest: type: object required: - name properties: name: type: string description: The name of the customer examples: - John Doe external_id: type: string description: Your external identifier for the customer account. Must be unique across all customers. examples: - '18991' email: type: string format: email description: The customer's email address examples: - samantha.ritchie@example.com metadata: type: object unevaluatedProperties: type: string description: Additional metadata about the customer examples: - referral_code: X-12345-AB subscriptions: type: array items: $ref: '#/components/schemas/CreateCustomerSubscription' description: The customer's product subscriptions examples: - - products: - code: glitch_video_std external_accounts: type: array items: $ref: '#/components/schemas/ExternalAccount' description: External account mappings for the customer (currently only Stripe is supported) examples: - - provider: stripe provider_id: cus_T3jj3gnc7RO23u CreateCustomerResponse: type: object required: - id - subscriptions properties: id: type: string description: The unique Credyt identifier for the customer account examples: - cust_473cr1y0ghbyc3m1yfbwvn3nxx subscriptions: type: array items: $ref: '#/components/schemas/CustomerSubscription' description: The created customer subscriptions. You should check the state of each subscription to determine if further action is required. CreateCustomerSubscription: type: object required: - products properties: starts_at: type: string format: date-time description: The start date of the subscription. Defaults to now() renews_at: type: string format: date-time description: The date the subscription renews. Leave empty for perpetual subscriptions products: type: array items: $ref: '#/components/schemas/CustomerSubscriptionProduct' minItems: 1 description: The products the customer is subscribing to return_url: type: string format: uri description: The URL the customer is redirected to when successfully completing a payment form for a recurring subscription. Required for recurring subscriptions only. examples: - https://glitch.ai/account failure_url: type: string format: uri description: The URL the customer is redirected to on payment failure for a recurring subscription. Required for recurring subscriptions only. examples: - https://glitch.ai/callbacks/credyt-failure redirect_to: allOf: - $ref: '#/components/schemas/RedirectionType' description: Whether to return the user to the return URL or the billing portal. Defaults to "return_url" examples: - return_url Credyt.Shared.CursorPaginationMetadata: type: object required: - limit properties: limit: type: integer format: int64 minimum: 1 maximum: 1000 description: The maximum number of items per page examples: - 100 next: anyOf: - type: string - type: 'null' description: Cursor for the next page of results, if available prev: anyOf: - type: string - type: 'null' description: Cursor for the previous page of results, if available description: Cursor-based pagination metadata Credyt.Shared.Webhooks.CreateWebhookDestinationRequest: type: object required: - url properties: url: type: string format: uri description: The webhook endpoint URL examples: - https://example.com/webhooks/credyt topics: type: array items: type: string description: |- List of event types (topics) to subscribe to. Use ["*"] for catch-all (default), or specify individual event types. examples: - - '*' default: - '*' connect: type: boolean description: |- Whether this endpoint should receive events from connected accounts (true) or the platform account (false). Defaults to false examples: - false default: false description: Request to create a new webhook destination Credyt.Shared.Webhooks.CreateWebhookDestinationResponse: type: object required: - id - secret - created_at properties: id: type: string description: The unique identifier for the webhook destination examples: - dst_4kf9v6xp00hzc99rdwr5m97wce secret: type: string description: |- The signing secret for verifying webhook requests. Store this securely - it won't be retrievable again. examples: - whsec_abc123def456 created_at: type: string format: date-time description: The date and time the webhook destination was created description: Response when creating a webhook destination Credyt.Shared.Webhooks.UpdateWebhookDestinationRequest: type: object properties: url: type: string format: uri description: The webhook endpoint URL examples: - https://example.com/webhooks/credyt topics: type: array items: type: string description: |- List of event types (topics) to subscribe to. Use ["*"] for catch-all, or specify individual event types. examples: - - customer.created - transaction.completed enabled: type: boolean description: Whether the webhook destination is currently enabled examples: - true description: Request to update a webhook destination Credyt.Shared.Webhooks.WebhookDestination: type: object required: - secret properties: secret: type: string description: |- The signing secret for verifying webhook requests. Used to validate that webhooks are sent from Credyt. examples: - whsec_abc123def456 allOf: - $ref: '#/components/schemas/Credyt.Shared.Webhooks.WebhookDestinationWithoutSecret' description: Represents a webhook destination Credyt.Shared.Webhooks.WebhookDestinationWithoutSecret: type: object required: - id - url - topics - connect - enabled - created_at - updated_at properties: id: type: string description: The unique identifier for the webhook destination examples: - dst_4kf9v6xp00hzc99rdwr5m97wce url: type: string format: uri description: The webhook endpoint URL examples: - https://example.com/webhooks/credyt topics: type: array items: type: string description: |- List of event types (topics) to subscribe to. Use ["*"] for catch-all, or specify individual event types like ["customer.created", "transaction.completed"] examples: - - customer.created - transaction.completed connect: type: boolean description: |- Whether this endpoint should receive events from connected accounts (true) or the platform account (false) examples: - false enabled: type: boolean description: Whether the webhook destination is currently enabled examples: - true created_at: type: string format: date-time description: The date and time the webhook destination was created updated_at: type: string format: date-time description: The date and time the webhook destination was last updated description: Represents a webhook destination Credyt.Shared.Webhooks.WebhookEventListItem: type: object required: - id - matched_destination_ids - topic - time - data properties: id: type: string description: The unique identifier for the event examples: - evt_123abc matched_destination_ids: type: array items: type: string description: The IDs of the destinations matched for this event examples: - - dst_456def topic: type: string description: The event topic/type examples: - customer.created time: type: string format: date-time description: The timestamp when the event occurred successful_at: anyOf: - type: string format: date-time - type: 'null' description: The timestamp when the event was successfully delivered, if applicable failed_at: anyOf: - type: string format: date-time - type: 'null' description: The timestamp when the event delivery failed, if applicable metadata: anyOf: - type: object unevaluatedProperties: {} - type: 'null' description: Additional metadata about the event data: description: The event payload data description: Webhook event item for list responses Credyt.Shared.Webhooks.WebhookEventStatus: type: string enum: - Success - Failed description: Webhook event status CustomerProfitability: type: object required: - gross_revenue - total_costs - net_revenue - margin - currency properties: gross_revenue: type: number description: The total gross revenue for the customer examples: - 0.003529 total_costs: type: number description: The total costs for the customer examples: - 0.001563 net_revenue: type: number description: The net revenue for the customer examples: - 0.001966 margin: type: number description: The margin percentage for the customer examples: - 0.5571 currency: type: string description: The currency used for the calculations examples: - USD CustomerStatsItem: type: object required: - id - name - stats properties: id: type: string description: The unique Credyt identifier for the customer account examples: - cust_473cr1y0ghbyc3m1yfbwvn3nxx external_id: type: string description: Your external identifier for the customer account examples: - '18991' name: type: string description: The name of the customer examples: - John Doe stats: allOf: - $ref: '#/components/schemas/CustomerProfitability' description: The customer's profitability stats description: Represents a customer with their profitability stats CustomerStatsPage: type: object required: - summary - period_from - period_to - items - total_count - limit - offset properties: summary: allOf: - $ref: '#/components/schemas/CustomerProfitability' description: The aggregated stats summary across all customers in the result set period_from: type: string format: date description: 'The date from which the stats are calculated. Format: YYYY-MM-DD.' examples: - '2026-04-01' period_to: type: string format: date description: 'The date to which the stats are calculated. Format: YYYY-MM-DD.' examples: - '2026-04-30' items: type: array items: $ref: '#/components/schemas/CustomerStatsItem' minItems: 0 description: The current page of items total_count: type: integer format: int64 minimum: 0 description: The total count of items examples: - 145 limit: type: integer format: int64 minimum: 1 description: The number of items to return examples: - 20 offset: type: integer format: int64 minimum: 0 description: The number of items to offset examples: - 0 description: Paged response of customer stats with an aggregate summary CustomerSubscription: type: object required: - id - status - products properties: id: type: string description: The unique Credyt identifier for the subscription examples: - sub_411xhg4kqakf3d8ybezbzta558 started_at: type: string format: date-time description: The date and time the subscription started renews_at: type: string format: date-time description: The date the subscription renews. Leave empty for perpetual subscriptions status: allOf: - $ref: '#/components/schemas/SubscriptionStatus' description: The status of the subscription products: type: array items: $ref: '#/components/schemas/CustomerSubscriptionProduct' minItems: 1 description: The products the customer is subscribing to required_actions: type: array items: $ref: '#/components/schemas/RequiredSubscriptionAction' description: Actions required to activate or reactivate the subscription CustomerSubscriptionProduct: type: object properties: id: type: string description: The unique identifier of the product to subscribe to. Must be specified if `code` is null examples: - prp_4e28n8kk41931f5yt5em49ecw7 code: type: string description: The unique code of the product to be subscribed to. Must be specified if `id` is null examples: - credyt_standard version: anyOf: - type: integer format: int16 - type: string enum: - default description: The version of the product to subscribe the customer. Defaults to the current "default" version default: default CustomerSubscriptionStatus: type: string enum: - active - inactive CustomerSummary: type: object required: - id - name - active_subscription_count properties: id: type: string description: The unique Credyt identifier for the customer account examples: - cust_473cr1y0ghbyc3m1yfbwvn3nxx external_id: type: string description: Your external identifier for the customer account examples: - '18991' name: type: string description: The name of the customer examples: - John Doe email: type: string description: The customer's email address examples: - samantha.ritchie@example.com active_subscription_count: type: integer format: int64 minimum: 0 description: The number of active subscriptions for the customer examples: - 1 description: Represents a customer EventFee: type: object required: - id - product_id - product_code - product_version - price_id - price_name - currency - usage_type - amount properties: id: type: string description: The unique identifier of the fee examples: - fee_5marhrtjart2d6zgm4cevmnncp product_id: type: string description: The ID of the product to which the fee relates examples: - prp_4e28n8kk41931f5yt5em49ecw7 product_code: type: string description: The code of the product to which the fee relates examples: - glitch_video_std product_version: type: integer format: int16 description: The version number of the product to which the fee relates examples: - 2 price_id: type: string description: The ID of the price to which this fee relates examples: - prc_4asvwjbgbypk6d9z3xp95ttrc8 price_name: type: string description: The name of the price to which the fee relates examples: - Text Processing Input Tokens currency: allOf: - $ref: '#/components/schemas/currency' description: The billing currency dimensions: anyOf: - type: object unevaluatedProperties: type: string - type: 'null' description: The dimensions that were matched examples: - {} usage_type: allOf: - $ref: '#/components/schemas/ProductCatalog.UsageType' description: How usage was measured examples: - volume volume_field: type: string description: The event field used to determine the billable volume examples: - input_tokens input_volume: anyOf: - type: number - type: 'null' description: The volume used for calculation examples: - 2353 unit_price: anyOf: - type: number - type: 'null' description: The unit price for unit-based usage pricing examples: - null volume_rate: anyOf: - type: number - type: 'null' description: The rate for volume-based usage pricing examples: - 1.5 package_size: anyOf: - type: integer format: int64 - type: 'null' description: Number of volume units per package examples: - 1000000 description: type: string description: The fee description presented to the customer examples: - GPT 4.1 Input Tokens amount: type: number description: The fee amount in the billing currency examples: - 0.003529 ExternalAccount: type: object required: - provider - provider_id properties: provider: type: string description: The name of the provider where the external account is held examples: - stripe provider_id: type: string description: The providers identifier for the customer examples: - cus_T3jj3gnc7RO23u GetAssetResponse: type: object required: - code - name - created_at properties: code: type: string pattern: ^[A-Z0-9]{2,64}$ description: The unique code of the asset. examples: - VIDGEN name: type: string description: The external facing name of the asset examples: - Video Generation Credits precision: type: integer format: int16 minimum: 0 maximum: 10 description: The precision of the asset (number of decimal places) examples: - 2 default: 0 label: type: string description: The customer-facing label for the asset. Defaults to the code. examples: - vgen symbol: type: string description: The currency symbol for the asset when displaying amounts. Must be a single character or emoji. examples: - 📹 rates: type: array items: $ref: '#/components/schemas/AssetRates' description: The exchange rates for the asset, the most recent first examples: - - source: USD schedule: - valid_from: '2025-06-01T00:00:00Z' rate: 90 - valid_from: '2025-01-01T00:00:00Z' valid_to: '2025-06-01T00:00:00Z' rate: 60 created_at: type: string format: date-time description: The date and time the asset was created GetCustomerResponse: type: object required: - created_at properties: created_at: type: string format: date-time description: The date and time the customer was created metadata: anyOf: - type: object unevaluatedProperties: type: string - type: 'null' description: Additional metadata about the customer examples: - {} subscriptions: type: array items: $ref: '#/components/schemas/CustomerSubscription' description: The customer's product subscriptions examples: - - id: sub_411xhg4kqakf3d8ybezbzta558 started_at: '2025-01-15T12:41:57.014Z' status: active products: - id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_video_std version: 3 external_accounts: type: array items: $ref: '#/components/schemas/ExternalAccount' description: The customer's external account mappings allOf: - $ref: '#/components/schemas/CustomerSummary' GetEventResponse: type: object required: - id - event_type - occurred_at - customer_id - created_at - fees properties: id: allOf: - $ref: '#/components/schemas/uuid' description: Your unique ID for the usage record. Requests with the same ID will be idempotent. event_type: type: string description: The type of event examples: - message_completed occurred_at: type: string format: date-time description: The UTC date and time that the event occurred. Historical events must be within the acceptable grace period. subject: type: string description: The subject to which this usage event relates. This allows for additional context to be shared within Credyt examples: - chat_5f53d23a4958 description: type: string description: A description of the user that will be displayed to the customer examples: - Chat message completed data: type: object unevaluatedProperties: anyOf: - type: string - type: boolean - type: number description: Additional data associated with the event that may be used as part of pricing calculations to provide additional context examples: - model: gpt-4-1 input_tokens: 2353 output_tokens: 34697 costs: type: array items: $ref: '#/components/schemas/CostData' description: The costs from the vendor associated with this event. customer_id: $ref: '#/components/schemas/customerId' created_at: type: string format: date-time description: The UTC date and time that the event was submitted to Credyt fees: type: array items: $ref: '#/components/schemas/EventFee' minItems: 0 description: The fees resulting from the usage event stats: allOf: - $ref: '#/components/schemas/ProfitabilityStats' description: The profitability stats for the usage event GetEventTypesResponse: type: object required: - event_types properties: event_types: type: array items: type: string description: The distinct event types submitted in the last 3 months GetTaskResponse: type: object required: - id - created_at - last_updated_at - customer - stats - events - vendors properties: id: type: string description: The unique identifier of the task, derived from `{customer_id}:{subject}` examples: - cust_473cr1y0ghbyc3m1yfbwvn3nxx:pod_episode_5f53d23a created_at: type: string format: date-time description: The date and time of the first event in the task last_updated_at: type: string format: date-time description: The date and time of the most recent event in the task customer: allOf: - $ref: '#/components/schemas/TaskCustomer' description: The customer associated with the task stats: allOf: - $ref: '#/components/schemas/TaskStats' description: The aggregated profitability stats for the task events: type: array items: $ref: '#/components/schemas/GetEventResponse' minItems: 1 description: The events that make up the task vendors: type: array items: $ref: '#/components/schemas/TaskVendorCost' description: The breakdown of costs by vendor across all events in the task description: Represents a task's full details including its events, stats, and vendor cost breakdown GetTopUpResponse: type: object required: - id - customer_id - amount - currency - status properties: id: type: string description: The unique Credyt identifier for the top-up examples: - top_473cr1y0ghbyc3m1yfbwvn3nxx customer_id: allOf: - $ref: '#/components/schemas/customerId' description: The ID of the customer amount: type: number format: decimal description: The top-up amount in the major currency unit examples: - 50 currency: allOf: - $ref: '#/components/schemas/currency' description: The currency of the top-up destination: allOf: - $ref: '#/components/schemas/TopUpDestination' description: The destination wallet account to top-up status: allOf: - $ref: '#/components/schemas/TopUpStatus' description: The status of the top-up InitiateTopUpRequest: type: object required: - customer_id - amount - currency - return_url - failure_url properties: customer_id: allOf: - $ref: '#/components/schemas/customerId' description: The ID of the customer to top-up amount: type: number format: decimal description: The amount to top-up in the major currency unit examples: - 50 currency: allOf: - $ref: '#/components/schemas/currency' description: The currency of the top-up description: type: string description: A customer-facing description of the top-up examples: - Image generation credits destination: allOf: - $ref: '#/components/schemas/TopUpDestination' description: The destination wallet account to top-up. If not provided the top-up will go to the customer's default wallet account in the top-up currency return_url: type: string format: uri description: The URL the customer is redirected to when returning to your site from the billing portal examples: - https://glitch.ai/account failure_url: type: string format: uri description: The URL the customer is redirected to when a failure occurs examples: - https://glitch.ai/callbacks/credyt-failure metadata: type: object unevaluatedProperties: type: string description: Additional metadata about the top-up examples: - order_id: order_12345 InitiateTopUpResponse: type: object required: - id - status - redirect_url - created_at - expires_at properties: id: type: string description: The unique Credyt identifier for the top-up examples: - top_473cr1y0ghbyc3m1yfbwvn3nxx status: allOf: - $ref: '#/components/schemas/TopUpStatus' description: The status of the top-up redirect_url: type: string description: The URL to redirect the customer to complete the top-up examples: - https://billing.credyt.ai/api/sign-in?token=xyz created_at: type: string format: date-time description: The UTC date and time that the top-up was created expires_at: type: string format: date-time description: The UTC date and time that the top-up link expires ListAssetsItem: type: object required: - code - name properties: code: type: string pattern: ^[A-Z0-9]{2,64}$ description: The unique code of the asset. examples: - VIDGEN name: type: string description: The external facing name of the asset examples: - Video Generation Credits ListEventsItem: type: object required: - id - customer_id - external_id - event_type - occurred_at - created_at - has_fees properties: id: allOf: - $ref: '#/components/schemas/uuid' description: Your unique ID for the usage record. Requests with the same ID will be idempotent. customer_id: $ref: '#/components/schemas/customerId' external_id: type: string event_type: type: string description: The type of event examples: - message_completed subject: type: string description: The subject to which this usage event relates. This allows for additional context to be shared within Credyt examples: - chat_5f53d23a4958 description: type: string description: A description of the user that will be displayed to the customer examples: - Chat message completed occurred_at: type: string format: date-time description: The UTC date and time that the event occurred. Historical events must be within the acceptable grace period. created_at: type: string format: date-time description: The UTC date and time that the event was submitted to Credyt total_fees: type: number description: The total amount of fees generated from this event examples: - 0.003529 fee_currency: type: string description: The currency of the fees examples: - USD has_fees: type: boolean description: Whether this event has any fees associated with it examples: - true stats: allOf: - $ref: '#/components/schemas/ProfitabilityStats' description: The profitability stats for the usage event ProblemDetails: type: object properties: type: type: string description: A URI reference that identifies the problem type. When dereferenced, it should provide human-readable documentation. examples: - https://api.credyt.ai/problems/problem title: type: string description: A short, human-readable summary of the problem type. Should not change from occurrence to occurrence. examples: - One or more validation errors occurred. status: type: integer format: int32 description: The HTTP status code generated by the origin server for this occurrence of the problem. examples: - 400 detail: type: string description: A human-readable explanation specific to this occurrence of the problem. examples: - See the errors property for details. instance: type: string description: A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced. examples: - /events allOf: - type: object unevaluatedProperties: {} description: |- RFC 7807-compatible problem details object. Use as the body for error responses with media type `application/problem+json`. See: https://datatracker.ietf.org/doc/html/rfc7807 ProductCatalog.BalanceCollection: type: object required: - type properties: type: type: string enum: - balance address: type: string description: The address from which fees should be deducted. Defaults to the default account of the billing currency/asset examples: - default default: default allOf: - $ref: '#/components/schemas/ProductCatalog.CollectionMethodBase' ProductCatalog.CalculatedFee: type: object required: - price_id - price_name - currency - usage_id - event_type - usage_type - amount properties: price_id: type: string description: The ID of the price to which this fee relates examples: - prc_4asvwjbgbypk6d9z3xp95ttrc8 price_name: type: string description: The name of the price to which this fee relates examples: - Text Processing Input Tokens currency: allOf: - $ref: '#/components/schemas/currency' description: The billing currency usage_id: allOf: - $ref: '#/components/schemas/uuid' description: The identifier of the priced usage event event_type: type: string description: The usage event type that was matched examples: - message_completed dimensions: type: object unevaluatedProperties: type: string description: The dimensions that were matched examples: - model: gpt-4-1 usage_type: allOf: - $ref: '#/components/schemas/ProductCatalog.UsageType' description: How usage was measured examples: - volume volume_field: type: string description: The event field used to determine the billable volume examples: - input_tokens input_volume: type: number description: The volume used for calculation examples: - 2353 unit_price: type: number description: The unit price for unit-based usage pricing volume_rate: type: number description: The rate for volume-based usage pricing examples: - 1.5 package_size: type: integer format: int64 description: Number of volume units per package examples: - 1000000 description: type: string description: The fee description presented to the customer examples: - GPT 4.1 Input Tokens amount: type: number description: The fee amount in the billing currency examples: - 0.003529 ProductCatalog.CollectionMethodBase: type: object properties: timing: type: string enum: - in_advance - in_arrears description: When the collection should occur ProductCatalog.CollectionMethodVariant: type: object oneOf: - $ref: '#/components/schemas/ProductCatalog.BalanceCollection' - $ref: '#/components/schemas/ProductCatalog.InvoiceCollection' discriminator: propertyName: type mapping: balance: '#/components/schemas/ProductCatalog.BalanceCollection' invoice: '#/components/schemas/ProductCatalog.InvoiceCollection' ProductCatalog.CostBasis: type: string enum: - auto ProductCatalog.CreateProductRequest: type: object required: - name - code - prices properties: name: type: string description: The customer facing name of the product examples: - Glitch Video code: type: string description: A unique code for the product. This can be used when subscribing customers to products. examples: - glitch_video_std prices: type: array items: $ref: '#/components/schemas/ProductCatalog.PriceVariant' description: The product's pricing entitlements: type: array items: $ref: '#/components/schemas/ProductCatalog.Entitlement' description: Right-to-use grants added as part of a bundle or promotion. publish: type: boolean description: Whether to immediately publish the product. Published products can only be modified by creating a new version. default: false ProductCatalog.CreateProductResponse: type: object required: - id - code - version - status - is_default properties: id: type: string description: The unique identifier of the product examples: - prp_4e28n8kk41931f5yt5em49ecw7 code: type: string description: A unique code for the product. This can be used when subscribing customers to products. examples: - glitch_video_std version: type: integer format: int16 description: The version of the product examples: - 1 status: allOf: - $ref: '#/components/schemas/ProductCatalog.ProductVersionStatus' description: The status of the product examples: - published is_default: type: boolean description: Whether this is the default version of the product examples: - true description: The result of a product creation request ProductCatalog.CreateProductVersionRequest: type: object required: - prices properties: entitlements: type: array items: $ref: '#/components/schemas/ProductCatalog.Entitlement' description: Right-to-use grants added as part of a bundle or promotion. prices: type: array items: $ref: '#/components/schemas/ProductCatalog.PriceVariant' description: The product's pricing examples: - - id: prc_4asvwjbgbypk6d9z3xp95ttrc8 name: Video Promotion type: usage_based billing_model: type: real_time usage_calculation: event_type: video_promoted usage_type: unit pricing: - asset: USD values: - unit_price: 0.5 publish: type: boolean description: Whether to immediately publish the product version examples: - true default: false description: A request to create a new version of an existing product ProductCatalog.CreateProductVersionResponse: type: object required: - id - code - version - status - is_default properties: id: type: string description: The unique identifier of the product examples: - prp_4e28n8kk41931f5yt5em49ecw7 code: type: string description: A unique code for the product. This can be used when subscribing customers to products. examples: - glitch_video_std version: type: integer format: int16 description: The version of the product examples: - 1 status: allOf: - $ref: '#/components/schemas/ProductCatalog.ProductVersionStatus' description: The status of the product examples: - published is_default: type: boolean description: Whether this is the default version of the product examples: - true description: The result of creating a new version of an existing product examples: - id: prp_4e28n8kk41931f5yt5em49ecw7 code: glitch_video_std version: 2 status: published is_default: false ProductCatalog.DimensionalPrice: type: object required: - dimensions - values properties: name: type: string description: An optional name that describes the dimensions this price applies to dimensions: type: object unevaluatedProperties: type: string description: "Dimensions for which this price applies e.g. { payment_method: 'Visa' }" values: type: array items: $ref: '#/components/schemas/ProductCatalog.PriceValue' description: The price values for this dimension ProductCatalog.Entitlement: type: object required: - name - asset - amount - purpose - lifecycle properties: name: type: string description: The customer facing name of the entitlement examples: - Monthly Credit Allowance asset: type: string description: The custom asset used for the entitlement examples: - CREDITS amount: type: number format: decimal description: The amount of credits received in the entitlement examples: - 1000 purpose: allOf: - $ref: '#/components/schemas/ProductCatalog.EntitlementPurpose' description: The purpose of the entitlement examples: - bundled lifecycle: allOf: - $ref: '#/components/schemas/ProductCatalog.EntitlementLifecycle' description: The lifecycle of the entitlements. accounting: allOf: - $ref: '#/components/schemas/ProductCatalog.EntitlementAccounting' description: How revenue is recorded for this entitlement priority: type: integer format: int16 description: Dictates the consumption order. Lower scores are used first. examples: - 1 ProductCatalog.EntitlementAccounting: type: object required: - revenue_basis - cost_basis properties: revenue_basis: type: number format: decimal description: The amount of revenue "earned" per unit used. examples: - 0 cost_basis: allOf: - $ref: '#/components/schemas/ProductCatalog.CostBasis' description: The internal cost (COGS) to expense per unit used. examples: - auto ProductCatalog.EntitlementLifecycle: type: object required: - duration properties: duration: allOf: - $ref: '#/components/schemas/ProductCatalog.Interval' description: The period the entitlement lasts for or is refreshed examples: - month duration_count: type: integer format: int16 description: The number of duration units. A value of 2 with a month duration means 2 months. Defaults to 1. refresh: allOf: - $ref: '#/components/schemas/ProductCatalog.EntitlementRefresh' description: Whether to refresh the entitlement when the duration ends. Leave null for one-off entitlement. ProductCatalog.EntitlementPurpose: type: string enum: - bundled - promotion ProductCatalog.EntitlementRefresh: type: object required: - strategy properties: strategy: allOf: - $ref: '#/components/schemas/ProductCatalog.EntitlementRefreshStrategy' description: The strategy to use for entitlement refresh examples: - expire_and_replace ProductCatalog.EntitlementRefreshStrategy: type: string enum: - expire_and_replace - rollover ProductCatalog.FixedAssetPricing: type: object required: - asset - values properties: asset: oneOf: - $ref: '#/components/schemas/currency' - type: string description: The currency of the pricing examples: - USD values: type: array items: $ref: '#/components/schemas/ProductCatalog.FixedPriceValue' description: The asset denominated prices description: Defines the pricing for billing in a specific asset or currency ProductCatalog.FixedBillingModelVariant: type: object oneOf: - $ref: '#/components/schemas/ProductCatalog.RecurringBilling' discriminator: propertyName: type mapping: recurring: '#/components/schemas/ProductCatalog.RecurringBilling' ProductCatalog.FixedPrice: type: object required: - type - billing_model - pricing properties: type: type: string enum: - fixed billing_model: allOf: - $ref: '#/components/schemas/ProductCatalog.FixedBillingModelVariant' description: Defines the billing cadence or nature of the charge pricing: type: array items: $ref: '#/components/schemas/ProductCatalog.FixedAssetPricing' description: Fixed price in a fiat currency allOf: - $ref: '#/components/schemas/ProductCatalog.PriceBase' ProductCatalog.FixedPriceValue: type: object required: - unit_price properties: name: type: string description: An optional name for the price value e.g. 'Monthly Subscription' unit_price: type: number description: The fixed price per unit quantity: type: number description: The number of units purchased description: Defines the value of a fixed price ProductCatalog.FundingDestination: type: object required: - address properties: address: type: string description: The account where the funds are collected from examples: - default currency: allOf: - $ref: '#/components/schemas/currency' description: Currency of the funding destination, if it differs from the collection currency exchange_rate: type: number format: decimal description: Optional exchange rate override examples: - 100000 ProductCatalog.GetProductDataResponse: type: object required: - id - code - name properties: id: type: string description: The unique identifier of the product examples: - prp_4e28n8kk41931f5yt5em49ecw7 code: type: string description: A unique code for the product. This can be used when subscribing customers to products. examples: - glitch_video_std name: type: string description: The customer facing name of the product examples: - Glitch Video ProductCatalog.GetProductResponse: type: object required: - id - code - name - default_version - versions properties: id: type: string description: The unique identifier of the product examples: - prp_4e28n8kk41931f5yt5em49ecw7 code: type: string description: A unique code for the product. This can be used when subscribing customers to products. examples: - glitch_video_std name: type: string description: The customer facing name of the product examples: - Glitch Video default_version: type: object properties: version: type: integer format: int16 description: The version number of the product examples: - 2 entitlements: type: array items: $ref: '#/components/schemas/ProductCatalog.Entitlement' description: Right-to-use grants added as part of a bundle or promotion. prices: type: array items: $ref: '#/components/schemas/ProductCatalog.PriceVariant' description: The default version's pricing examples: - - id: prc_4asvwjbgbypk6d9z3xp95ttrc8 name: Video Promotion type: usage_based billing_model: type: real_time usage_calculation: event_type: video_promoted usage_type: unit pricing: - asset: USD values: - unit_price: 0.5 required: - version - entitlements - prices versions: type: array items: $ref: '#/components/schemas/ProductCatalog.ProductVersionReference' description: The product's versions, sorted by newest first examples: - - version: 3 created_at: '2025-10-25T11:36:18Z' status: draft - version: 2 created_at: '2025-10-01T18:24:18Z' status: published - version: 1 created_at: '2025-09-14T09:24:45Z' status: archived description: Returns the details of an existing product ProductCatalog.GetProductVersionResponse: type: object required: - id - version - code - name - prices - entitlements - status - is_default properties: id: type: string description: The unique identifier of the product examples: - prp_4e28n8kk41931f5yt5em49ecw7 version: type: number description: The version of the product examples: - 3 code: type: string description: A unique code for the product. This can be used when subscribing customers to products. examples: - glitch_video_std name: type: string description: The customer facing name of the product examples: - Glitch Video prices: type: array items: $ref: '#/components/schemas/ProductCatalog.PriceVariant' description: The product's pricing examples: - - id: prc_4asvwjbgbypk6d9z3xp95ttrc8 name: Video Promotion type: usage_based billing_model: type: real_time usage_calculation: event_type: video_promoted usage_type: unit pricing: - asset: USD values: - unit_price: 0.5 entitlements: type: array items: $ref: '#/components/schemas/ProductCatalog.Entitlement' description: Right-to-use grants added as part of a bundle or promotion. status: allOf: - $ref: '#/components/schemas/ProductCatalog.ProductVersionStatus' description: The status of the product examples: - draft is_default: type: boolean description: Whether this is the default version of the product examples: - false ProductCatalog.Interval: type: string enum: - day - week - month - year ProductCatalog.InvoiceCollection: type: object required: - type properties: type: type: string enum: - invoice allOf: - $ref: '#/components/schemas/ProductCatalog.CollectionMethodBase' ProductCatalog.ListProductVersionDataResponse: type: object required: - id - code - name - version - created_at - status - is_default - prices properties: id: type: string description: The unique identifier of the product examples: - prp_4e28n8kk41931f5yt5em49ecw7 code: type: string description: A unique code for the product. This can be used when subscribing customers to products. examples: - glitch_video_std name: type: string description: The customer facing name of the product examples: - Glitch Video version: type: integer format: int16 description: The version of the product examples: - 2 created_at: type: string format: date-time description: The date and time the version was created status: allOf: - $ref: '#/components/schemas/ProductCatalog.ProductVersionStatus' description: The status of the product version examples: - published is_default: type: boolean description: Whether this is the default version of the product examples: - true prices: type: array items: $ref: '#/components/schemas/ProductCatalog.PriceVariant' description: The pricing for this product version examples: - - id: prc_4asvwjbgbypk6d9z3xp95ttrc8 name: Video Promotion type: usage_based billing_model: type: real_time usage_calculation: event_type: video_promoted usage_type: unit pricing: - asset: USD values: - unit_price: 0.5 ProductCatalog.OneTimeBilling: type: object required: - type - one_time properties: type: type: string enum: - one_time one_time: type: object properties: service_period: type: string description: ISO 8601-style duration e.g. 'P3M' or 'P90D' for 3 months or 90 days examples: - P6M description: The one-time billing configuration description: Represents a price that is billed once during the subscription period ProductCatalog.PriceBase: type: object required: - name properties: id: type: string description: The unique identifier for the price name: type: string description: Human-readable name for the price collection: allOf: - $ref: '#/components/schemas/ProductCatalog.CollectionMethodVariant' description: How and when the charge is collected description: Defines the billing structure, usage, pricing and collection details ProductCatalog.PriceValue: type: object properties: name: type: string description: An optional name for the price value e.g. 'Visa Cards' unit_price: type: number description: The unit price for unit-based usage pricing volume_rate: type: number description: The rate for volume-based usage pricing package_size: type: integer format: int64 description: Number of volume units per package description: Defines the value of a price ProductCatalog.PriceVariant: type: object oneOf: - $ref: '#/components/schemas/ProductCatalog.UsageBasedPrice' - $ref: '#/components/schemas/ProductCatalog.FixedPrice' discriminator: propertyName: type mapping: usage_based: '#/components/schemas/ProductCatalog.UsageBasedPrice' fixed: '#/components/schemas/ProductCatalog.FixedPrice' ProductCatalog.PricingModel: type: string enum: - flat description: Defines the model used for pricing ProductCatalog.ProductSubscriberResponse: type: object required: - customer_id - customer_name - subscription_id - subscription_status - started_at - product_rate_plan_id - version properties: customer_id: type: string description: The unique identifier of the customer examples: - cust_473cr1y0ghbyc3m1yfbwvn3nxx customer_name: type: string description: The name of the customer examples: - John Doe external_id: type: string description: Your external identifier for the customer examples: - '18991' email: type: string description: The customer's email address examples: - j.doe@example.com subscription_id: type: string description: The unique identifier of the subscription examples: - sub_4e28n8kk41931f5yt5em49ecw7 subscription_status: type: string description: The status of the subscription examples: - active started_at: type: string format: date-time description: When the subscription started renews_at: type: string format: date-time description: When the subscription next renews product_rate_plan_id: type: string description: The ID of the product rate plan the customer is subscribed to examples: - prp_4e28n8kk41931f5yt5em49ecw7 version: type: integer format: int16 description: The version of the product rate plan examples: - 1 ProductCatalog.ProductVersionReference: type: object required: - version - created_at - status properties: version: type: number description: The version of the product examples: - 3 created_at: type: string format: date-time description: The date and time the version was created status: allOf: - $ref: '#/components/schemas/ProductCatalog.ProductVersionStatus' description: The status of the version examples: - draft ProductCatalog.ProductVersionStatus: type: string enum: - draft - published - archived description: Represents the status of a specific product version ProductCatalog.RealTimeBilling: type: object required: - type properties: type: type: string enum: - real_time description: Represents a price that applies to usage ProductCatalog.RecurringBilling: type: object required: - type - recurring properties: type: type: string enum: - recurring recurring: type: object properties: interval: allOf: - $ref: '#/components/schemas/ProductCatalog.Interval' description: The unit of time for the billing cycle examples: - month interval_count: type: integer format: int16 description: 'The number of intervals between billings. For example, `interval: month` and `interval_count: 3` bills every 3 months.' default: 1 required: - interval description: The recurring billing configuration description: Represents a price that is billed on a recurring schedule ProductCatalog.SimulateUsageRequest: type: object required: - events properties: events: type: array items: $ref: '#/components/schemas/UsageEvent' description: The usage events ProductCatalog.SimulateUsageResponse: type: object required: - fees properties: fees: type: array items: $ref: '#/components/schemas/ProductCatalog.CalculatedFee' description: The fees that were calculated for the provided usage events warnings: type: array items: type: string description: Warnings if no fees are returned for a given usage event ProductCatalog.TierBasis: type: string enum: - unit - volume - package - custom ProductCatalog.TierCadence: type: string enum: - lifetime - monthly - quarterly - yearly - custom ProductCatalog.Tiering: type: object properties: basis: allOf: - $ref: '#/components/schemas/ProductCatalog.TierBasis' description: Basis for tiering—required for tiered and bulk models examples: - unit period: allOf: - $ref: '#/components/schemas/ProductCatalog.TierCadence' description: Cadence for resetting tiers. Defaults to billing cadence for recurring payments description: Defines the tiering structure for tiered or bulk pricing models ProductCatalog.UpdateProductVersionRequest: type: object properties: publish: type: boolean description: Whether to publish the product version examples: - true make_default: type: boolean description: Whether to make this the default version of the product. Only published versions can be made default. examples: - true ProductCatalog.UsageBasedAssetPricing: type: object required: - asset - values properties: asset: oneOf: - $ref: '#/components/schemas/currency' - type: string description: The currency or asset of the pricing examples: - USD values: oneOf: - type: array items: $ref: '#/components/schemas/ProductCatalog.PriceValue' - type: array items: $ref: '#/components/schemas/ProductCatalog.DimensionalPrice' description: The asset denominated prices description: Defines the pricing for billing in a specific asset or currency ProductCatalog.UsageBasedBillingModelVariant: type: object oneOf: - $ref: '#/components/schemas/ProductCatalog.RealTimeBilling' discriminator: propertyName: type mapping: real_time: '#/components/schemas/ProductCatalog.RealTimeBilling' ProductCatalog.UsageBasedPrice: type: object required: - type - usage_calculation - billing_model - pricing properties: type: type: string enum: - usage_based usage_calculation: allOf: - $ref: '#/components/schemas/ProductCatalog.UsageCalculation' description: Usage calculation rules for usage-based pricing only billing_model: allOf: - $ref: '#/components/schemas/ProductCatalog.UsageBasedBillingModelVariant' description: Defines the billing cadence or nature of the charge pricing: type: array items: $ref: '#/components/schemas/ProductCatalog.UsageBasedAssetPricing' description: Usage-based pricing in either fiat currencies or custom assets allOf: - $ref: '#/components/schemas/ProductCatalog.PriceBase' ProductCatalog.UsageCalculation: type: object required: - event_type - usage_type properties: event_type: type: string description: The type of event to monitor for usage examples: - support_case_resolved usage_type: allOf: - $ref: '#/components/schemas/ProductCatalog.UsageType' description: How usage is measured examples: - unit volume_field: type: string description: The field that contains the volume amount billable_dimensions: type: array items: type: string description: Dimensions to split usage pricing by e.g. ['payment_method'] description: Defines how usage is calculated for usage-based pricing ProductCatalog.UsageType: type: string enum: - unit - volume - unit_and_volume ProfitabilityStats: type: object required: - gross_revenue - total_costs - net_revenue - margin - currency properties: gross_revenue: type: number description: The total gross revenue from the event examples: - 0.003529 total_costs: type: number description: The total costs from the event examples: - 0.001563 net_revenue: type: number description: The net revenue from the event examples: - 0.001966 margin: type: number description: The margin percentage from the event examples: - 0.5571 currency: type: string description: The currency used for the calculations examples: - USD QuoteAssetRequest: type: object required: - source - amount properties: source: allOf: - $ref: '#/components/schemas/currency' description: The asset used to buy. Initially only currencies are supported examples: - USD amount: type: number format: decimal description: The number of units of the source asset to exchange examples: - 25 exchange_at: type: string format: date-time description: The point in time to perform the exchange. Defaults to now(). Supports historic dates. QuoteAssetResponse: type: object required: - source - source_amount - destination - destination_amount - rate properties: source: allOf: - $ref: '#/components/schemas/currency' description: The asset used to buy examples: - USD source_amount: type: number format: decimal description: The number of units of the source asset to exchange examples: - 25 destination: anyOf: - $ref: '#/components/schemas/currency' - type: string description: The code of the destination asset examples: - VIDGEN destination_amount: type: number format: decimal description: The source amount converted at the quoted rate examples: - 500 rate: type: number format: decimal description: |2- Exchange rate (source -> asset): 1 unit of this asset = X units of source asset. E.g. 0.10 means 1 asset unit costs 0.10 source units. examples: - 0.05 inverse_rate: type: number format: decimal description: |2- Inverse exchange (asset -> source): 1 unit of source asset = X units of this asset. E.g. 100 means 1 source unit buys 100 units. RedirectionType: type: string enum: - return_url - portal RequiredActionType: type: string enum: - payment - payment_method RequiredSubscriptionAction: type: object required: - type - redirect_url properties: type: allOf: - $ref: '#/components/schemas/RequiredActionType' description: The type of action required to activate or reactivate the subscription examples: - payment redirect_url: type: string description: The URL to redirect the customer to in order to resolve the required action examples: - https://billing.credyt.ai/api/sign-in?token=xyz Shared.Versions: type: string enum: - '1.0' - next StartingExchangeRate: type: object required: - source properties: source: allOf: - $ref: '#/components/schemas/currency' description: The source asset used to buy the target asset examples: - USD rate: type: number format: decimal description: |2- Exchange rate (source -> asset): 1 unit of this asset = X units of source asset. Must be specified if `inverse_rate` is omitted. E.g. 0.10 means 1 asset unit costs 0.10 source units. inverse_rate: type: number format: decimal description: |2- Inverse exchange (asset -> source): 1 unit of source asset = X units of this asset. Must be specified if `rate` is omitted. E.g. 100 means 1 source unit buys 100 units. SubscriptionStatus: type: string enum: - active - inactive - scheduled - action_required TaskCustomer: type: object required: - id - name properties: id: type: string description: The unique Credyt identifier for the customer account examples: - cust_473cr1y0ghbyc3m1yfbwvn3nxx name: type: string description: The name of the customer examples: - John Doe external_id: type: string description: Your external identifier for the customer account examples: - '18991' description: Represents the customer associated with a task TaskSortField: type: string enum: - last_updated_at - created_at - total_costs - gross_revenue - margin description: The field to sort tasks by TaskStats: type: object required: - gross_revenue - total_costs - net_revenue - margin - currency - event_count properties: gross_revenue: type: number description: The total gross revenue across all events in the task examples: - 0.003529 total_costs: type: number description: The total costs across all events in the task examples: - 0.001563 net_revenue: type: number description: The net revenue across all events in the task examples: - 0.001966 margin: type: number description: The margin percentage for the task, calculated as net_revenue / gross_revenue of the task's summed totals examples: - 0.5571 currency: type: string description: The currency used for the calculations examples: - USD event_count: type: integer format: int64 minimum: 1 description: The total number of events that make up the task examples: - 3 description: Represents the aggregated profitability stats for a task TaskSummary: type: object required: - id - customer - created_at - last_updated_at - stats properties: id: type: string description: The unique identifier of the task, derived from `{customer_id}:{subject}` examples: - cust_473cr1y0ghbyc3m1yfbwvn3nxx:pod_episode_5f53d23a customer: allOf: - $ref: '#/components/schemas/TaskCustomer' description: The customer associated with the task created_at: type: string format: date-time description: The date and time of the first event in the task last_updated_at: type: string format: date-time description: The date and time of the most recent event in the task stats: allOf: - $ref: '#/components/schemas/TaskStats' description: The aggregated profitability stats for the task description: Represents a task — an aggregation of one or more usage events sharing the same customer and subject TaskVendorCost: type: object required: - id - name - total_costs - currency properties: id: type: string description: The unique Credyt identifier for the vendor examples: - vnd_4kf9v6xp00hzc99rdwr5m97wce name: type: string description: The name of the vendor examples: - OpenAI external_id: type: string description: Your external identifier for the vendor examples: - openai total_costs: type: number description: The total costs incurred from this vendor across all events in the task examples: - 0.001563 currency: type: string description: The currency of the costs examples: - USD description: Represents the cost incurred from a vendor across all events in a task TopUpDestination: type: object required: - asset properties: account_name: type: string description: The name of the wallet account to top-up. Defaults to `default` examples: - default default: default asset: anyOf: - $ref: '#/components/schemas/currency' - type: string description: The asset of the wallet account to top-up. Defaults to the currency of the top-up examples: - IMG_TOKENS exchange_rate: type: number format: decimal description: The exchange rate to use when converting the top-up amount to a customer wallet asset. Defaults to the custom asset's configured exchange rate. examples: - 1000000 TopUpStatus: type: string enum: - initiated - pending - succeeded - failed - expired UpdateCustomerRequest: type: object properties: name: type: string description: The name of the customer examples: - John Doe external_id: type: string description: Your external identifier for the customer account. Must be unique across all customers. examples: - '18991' email: type: string format: email description: The customer's email address examples: - samantha.ritchie@example.com UpdateCustomerSubscriptionProductRequest: type: object required: - version properties: version: anyOf: - type: integer format: int16 - type: string enum: - default description: The version of the product UpdateCustomerSubscriptionRequest: type: object required: - status properties: status: anyOf: - type: string enum: - active - type: string enum: - inactive description: The status of the subscription UsageEvent: type: object required: - id - event_type - occurred_at properties: id: allOf: - $ref: '#/components/schemas/uuid' description: Your unique ID for the usage record. Requests with the same ID will be idempotent. event_type: type: string description: The type of event examples: - message_completed occurred_at: type: string format: date-time description: The UTC date and time that the event occurred. Historical events must be within the acceptable grace period. subject: type: string description: The subject to which this usage event relates. This allows for additional context to be shared within Credyt examples: - chat_5f53d23a4958 description: type: string description: A description of the user that will be displayed to the customer examples: - Chat message completed data: type: object unevaluatedProperties: anyOf: - type: string - type: boolean - type: number description: Additional data associated with the event that may be used as part of pricing calculations to provide additional context examples: - model: gpt-4-1 input_tokens: 2353 output_tokens: 34697 costs: type: array items: $ref: '#/components/schemas/CostData' description: The costs from the vendor associated with this event. description: Represents a product usage event UsageRequest: type: object required: - events properties: customer_id: allOf: - $ref: '#/components/schemas/customerId' description: The customer identifier. Required if `customer_external_id` is omitted. customer_external_id: type: string description: Your identifier for the customer. Required if `customer_id` is omitted. examples: - '123456' events: type: array items: $ref: '#/components/schemas/UsageEvent' description: The usage events examples: - customer_id: cust_473cr1y0ghbyc3m1yfbwvn3nxx events: - id: f35db292-fad3-4c28-90f7-43308bfcda11 event_type: message_completed occurred_at: '2024-01-01T12:00:00Z' subject: chat_5f53d23a4958 description: Chat message completed data: model: gpt-4-1 input_tokens: 2353 output_tokens: 34697 costs: - id: f35db292-fad3-4c28-90f7-43308bfcda11 vendor_external_id: openai description: Cost from OpenAI for input tokens metadata: model: gpt-4-1 token_type: input units: 2353 unit_price: 0.0015 amount: 3.5295 currency: USD ValidationProblem: type: object required: - errors properties: errors: type: object unevaluatedProperties: type: array items: type: string description: A mapping of field names (or parameter paths) to one or more validation error messages. examples: - name: - name is required. allOf: - $ref: '#/components/schemas/ProblemDetails' description: |- Validation problem details aligned with ASP.NET Core's `ValidationProblemDetails`. This extends RFC 7807 `ProblemDetails` with an `errors` bag of `string[]` arrays. ASP.NET Core often returns this for 400/422 validation failures. examples: - type: https://api.credyt.ai/problems/validation-error title: One or more validation errors occurred. status: 422 detail: See the errors property for details. instance: /events errors: name: - name is required. Vendors.CreateVendorRequest: type: object required: - name properties: name: type: string description: The name of the vendor examples: - AI Corp external_id: type: string description: Your external identifier for the vendor. Must be unique across all vendors. examples: - '18991' Vendors.CreateVendorResponse: type: object required: - id - created_at properties: id: type: string description: The unique Credyt identifier for the vendor examples: - vnd_4kf9v6xp00hzc99rdwr5m97wce created_at: type: string format: date-time description: The date and time the vendor was created Vendors.VendorCategoryStats: type: object required: - category - cost properties: category: type: string description: The category for this cost examples: - gpt-5 cost: type: number description: The cost by category examples: - 0.001563 description: Represents category stats for a vendor Vendors.VendorStats: type: object required: - total_costs - categories properties: total_costs: type: number description: The total costs for this vendor examples: - 0.001563 categories: type: array items: $ref: '#/components/schemas/Vendors.VendorCategoryStats' description: The cost breakdown by category description: Represents stats for a vendor Vendors.VendorSummary: type: object required: - id - name - created_at properties: id: type: string description: The unique Credyt identifier for the vendor examples: - vnd_4kf9v6xp00hzc99rdwr5m97wce external_id: type: string description: Your external identifier for the vendor examples: - '18991' name: type: string description: The name of the vendor examples: - AI Corp created_at: type: string format: date-time description: The date and time the vendor was created description: Represents a vendor Versions: type: string enum: - '1.0' - next Wallets.AdjustmentReason: type: string enum: - gift - external_topup - external_refund - other Wallets.CreateAdjustmentRequest: type: object required: - transaction_id - asset - amount - reason properties: transaction_id: allOf: - $ref: '#/components/schemas/uuid' description: The unique ID for the adjustment transaction. Requests with the same ID will be idempotent. account_name: type: string description: The name of the account to make the adjustment against examples: - default default: default asset: type: string description: The asset of the adjustment examples: - USD amount: type: number format: decimal description: The adjustment amount. Specify a positive amount to credit the account and a negative amount to debit the account. examples: - 25 description: type: string description: A description that will be displayed to the customer examples: - Monthly Subscription reason: allOf: - $ref: '#/components/schemas/Wallets.AdjustmentReason' description: The reason for the adjustment examples: - external_topup effective_at: type: string format: date-time description: For credit adjustments, the UTC date and time when the generated credit grant will be effective from. expires_at: type: string format: date-time description: For credit adjustments, the UTC date and time when the generated credit grant will expire. metadata: type: object unevaluatedProperties: type: string description: Additional context about the adjustment examples: - psp: stripe payment_intent: pi_3RjbbNJNSIruR1rb0GwMGpH0 description: Represents a request for an adjustment to an account's balance Wallets.CreateAdjustmentResponse: type: object required: - id - created_at properties: id: allOf: - $ref: '#/components/schemas/uuid' description: Your unique ID for the adjustment transaction. Requests with the same ID will be idempotent. created_at: type: string format: date-time description: The UTC date and time that the transaction was created Wallets.CreateChargeRequest: type: object required: - transaction_id - asset - amount properties: transaction_id: allOf: - $ref: '#/components/schemas/uuid' description: Your unique ID for the charge transaction. Requests with the same ID will be idempotent. account_name: type: string description: The name of the account to make the adjustment against examples: - default default: default asset: type: string description: The asset of the adjustment examples: - USD subject: type: string description: The subject to which this charge relates. This allows for additional context to be shared within Credyt examples: - chat_5f53d23a4958 description: type: string description: A description that will be displayed to the customer examples: - Overage costs for GPT-4 usage metadata: type: object unevaluatedProperties: type: string description: Additional context about the charge examples: - model: gpt-4-1 input_units: anyOf: - type: number - type: 'null' description: The number of units used for calculation examples: - null input_volume: anyOf: - type: number - type: 'null' description: The volume used for calculation examples: - 2652000 unit_price: anyOf: - type: number - type: 'null' description: The unit price for unit-based usage pricing examples: - null volume_rate: anyOf: - type: number - type: 'null' description: The rate for volume-based usage pricing examples: - 0.5 package_size: anyOf: - type: integer format: int64 - type: 'null' description: Number of volume units per package examples: - 1000000 amount: type: number format: decimal description: The charge amount exclusiveMinimum: 0 examples: - 1.326 Wallets.CreateChargeResponse: type: object Wallets.CreditGrantItem: type: object required: - id - available - effective_at - expires_at - purpose - created_at properties: id: type: string description: The unique ID of the credit grant examples: - grant_73571f88-efc9-11f0-8c35-00155d3a0bdc available: type: number description: Available balance examples: - 100.5 effective_at: type: string format: date-time description: The UTC date and time that the credit grant is effective from expires_at: type: string format: date-time description: The UTC date and time that the credit grant expires purpose: type: string description: The purpose of the credit grant examples: - top_up created_at: type: string format: date-time description: The UTC date and time the credit grant was created description: Represents a credit grant associated with a wallet account Wallets.GetAccountDetailsResponse: type: object required: - pending_in - pending_out properties: pending_in: type: number format: decimal description: Pending incoming transactions examples: - 500 pending_out: type: number format: decimal description: Pending outgoing transactions examples: - 100 allOf: - $ref: '#/components/schemas/Wallets.WalletAccountSummary' Wallets.GetTransactionResponse: type: object required: - id - type - account_id - asset - amount - created_at properties: id: allOf: - $ref: '#/components/schemas/uuid' description: The unique ID of the adjustment transaction type: allOf: - $ref: '#/components/schemas/Wallets.TransactionType' description: The type of transaction examples: - adjustment account_id: type: string description: The ID of the account the transaction was executed against examples: - default:usd asset: type: string description: The asset of the adjustment examples: - USD amount: type: number format: decimal description: The transaction amount examples: - 10000 description: type: string description: A description that will be displayed to the customer examples: - Monthly Subscription metadata: type: object unevaluatedProperties: type: string description: Additional context about the transaction examples: - psp: stripe payment_intent: pi_3RjbbNJNSIruR1rb0GwMGpH0 created_at: type: string format: date-time description: The UTC date and time that the transaction was created executed_at: anyOf: - type: string format: date-time - type: 'null' description: The UTC data and time that the transaction was executed, if not pending Wallets.GetWalletResponse: type: object required: - accounts properties: accounts: type: array items: $ref: '#/components/schemas/Wallets.WalletAccountSummary' description: The asset accounts within the customer's wallet examples: - accounts: - id: default:usd name: default asset: USD available: 14.566678 - id: default:tok name: default asset: TOK available: 993450234 Wallets.TransactionType: type: string enum: - adjustment - fee Wallets.WalletAccountSummary: type: object required: - id - name - asset - available properties: id: type: string description: The ID of the account within the wallet examples: - default:usd name: type: string description: The name of the account examples: - default asset: anyOf: - $ref: '#/components/schemas/currency' - type: string description: The currency of asset the account holds examples: - USD available: type: number format: decimal description: The available balance examples: - 14.566678 description: Provides a summary of a wallet asset account Webhooks.TestWebhookResponse: type: object required: - id properties: id: type: string description: The ID of the test event that was created description: Response for testing a webhook destination currency: type: string minLength: 3 maxLength: 3 description: An ISO 3166 Alpha-3 Currency Code examples: - USD customerId: type: string description: The customer identifier examples: - cust_473cr1y0ghbyc3m1yfbwvn3nxx uuid: type: string format: uuid securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-CREDYT-API-KEY servers: - url: https://api.credyt.ai description: Production variables: {} - url: https://api.dev.credyt.ai description: Dev variables: {}