From 86f434291f547b5539a0fdc39b553e45e5aaaa65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=C3=A1=C5=A1=20Poto=C4=8Dek?= Date: Thu, 9 Apr 2026 13:40:02 +0200 Subject: [PATCH 1/2] docs(openapi): Add 402 response to Actor sync execution endpoints Actor execution endpoints now return 402 Payment Required with X402 payment info when a request has no auth token and no payment headers. See apify/apify-core#26917. Co-Authored-By: Claude Opus 4.6 (1M context) --- apify-api/openapi/components/responses/PaymentRequired.yaml | 6 +++--- .../actors/acts@{actorId}@run-sync-get-dataset-items.yaml | 2 ++ apify-api/openapi/paths/actors/acts@{actorId}@run-sync.yaml | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apify-api/openapi/components/responses/PaymentRequired.yaml b/apify-api/openapi/components/responses/PaymentRequired.yaml index 845dd7f4d2..32bd44ebdd 100644 --- a/apify-api/openapi/components/responses/PaymentRequired.yaml +++ b/apify-api/openapi/components/responses/PaymentRequired.yaml @@ -1,9 +1,9 @@ -description: Payment required - the user has exceeded their usage limit or does not have enough credits. +description: Payment required - the user has exceeded their usage limit, does not have enough credits, or the request lacks authentication and payment credentials. content: application/json: schema: $ref: ../schemas/common/ErrorResponse.yaml example: error: - type: actor-memory-limit-exceeded - message: You have exceeded your usage limit. Please consider upgrading your plan. + type: x402-payment-required + message: Please provide X402-PAYMENT-SIGNATURE header with the payment. See https://x402.org. diff --git a/apify-api/openapi/paths/actors/acts@{actorId}@run-sync-get-dataset-items.yaml b/apify-api/openapi/paths/actors/acts@{actorId}@run-sync-get-dataset-items.yaml index ed1b8ab7f6..1ee29f606e 100644 --- a/apify-api/openapi/paths/actors/acts@{actorId}@run-sync-get-dataset-items.yaml +++ b/apify-api/openapi/paths/actors/acts@{actorId}@run-sync-get-dataset-items.yaml @@ -86,6 +86,8 @@ post: application/json: schema: $ref: "../../components/schemas/common/errors/ActorErrors.yaml#/ActorRunFailedError" + "402": + $ref: ../../components/responses/PaymentRequired.yaml "404": description: Not found - the requested resource was not found. content: diff --git a/apify-api/openapi/paths/actors/acts@{actorId}@run-sync.yaml b/apify-api/openapi/paths/actors/acts@{actorId}@run-sync.yaml index cc6d0e753a..9879112d48 100644 --- a/apify-api/openapi/paths/actors/acts@{actorId}@run-sync.yaml +++ b/apify-api/openapi/paths/actors/acts@{actorId}@run-sync.yaml @@ -60,6 +60,8 @@ post: application/json: schema: $ref: "../../components/schemas/common/errors/ActorErrors.yaml#/ActorRunFailedError" + "402": + $ref: ../../components/responses/PaymentRequired.yaml "404": description: Not found - the requested resource was not found. content: From eaac11f51624d0632726e15a03065421b0a4cc26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=C3=A1=C5=A1=20Poto=C4=8Dek?= Date: Thu, 9 Apr 2026 13:50:42 +0200 Subject: [PATCH 2/2] fix(openapi): Add x402-payment-required to ErrorType enum Co-Authored-By: Claude Opus 4.6 (1M context) --- apify-api/openapi/components/schemas/common/ErrorResponse.yaml | 1 + apify-api/openapi/components/schemas/common/ErrorType.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/apify-api/openapi/components/schemas/common/ErrorResponse.yaml b/apify-api/openapi/components/schemas/common/ErrorResponse.yaml index 6fffb378f0..b7376dc209 100644 --- a/apify-api/openapi/components/schemas/common/ErrorResponse.yaml +++ b/apify-api/openapi/components/schemas/common/ErrorResponse.yaml @@ -28,6 +28,7 @@ properties: - token-not-valid - unknown-build-tag - unsupported-content-encoding + - x402-payment-required message: type: string description: Human-readable error message describing what went wrong. diff --git a/apify-api/openapi/components/schemas/common/ErrorType.yaml b/apify-api/openapi/components/schemas/common/ErrorType.yaml index 3095d7c0f2..495454cbea 100644 --- a/apify-api/openapi/components/schemas/common/ErrorType.yaml +++ b/apify-api/openapi/components/schemas/common/ErrorType.yaml @@ -18,3 +18,4 @@ enum: - token-not-valid - unknown-build-tag - unsupported-content-encoding + - x402-payment-required