Skip to content

Conversation

@wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Jan 8, 2026

Update API specifications by running fern api update.


🔄 This PR updates API specifications by running the fern api update command to synchronize the project's API definitions with the latest schema changes. The update ensures that the API documentation and generated code remain consistent with current specifications.

🔍 Detailed Analysis

Key Changes

  • API Specification Update: Automated update of API specifications using Fern's tooling
  • Schema Synchronization: Ensures API definitions are aligned with the latest schema requirements
  • Documentation Refresh: Updates generated API documentation to reflect current specifications

Technical Implementation

flowchart TD
    A[Fern API Update Command] --> B[Schema Validation]
    B --> C[Specification Files Updated]
    C --> D[Generated Code Refresh]
    D --> E[Documentation Sync]
    E --> F[API Consistency Maintained]
Loading

Impact

  • API Consistency: Maintains alignment between API specifications and implementation
  • Documentation Accuracy: Ensures API documentation reflects the most current schema
  • Developer Experience: Provides up-to-date API definitions for client generation and integration

Created with Palmier


Important

Update API specifications with new billing endpoints and schemas, and update geographic proxy options.

  • API Endpoints:
    • Added /api/v1/billing/checkout for creating Stripe Checkout Sessions.
    • Added /api/v1/billing/portal for creating Stripe Customer Portal sessions.
    • Added /api/v1/billing/state for retrieving organization billing state.
    • Added /api/v1/billing/change-tier for changing subscription tiers.
  • Schemas:
    • Added BillingStateResponse, ChangeTierRequest, ChangeTierResponse, CheckoutSessionResponse, and CheckoutSubscriptionRequest.
    • Added PersistentBrowserType and PlanTier enums.
  • Misc:
    • Updated geographic proxy options to include RESIDENTIAL_PH and deprecated some US state options.

This description was created by Ellipsis for 9fd9720. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • New Features
    • Billing management: Added checkout session creation, portal access, billing state retrieval, and subscription tier changes.
    • Browser type identification now available in session responses.
    • Step count tracking added to task and workflow run responses.
    • Extended proxy location support with Philippines.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Walkthrough

The OpenAPI schema adds comprehensive billing functionality with four new endpoints (checkout, portal, state, change-tier), introduces seven new billing-related schemas, extends existing response types with browser and run step metadata, and expands the proxy location options with Philippines support.

Changes

Cohort / File(s) Summary
Billing API Endpoints
fern/openapi/skyvern_openapi.json
Added /api/v1/billing/checkout, /api/v1/billing/portal, /api/v1/billing/state, and /api/v1/billing/change-tier endpoints enabling subscription management, portal access, billing state retrieval, and tier changes
Billing Response & Request Schemas
fern/openapi/skyvern_openapi.json
Introduced CheckoutSessionResponse, CheckoutSubscriptionRequest, PortalSessionResponse, BillingStateResponse, ChangeTierRequest, ChangeTierResponse, and PlanTier enum for billing operations
Run Response Enhancements
fern/openapi/skyvern_openapi.json
Added step_count field to TaskRunResponse and WorkflowRunResponse to expose step metrics in run result schemas
Browser & Type Definitions
fern/openapi/skyvern_openapi.json
Extended BrowserSessionResponse with nullable browser_type field; introduced PersistentBrowserType enum
Proxy Location Extension
fern/openapi/skyvern_openapi.json
Expanded ProxyLocation enum to include RESIDENTIAL_PH (Philippines) with deprecation guidance

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Billing API
    participant Payment Provider
    participant Database

    rect rgb(200, 220, 240)
    Note over Client,Database: Checkout Flow
    Client->>Billing API: POST /api/v1/billing/checkout<br/>(CheckoutSubscriptionRequest)
    Billing API->>Payment Provider: Create checkout session
    Payment Provider-->>Billing API: Session ID & URL
    Billing API->>Database: Store session metadata
    Billing API-->>Client: CheckoutSessionResponse
    end

    rect rgb(220, 240, 200)
    Note over Client,Database: Portal Flow
    Client->>Billing API: POST /api/v1/billing/portal
    Billing API->>Payment Provider: Create portal session
    Payment Provider-->>Billing API: Portal URL
    Billing API-->>Client: PortalSessionResponse
    end

    rect rgb(240, 220, 200)
    Note over Client,Database: Change Tier Flow
    Client->>Billing API: POST /api/v1/billing/change-tier<br/>(ChangeTierRequest)
    Billing API->>Database: Validate current tier & new PlanTier
    Database-->>Billing API: Tier validation result
    Billing API->>Payment Provider: Update subscription tier
    Payment Provider-->>Billing API: Confirmation
    Billing API->>Database: Persist new tier
    Billing API-->>Client: ChangeTierResponse
    end
Loading
sequenceDiagram
    participant Client
    participant Billing State API
    participant Database

    rect rgb(240, 240, 220)
    Note over Client,Database: Retrieve Billing State
    Client->>Billing State API: GET /api/v1/billing/state
    Billing State API->>Database: Query current billing state
    Database-->>Billing State API: BillingStateResponse data
    Billing State API-->>Client: BillingStateResponse
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • suchintan

Poem

🐰 Hop and cheer, new billing's here!
Checkout paths and tiers so clear,
Stripe-bound flows in schema bright,
Step counts tracking every flight,
Philippines joins the proxy night! 🌍

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive phrasing like 'fern api update' that doesn't convey meaningful information about the specific changes made to the OpenAPI specification. Consider a more specific title that highlights the main changes, such as 'Add billing APIs and enhance run responses with step count' or 'Update OpenAPI spec with billing endpoints and new fields'.
✅ Passed checks (2 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.

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


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.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 9fd9720 in 2 minutes and 31 seconds. Click for details.
  • Reviewed 563 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. fern/openapi/skyvern_openapi.json:2953
  • Draft comment:
    The 'x-api-key' header parameter is duplicated in multiple endpoints. Consider extracting it as a reusable component to reduce repetition.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% This is a code quality refactor suggestion, which according to the rules can be good if actionable and clear. The suggestion is clear and actionable - extract the x-api-key parameter into the components section and reference it. However, I need to consider: 1) This is an OpenAPI JSON file that might be auto-generated from code, in which case manual edits would be overwritten. 2) The duplication already exists in the file (likely in other endpoints not shown in the diff), so this isn't introducing new technical debt, just continuing an existing pattern. 3) The comment is about code that was added in this PR (the new billing endpoints), so it is about changes. 4) While the suggestion is valid, it's not critical - the duplication doesn't cause functional issues. This OpenAPI file is likely auto-generated from Python code (given the operationId format like "create_checkout_session_api_v1_billing_checkout_post"), so manual edits to extract common parameters might be overwritten. Also, if this pattern already exists throughout the file, singling out these new endpoints seems inconsistent unless the entire file is refactored. The comment is technically correct and the suggestion is valid for OpenAPI best practices. However, given that this appears to be an auto-generated file and the duplication pattern likely exists throughout the entire specification (not just in the new endpoints), this comment may not be actionable without broader changes to how the OpenAPI spec is generated. The PR author likely doesn't manually edit this file. This comment should be deleted. While the suggestion is technically valid, the OpenAPI file appears to be auto-generated (based on the operation ID naming convention), making manual refactoring impractical. Additionally, if this duplication pattern exists throughout the file, addressing it only for these new endpoints would be inconsistent without a broader refactoring effort.
2. fern/openapi/skyvern_openapi.json:5332
  • Draft comment:
    In ChangeTierResponse, the 'tier' property is defined as a generic string. For consistency with ChangeTierRequest (which references PlanTier), consider referencing the PlanTier enum instead.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. fern/openapi/skyvern_openapi.json:5548
  • Draft comment:
    The 'browser_type' property is added in multiple schemas with identical definitions. If they represent the same concept, consider consolidating them into a single reusable schema for consistency.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_SKIgXsAvN0zbu7Zn

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

"/api/v1/billing/checkout": {
"post": {
"summary": "Create Checkout Session",
"description": "Create a Stripe Checkout Session for subscribing to a tier.\n\nFrontend should redirect the user to the returned URL.\nAfter successful checkout, Stripe will send a webhook that we handle\nto store the subscription and initialize billing state.\n\nReturns 400 if org already has an active subscription (use portal instead).",
Copy link
Contributor

Choose a reason for hiding this comment

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

The /api/v1/billing/checkout endpoint description mentions returning a 400 error if the organization already has an active subscription, but no 400 response is defined. Please update either the description or add a 400 response.

Copy link
Contributor

@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

🤖 Fix all issues with AI agents
In @fern/openapi/skyvern_openapi.json:
- Around line 2953-3175: The
create_checkout_session_api_v1_billing_checkout_post operation documents a 400
behavior but lacks a 400 response entry—add a "400" response object (e.g.,
description and application/json schema or a reference to an existing error
schema) under the "/api/v1/billing/checkout" POST responses so generated
clients/docs include it; and change the ChangeTierResponse.tier field from a
plain "string" to use $ref: "#/components/schemas/PlanTier" so it matches
ChangeTierRequest.tier and provides strong typing. Apply the same 400-response
addition and PlanTier ref fix to other duplicated billing endpoint/schema
instances noted in the review.
🧹 Nitpick comments (1)
fern/openapi/skyvern_openapi.json (1)

5548-5557: BrowserSessionResponse.browser_type is well-typed; consider clarifying default semantics

The nullable browser_type referencing PersistentBrowserType is sound and keeps backwards compatibility. If there is a de-facto default (e.g., current browser engine when null), consider documenting that so SDK consumers know what to assume when the field is absent/null.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66d28bb and 9fd9720.

📒 Files selected for processing (1)
  • fern/openapi/skyvern_openapi.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Run tests and pre-commit hooks
  • GitHub Check: Analyze (python)
🔇 Additional comments (3)
fern/openapi/skyvern_openapi.json (3)

3504-3514: New screenshot_artifact_id on Action looks consistent

Optional screenshot_artifact_id matches other *_id fields (string or null) and is not added to required, so it’s backward compatible for existing clients.


6341-6377: Proxy geotargeting + RESIDENTIAL_PH wiring looks correct

RESIDENTIAL_PH is added to ProxyLocation and consistently referenced in the proxy_location descriptions for CreateBrowserSessionRequest, TaskRunRequest, and WorkflowRunRequest. All three descriptions stay in sync and remain backwards compatible (field is still optional / accepts previous enum values).

Also applies to: 12016-12045, 13549-13568, 17478-17497


14014-14025: step_count on run responses is backwards compatible and useful

Adding nullable step_count to TaskRunResponse and WorkflowRunResponse is safe (not in required) and gives clients a straightforward way to introspect run complexity. No schema issues spotted.

Also applies to: 17882-17893

Comment on lines +2953 to 3175
"/api/v1/billing/checkout": {
"post": {
"summary": "Create Checkout Session",
"description": "Create a Stripe Checkout Session for subscribing to a tier.\n\nFrontend should redirect the user to the returned URL.\nAfter successful checkout, Stripe will send a webhook that we handle\nto store the subscription and initialize billing state.\n\nReturns 400 if org already has an active subscription (use portal instead).",
"operationId": "create_checkout_session_api_v1_billing_checkout_post",
"parameters": [
{
"name": "x-api-key",
"in": "header",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings.",
"title": "X-Api-Key"
},
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CheckoutSubscriptionRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CheckoutSessionResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/billing/portal": {
"post": {
"summary": "Create Portal Session",
"description": "Create a Stripe Customer Portal session for managing subscription.\n\nFrontend should redirect the user to the returned URL.\nThe portal allows users to:\n- Update payment methods\n- Upgrade/downgrade plans\n- Cancel subscription\n- View invoices",
"operationId": "create_portal_session_api_v1_billing_portal_post",
"parameters": [
{
"name": "x-api-key",
"in": "header",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings.",
"title": "X-Api-Key"
},
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings."
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PortalSessionResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/billing/state": {
"get": {
"summary": "Get Organization Billing",
"operationId": "get_organization_billing_api_v1_billing_state_get",
"parameters": [
{
"name": "x-api-key",
"in": "header",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings.",
"title": "X-Api-Key"
},
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings."
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/BillingStateResponse"
},
{
"type": "null"
}
],
"title": "Response Get Organization Billing Api V1 Billing State Get"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/billing/change-tier": {
"post": {
"summary": "Change Tier",
"description": "Change the subscription tier (upgrade or downgrade).\n\nThis swaps the tier price while keeping metered items unchanged.\nStripe will fire a customer.subscription.updated webhook which\nupdates the billing state automatically.",
"operationId": "change_tier_api_v1_billing_change_tier_post",
"parameters": [
{
"name": "x-api-key",
"in": "header",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings.",
"title": "X-Api-Key"
},
"description": "Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChangeTierRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChangeTierResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Billing endpoints/schemas generally solid; a couple of spec nits

  • The /api/v1/billing/checkout description says “Returns 400 if org already has an active subscription (use portal instead)” but the response section only documents 200 and 422. Consider explicitly adding a 400 response so generated clients and docs reflect the behavior.
  • ChangeTierRequest.tier is a PlanTier enum, but ChangeTierResponse.tier is a plain string. If the response is intended to echo a PlanTier, using $ref: "#/components/schemas/PlanTier" would give SDKs stronger typing and symmetry between request/response.

Also applies to: 4616-4705, 5670-5727, 11907-11924, 11925-11937

🤖 Prompt for AI Agents
In @fern/openapi/skyvern_openapi.json around lines 2953 - 3175, The
create_checkout_session_api_v1_billing_checkout_post operation documents a 400
behavior but lacks a 400 response entry—add a "400" response object (e.g.,
description and application/json schema or a reference to an existing error
schema) under the "/api/v1/billing/checkout" POST responses so generated
clients/docs include it; and change the ChangeTierResponse.tier field from a
plain "string" to use $ref: "#/components/schemas/PlanTier" so it matches
ChangeTierRequest.tier and provides strong typing. Apply the same 400-response
addition and PlanTier ref fix to other duplicated billing endpoint/schema
instances noted in the review.

@wintonzheng wintonzheng closed this Jan 9, 2026
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.

2 participants