Skip to content

feat:Remove payment endpoints and add error handling schemas#258

Merged
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202603121548
Mar 12, 2026
Merged

feat:Remove payment endpoints and add error handling schemas#258
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202603121548

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Mar 12, 2026

Summary by CodeRabbit

  • Breaking Changes

    • Removed payment management endpoints and associated functionality, including billing portal access, usage tracking, fund management, and topup operations
  • Refactor

    • Restructured API error handling with standardized validation error responses
    • Enhanced account checklist schema to better track payment status, suspension reasons, and billing information

@HavenDV HavenDV enabled auto-merge (squash) March 12, 2026 15:48
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Walkthrough

The PR restructures the DeepInfra OpenAPI specification by removing payment-related endpoints and schemas (approximately 772 lines) while introducing standardized error handling schemas (HTTPValidationError, ValidationError) and a Checklist schema for account status management (approximately 108 lines).

Changes

Cohort / File(s) Summary
OpenAPI Specification Update
src/libs/DeepInfra/openapi.yaml
Removal of payment endpoints under /payment/*, config/syndication operations, and associated schemas (AddFundsIn, BillingPortalOut, TopUpIn, etc.); introduction of standardized error handling schemas (HTTPValidationError, ValidationError) and Checklist schema with fields for account status flags (suspended, overdue_invoices, stripe_balance, topup_threshold).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Out with the payments, old and worn,
New schemas rise like dawn reborn!
HTTPErrors, Checklists clean,
The API spec's a dream serene!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title Check ✅ Passed Title check skipped as CodeRabbit has written the PR title.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202603121548
📝 Coding Plan for PR comments
  • Generate coding plan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HavenDV HavenDV merged commit 0c728e7 into main Mar 12, 2026
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202603121548 branch March 12, 2026 15:50
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Remove payment endpoints and add error handling schemas Mar 12, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/libs/DeepInfra/openapi.yaml`:
- Around line 5152-5201: The OpenAPI change made Checklist.limit and
Checklist.suspend_reason required, but the generated model still has nullable
types; regenerate the SDK from the updated openapi.yaml (or update the generated
model class DeepInfra.Models.Checklist) so that the Limit property is a
non-nullable number (e.g., change public double? Limit to public double Limit)
and SuspendReason is non-nullable (remove nullable wrapper so SuspendReason is
not nullable), and ensure constructors/deserialization/validation reflect these
fields as required rather than optional.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9e234760-b765-47ec-ac85-2fae0e95fc8b

📥 Commits

Reviewing files that changed from the base of the PR and between 01dde0e and 0a6710e.

⛔ Files ignored due to path filters (108)
  • src/libs/DeepInfra/Generated/DeepInfra..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AddFunds.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.BillingPortal.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeepstartApply.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetChecklist.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetConfig.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetConfig.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetupTopup.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Usage.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageApiToken.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageRent.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageTokens.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AddFunds.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.BillingPortal.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeepstartApply.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetChecklist.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetConfig.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetConfig.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetupTopup.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Usage.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageApiToken.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageRent.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageTokens.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/DeepInfra/openapi.yaml

Comment on lines +5152 to +5201
Checklist:
title: Checklist
required:
- stripe_balance
- recent
- limit
- suspend_reason
type: object
properties:
email:
title: Email
type: boolean
default: false
billing_address:
title: Billing Address
type: boolean
default: false
payment_method:
title: Payment Method
type: boolean
default: false
suspended:
title: Suspended
type: boolean
default: false
overdue_invoices:
title: Overdue Invoices
type: number
default: 0.0
last_checked:
title: Last Checked
type: integer
default: 0
stripe_balance:
title: Stripe Balance
type: number
description: Negative value indicates funds ready-to-spend. Positive value indicates money owed
recent:
title: Recent
type: number
description: usage since most recent invoice
limit:
title: Limit
anyOf:
- type: number
- type: 'null'
suspend_reason:
anyOf:
- $ref: '#/components/schemas/SuspendReason'
- type: 'null'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

wc -l src/libs/DeepInfra/openapi.yaml

Repository: tryAGI/DeepInfra

Length of output: 96


🏁 Script executed:

# Check the Checklist schema around lines 5152-5201
sed -n '5150,5210p' src/libs/DeepInfra/openapi.yaml

Repository: tryAGI/DeepInfra

Length of output: 1652


🏁 Script executed:

# Check the SuspendReason schema around lines 8766-8775
sed -n '8760,8780p' src/libs/DeepInfra/openapi.yaml

Repository: tryAGI/DeepInfra

Length of output: 608


🏁 Script executed:

# Check the generated C# files to see their current state
if [ -f src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs ]; then
  echo "=== Checklist.g.cs ===" 
  wc -l src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs
  cat -n src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs | head -100
fi

Repository: tryAGI/DeepInfra

Length of output: 4254


🏁 Script executed:

# Check SuspendReason generated C# file
if [ -f src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs ]; then
  echo "=== SuspendReason.g.cs ===" 
  wc -l src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs
  cat -n src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs
fi

Repository: tryAGI/DeepInfra

Length of output: 2729


🏁 Script executed:

# Check if there's a script or documentation about regenerating the SDK
fd -e ps1 -e sh -e py "codegen\|generate\|build" src/libs/DeepInfra/ 2>/dev/null | head -20

Repository: tryAGI/DeepInfra

Length of output: 42


🏁 Script executed:

# Look for any README or scripts in the DeepInfra directory
ls -la src/libs/DeepInfra/ | grep -E "README|script|build|generate"

Repository: tryAGI/DeepInfra

Length of output: 122


🏁 Script executed:

cat src/libs/DeepInfra/generate.sh

Repository: tryAGI/DeepInfra

Length of output: 618


Regenerate the checked-in SDK for the updated Checklist contract.

Lines 5154-5158 make limit and suspend_reason required fields. The generated src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs still marks these as optional: Limit on line 65 is public double? Limit and SuspendReason on line 71 is public global::DeepInfra.SuspendReason? SuspendReason, when both should be required per the updated schema.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/DeepInfra/openapi.yaml` around lines 5152 - 5201, The OpenAPI change
made Checklist.limit and Checklist.suspend_reason required, but the generated
model still has nullable types; regenerate the SDK from the updated openapi.yaml
(or update the generated model class DeepInfra.Models.Checklist) so that the
Limit property is a non-nullable number (e.g., change public double? Limit to
public double Limit) and SuspendReason is non-nullable (remove nullable wrapper
so SuspendReason is not nullable), and ensure
constructors/deserialization/validation reflect these fields as required rather
than optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant