openapi: 3.1.0 info: title: Credyt API version: '1.0' tags: - name: Customers - name: Events - name: Product Catalog - name: Assets - name: Wallets - name: Top-ups - name: Billing Portal - name: Vendors - name: Accounts - name: Webhooks paths: /accounts: post: operationId: AccountOps_createAccount 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/Accounts.CreateAccountResponse' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Access is 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/Accounts.CreateAccountRequest' get: operationId: AccountOps_listAccounts 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/Accounts.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/Accounts.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 '303': description: Redirection headers: location: required: true description: The Location header contains the URL where the status of the long running operation can be checked. schema: type: string tags: - Accounts /accounts/{accountId}: get: operationId: AccountOps_getAccount 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/Accounts.ConnectedAccount' '401': description: Access is unauthorized. '404': description: The server cannot find the requested resource. tags: - Accounts /assets: post: operationId: AssetsOps_createAsset 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/Assets.CreateAssetResponse' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Access is 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/Assets.CreateAssetRequest' get: operationId: AssetsOps_listAssets 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/Assets.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: AssetsOps_getAsset 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/Assets.GetAssetResponse' '401': description: Access is unauthorized. '404': description: The server cannot find the requested resource. tags: - Assets /assets/{assetCode}/quote: post: operationId: AssetsOps_quoteAsset 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/Assets.QuoteAssetResponse' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Access is 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/Assets.QuoteAssetRequest' /assets/{assetCode}/rates: post: operationId: AssetsOps_addAssetRate 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: Access is 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/Assets.AddAssetRateRequest' /billing-portal/sessions: post: operationId: BillingPortal_create_portal_session summary: Create a portal session description: Creates a new session for the customer billing portal. 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/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: Access is 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' /customers: post: operationId: CustomersOps_createCustomer 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/Customers.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: pending 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: Access is 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/Customers.CreateCustomerRequest' example: name: John Doe external_id: '18991' email: j.doe@gmail.com subscriptions: - products: - code: glitch_payg get: operationId: CustomersOps_listCustomers summary: List customers description: Returns a paged list of customers parameters: - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.offset' - $ref: '#/components/parameters/Credyt.Shared.PagingParameters.limit' - $ref: '#/components/parameters/Customers.ListCustomersParams.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/Customers.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 '303': description: Redirection headers: location: required: true description: The Location header contains the URL where the status of the long running operation can be checked. schema: type: string tags: - Customers /customers/{customerId}: get: operationId: CustomersOps_getCustomer 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/Customers.GetCustomerResponse' '401': description: Access is unauthorized. '404': description: The server cannot find the requested resource. tags: - Customers patch: operationId: CustomersOps_updateCustomer 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: Access is unauthorized. '404': description: The server cannot find the requested resource. '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Customers requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Customers.UpdateCustomerRequest' /customers/{customerId}/subscriptions: post: operationId: CustomersOps_createProductSubscription 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/Customers.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: pending 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: Access is 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/Customers.CreateCustomerSubscription' /customers/{customerId}/subscriptions/{subscriptionId}: patch: operationId: CustomersOps_updateCustomerSubscription 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: Access is unauthorized. '404': description: The server cannot find the requested resource. '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Customers requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Customers.UpdateCustomerSubscriptionRequest' /customers/{customerId}/subscriptions/{subscriptionId}/products/{productId}: patch: operationId: CustomersOps_updateCustomerSubscriptionProduct 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: Access is unauthorized. '404': description: The server cannot find the requested resource. '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Customers requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Customers.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' '401': description: Access is unauthorized. '404': description: The server cannot find the requested resource. 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' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Access is 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' /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: Access is 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' /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: Access is unauthorized. '404': description: The server cannot find the requested resource. 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' '401': description: Access is unauthorized. '404': description: The server cannot find the requested resource. 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 '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: The server cannot find the requested resource. tags: - Wallets /events: post: operationId: EventOps_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: Access is 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/Events.UsageRequest' description: The customer usage data get: operationId: EventOps_listEvents 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/Events.ListEventsParams.customer_id' - $ref: '#/components/parameters/Events.ListEventsParams.customer_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/Events.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: EventOps_getEvent 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/Events.GetEventResponse' '401': description: Access is unauthorized. '404': description: The server cannot find the requested resource. tags: - Events /products: post: operationId: ProductOps_createProduct 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' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Access is 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: 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 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_std 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 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 get: operationId: ProductOps_listProducts 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 '303': description: Redirection headers: location: required: true description: The Location header contains the URL where the status of the long running operation can be checked. schema: type: string tags: - Product Catalog /products/{productId}: get: operationId: ProductOps_getProduct 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: Access is unauthorized. '404': description: The server cannot find the requested resource. tags: - Product Catalog delete: operationId: ProductOps_deleteProduct 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: Access is unauthorized. '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Product Catalog post: operationId: ProductOps_createProductVersion 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: Access is 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}/{version}: get: operationId: ProductOps_getProductVersion 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: Access is unauthorized. '404': description: The server cannot find the requested resource. tags: - Product Catalog patch: operationId: ProductOps_updateProductVersion 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: Access is unauthorized. '409': description: The request conflicts with the current state of the server. '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: ProductOps_archiveProductVersion 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: Access is unauthorized. '422': description: Client error content: application/json: schema: $ref: '#/components/schemas/ValidationProblem' tags: - Product Catalog /products/{productId}/{version}/simulate-usage: post: operationId: ProductOps_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: Access is 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' /top-ups: post: operationId: TopUpsOps_initiateTopUp 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/TopUps.InitiateTopUpResponse' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Access is 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/TopUps.InitiateTopUpRequest' /top-ups/{topUpId}: get: operationId: TopUpsOps_getTopUp 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/TopUps.GetTopUpResponse' '401': description: Access is unauthorized. '404': description: The server cannot find the requested resource. 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' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Access is 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' 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 '303': description: Redirection headers: location: required: true description: The Location header contains the URL where the status of the long running operation can be checked. schema: type: string 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: Access is unauthorized. '404': description: The server cannot find the requested resource. 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' '400': description: The server could not understand the request due to invalid syntax. content: application/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Access is 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' 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: Access is 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: - models - pagination properties: models: 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: Access is 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: Access is unauthorized. '404': description: The server cannot find the requested resource. 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: Access is unauthorized. '404': description: The server cannot find the requested resource. 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: Access is unauthorized. '404': description: The server cannot find the requested resource. 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: Access is 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: Access is 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' '401': description: Access is unauthorized. '404': description: The server cannot find the requested resource. 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: Access is unauthorized. '404': description: The server cannot find the requested resource. tags: - Webhooks requestBody: required: true content: application/json: schema: {} security: - ApiKeyAuth: [] components: parameters: Accounts.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 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 Customers.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 Events.ListEventsParams.customer_external_id: name: customer_external_id in: query required: false description: The external ID of the customer to filter by schema: $ref: '#/components/schemas/customerId' explode: false Events.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 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.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: Accounts.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: - {} Accounts.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' Accounts.CreateAccountResponse: type: object required: - id properties: id: type: string description: The unique Credyt identifier for the connected account examples: - acc_46acd5z09yd5hb0f8adfwtd3cw Assets.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 Assets.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: - 📹 Assets.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. Assets.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/Assets.AssetExchangeRate' minItems: 1 description: The rates for exchanging between the source asset and the target Assets.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/Assets.StartingExchangeRate' description: The starting exchange rates for the asset Assets.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 Assets.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/Assets.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 Assets.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 Assets.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. Assets.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. Assets.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. 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 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 - destination_id - topic - time - data properties: id: type: string description: The unique identifier for the event examples: - evt_123abc destination_id: type: string description: The ID of the destination this event was sent to 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 Customers.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/Customers.CreateCustomerSubscription' description: The customer's product subscriptions examples: - - products: - code: glitch_video_std external_accounts: type: array items: $ref: '#/components/schemas/Customers.ExternalAccount' description: External account mappings for the customer (currently only Stripe is supported) examples: - - provider: stripe provider_id: cus_T3jj3gnc7RO23u Customers.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/Customers.CustomerSubscription' description: The created customer subscriptions. You should check the state of each subscription to determine if further action is required. Customers.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/Customers.CustomerSubscriptionProduct' minItems: 1 description: The products the customer is subscribing to Customers.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/Customers.SubscriptionStatus' description: The status of the subscription products: type: array items: $ref: '#/components/schemas/Customers.CustomerSubscriptionProduct' minItems: 1 description: The products the customer is subscribing to required_actions: type: array items: $ref: '#/components/schemas/Customers.RequiredSubscriptionAction' description: Actions required to activate or reactivate the subscription Customers.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 Customers.CustomerSummary: type: object required: - id - name 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 description: Represents a customer Customers.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 Customers.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/Customers.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/Customers.ExternalAccount' description: The customer's external account mappings allOf: - $ref: '#/components/schemas/Customers.CustomerSummary' Customers.RequiredSubscriptionAction: type: object required: - type - redirect_url properties: type: type: string enum: - payment 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 Customers.SubscriptionStatus: type: string enum: - active - inactive - pending Customers.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 Customers.UpdateCustomerSubscriptionProductRequest: type: object required: - version properties: version: anyOf: - type: integer format: int16 - type: string enum: - default description: The version of the product Customers.UpdateCustomerSubscriptionRequest: type: object required: - status properties: status: anyOf: - type: string enum: - active - type: string enum: - inactive description: The status of the subscription Events.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 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 Events.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 Events.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/Events.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/Events.EventFee' minItems: 0 description: The fees resulting from the usage event stats: allOf: - $ref: '#/components/schemas/Events.ProfitabilityStats' description: The profitability stats for the usage event Events.ListEventsItem: type: object required: - id - customer_id - event_type - occurred_at - created_at 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' 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 stats: allOf: - $ref: '#/components/schemas/Events.ProfitabilityStats' description: The profitability stats for the usage event Events.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 Events.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/Events.CostData' description: The costs from the vendor associated with this event. description: Represents a product usage event Events.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/Events.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 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.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 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: 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.FixedAssetPricing: 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: 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: Usage-based pricing in either fiat currencies or custom assets 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 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 - 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 - 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 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: - month ProductCatalog.InvoiceCollection: type: object required: - type properties: type: type: string enum: - invoice allOf: - $ref: '#/components/schemas/ProductCatalog.CollectionMethodBase' 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 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.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/Events.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 Shared.Versions: type: string enum: - '1.0' - next TopUps.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/TopUps.TopUpDestination' description: The destination wallet account to top-up status: allOf: - $ref: '#/components/schemas/TopUps.TopUpStatus' description: The status of the top-up TopUps.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/TopUps.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 TopUps.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/TopUps.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 TopUps.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 TopUps.TopUpStatus: type: string enum: - initiated - pending - succeeded - failed - expired 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.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: {}