From 51cd9efe9594d7037798e9bee61d63573ff25f72 Mon Sep 17 00:00:00 2001 From: daxiongya Date: Tue, 24 Nov 2026 00:28:09 +0800 Subject: [PATCH 1/2] docs(provider): rename lifecycle sandbox state to preview Document the backend rename of the provider lifecycle state SANDBOX to PREVIEW (old value still reported by older backends), the REVISION_NOT_IN_PREVIEW readiness code, and how owners self-test a preview service: --preview / include_preview instead of the removed allowSandbox key permission, any owner key through the Gateway, X-XAPI-Billing: preview and isPreviewCall. The Sandbox compute product text is unchanged. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 231d23db34c0085285d8b9dbfcf18f7413209113) --- README.md | 15 +++++++-- .../reference/lifecycle-management.md | 31 ++++++++++++++++--- ...ubmission-readiness-and-review-recovery.md | 9 +++--- skills/xapi-provider/reference/tripo-async.md | 2 +- skills/xapi/SKILL.md | 2 +- skills/xapi/guides/choosing.md | 2 +- 6 files changed, 47 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ec0c02c..2a214a2 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ xapi-to search "token price" --source api # search APIs only xapi-to search "token price" --sort relevance # strongest text match xapi-to search "token price" --sort price # lowest comparable price xapi-to search "twitter" --include-all-versions # include active non-default majors +xapi-to search "weather" --preview # also include your own PREVIEW services xapi-to categories # list all categories xapi-to categories --source capability # categories for capabilities only @@ -209,7 +210,7 @@ xapi-to provider import --file openapi.json > imported.json PROVIDER_SERVICE_ID=$(jq -er '.serviceId' imported.json) PROVIDER_REVISION_ID=$(jq -er '.revisionId' imported.json) -# Imports with endpoints start in SANDBOX on updated backends. +# Imports with endpoints start in PREVIEW on updated backends. # Inspect configuration and prices before submission. xapi-to provider get "$PROVIDER_SERVICE_ID" --format pretty @@ -233,7 +234,15 @@ nonzero; its structured validation errors are preserved. Registration creates a new service each time. If a response is lost, inspect `provider list` before retrying to avoid duplicate services. An older deployed backend may still return `DRAFT` for an import with endpoints; only then save its configuration once with -`provider update --revision --file config.json` to enter `SANDBOX`. +`provider update --revision --file config.json` to enter `PREVIEW`. +Older backends report this state as `SANDBOX`; the CLI accepts both. + +While a revision is in `PREVIEW`, you can call it for free to self-test. Pass +`--preview` to `list`, `search`, `services` or `call` (API field +`include_preview`) to include your own preview services; they are no longer +exposed through an API key permission, and any of your keys works. Preview +responses carry `X-XAPI-Billing: preview` and usage records mark them with +`isPreviewCall: true`. For an authenticated upstream, store credentials in a local JSON object such as `{"Authorization":"Bearer YOUR_UPSTREAM_KEY"}` and pass @@ -297,7 +306,7 @@ does not guarantee publication, but a passing review can automatically publish and switch live traffic. `wait` checks the requested revision, succeeds only for `PUBLISHED`, and outputs the review report with `success` and `reason`. `--changelog` is limited to 2,000 characters by both the CLI and backend. -Rejection, a draft/sandbox/suspended revision, or a legacy manual-review hold +Rejection, a draft/preview/suspended revision, or a legacy manual-review hold exit nonzero. Pending review continues until publication, the timeout (default 10 minutes), or optional `--max-attempts`. Timeout and attempt-limit results include the last received report; polling can be resumed with the same IDs. diff --git a/skills/xapi-provider/reference/lifecycle-management.md b/skills/xapi-provider/reference/lifecycle-management.md index b9a4712..415ddfb 100644 --- a/skills/xapi-provider/reference/lifecycle-management.md +++ b/skills/xapi-provider/reference/lifecycle-management.md @@ -6,13 +6,15 @@ Use the commands here instead of constructing management requests yourself. ## Service and revision states Creating a service with a non-empty `endpoints` list starts its v1 revision in -`SANDBOX`, including `provider import` and `provider create --file`. An empty -service starts in `DRAFT`; saving a valid contract moves it to `SANDBOX`. +`PREVIEW`, including `provider import` and `provider create --file`. An empty +service starts in `DRAFT`; saving a valid contract moves it to `PREVIEW`. +Older backends report `PREVIEW` as `SANDBOX` and revision labels as `sandbox`; +treat them as the same state. Read the returned state: older deployed backends may still create `DRAFT` even with endpoints, in which case save the contract once before submitting. Publishing moves it to `IN_REVIEW`. A passing review produces an immutable `PUBLISHED` revision. A failed review returns the -revision to `SANDBOX`; an uncertain review may wait for human review. A service +revision to `PREVIEW`; an uncertain review may wait for human review. A service can also become `SUSPENDED` after publication. Use these reads to determine current state and IDs: @@ -35,7 +37,28 @@ published revision is not necessarily serving. The legacy revision `status` field is not the routing truth. `revision start` may return an existing working revision, including one already -in review. Only `DRAFT` and `SANDBOX` are editable; inspect state before writing. +in review. Only `DRAFT` and `PREVIEW` are editable; inspect state before writing. + +## Self-test a preview service + +The owner can call their own `PREVIEW` service for free, rate-limited, before +submitting it. Preview services are hidden from Action discovery and execution +by default; pass `--preview` to opt in: + +```bash +npx xapi-to search "" --preview +npx xapi-to list --service-id --preview +npx xapi-to call --preview --input '{"key":"value"}' +``` + +The flag sends `include_preview=true` on `list`, `search` and `services`, and +`include_preview: true` in the `call` execute body. Direct Gateway calls to a +preview service need no flag. Any of the owner's API keys works; the former +key-level `allowSandbox` permission no longer exists and is ignored if sent. +Other users still receive 404. Preview responses carry `X-XAPI-Billing: preview` +(older backends: `sandbox`), and their usage records have `isPreviewCall: true` +(older field `isSandboxCall`). A free preview call still spends real upstream +supplier credits. Use the major and working `revision` number from the overview to read its contract, for example v1.4 for major 1, revision 4: diff --git a/skills/xapi-provider/reference/submission-readiness-and-review-recovery.md b/skills/xapi-provider/reference/submission-readiness-and-review-recovery.md index cf54b88..0d3d9e0 100644 --- a/skills/xapi-provider/reference/submission-readiness-and-review-recovery.md +++ b/skills/xapi-provider/reference/submission-readiness-and-review-recovery.md @@ -35,7 +35,8 @@ Normal Agent audit logging still applies. Its result contains: | `changes.reviewTestReason/reviewTestNote` | Why that review-test decision applies | | `selfTest` | Advisory availability, reason, observation boundary (`since`), endpoint observations and untested count; `blocking` is `false` | -Issue codes include `SERVICE_BLOCKED`, `REVISION_NOT_IN_SANDBOX`, `NO_ENDPOINTS`, +Issue codes include `SERVICE_BLOCKED`, `REVISION_NOT_IN_PREVIEW` (formerly +`REVISION_NOT_IN_SANDBOX`), `NO_ENDPOINTS`, `PROVIDER_SCHEMA_INVALID`, `ENDPOINT_PATH_INVALID`, `MISSING_BASE_URL`, `WS_MISSING_UPSTREAM`, `SANDBOX_CONFIG_INCOMPLETE`, and `PER_TOKEN_USAGE_UNREADABLE`. Correct the reported issues, then read readiness @@ -56,7 +57,7 @@ submission flow described in [lifecycle management](lifecycle-management.md). `REVIEW_INTERRUPTED` is a provider inbox notification for platform failure during automatic review. Its title identifies the service/revision; its body says the -revision returned to Sandbox without content changes and can be submitted again. +revision returned to Preview without content changes and can be submitted again. It does not carry the internal exception text, and it is not an author-content rejection or an approval. Notification data includes `apiVersionId`, `majorVersion` and the affected `reviewId`. @@ -64,11 +65,11 @@ rejection or an approval. Notification data includes `apiVersionId`, Recovery is tied to that review attempt and revision. A stale worker must not roll back a newer attempt, a completed decision or an unrelated revision, and must not emit a misleading recovery notification for them. The serving revision -continues serving while the working revision returns to `SANDBOX`. +continues serving while the working revision returns to `PREVIEW`. On receiving a notification, read `provider versions` and `provider review` for the referenced IDs. Confirm the current working revision is still the intended -`SANDBOX` revision, inspect readiness if supported, then explicitly submit it +`PREVIEW` revision, inspect readiness if supported, then explicitly submit it again when appropriate. A notification can be stale; never blindly resubmit a revision that is already `IN_REVIEW`, has a newer attempt, or has been published. Do not automatically replay an ambiguous submit response; read current state diff --git a/skills/xapi-provider/reference/tripo-async.md b/skills/xapi-provider/reference/tripo-async.md index a366264..5fab83f 100644 --- a/skills/xapi-provider/reference/tripo-async.md +++ b/skills/xapi-provider/reference/tripo-async.md @@ -62,7 +62,7 @@ long-term asset retention require separate verification. ## Acceptance boundary -Private draft/sandbox calls still spend real supplier credits while xAPI wallet +Private draft/preview calls still spend real supplier credits while xAPI wallet billing can be disabled. Supplier success and usage reconciliation do not prove nonzero caller-wallet settlement. Before paid public access, verify the final deployed candidate's ownership checks, result query/download, reservation diff --git a/skills/xapi/SKILL.md b/skills/xapi/SKILL.md index 228d915..9e6bf95 100644 --- a/skills/xapi/SKILL.md +++ b/skills/xapi/SKILL.md @@ -86,7 +86,7 @@ npx xapi-to search "token price" --sort relevance # strongest text match npx xapi-to search "token price" --sort price # lowest comparable price npx xapi-to search "twitter" --include-all-versions # include active non-default majors -# List all APIs (supports --source, --category, --service-id, --page, --page-size) +# List all APIs (supports --source, --category, --service-id, --page, --page-size; --preview adds your own unpublished PREVIEW services, also on search/services/call) npx xapi-to list npx xapi-to list --source capability npx xapi-to list --category Social --page-size 10 diff --git a/skills/xapi/guides/choosing.md b/skills/xapi/guides/choosing.md index 44233b0..9fa8a61 100644 --- a/skills/xapi/guides/choosing.md +++ b/skills/xapi/guides/choosing.md @@ -131,7 +131,7 @@ review status matters to the user's choice. Action execution envelopes may include `rate_limit` with `limit`, `remaining`, `reset_at` and optional `retry_after_seconds`. Service quota errors carry -`error.retry_after_seconds`; a quota rejection for free API sandbox calls uses +`error.retry_after_seconds`; a quota rejection for free API preview calls uses flat `retry_after_seconds` plus `rate_limit_buckets` (`creator_minute`, `creator_daily`, `api_key_daily`). Inspect the actual error body, including any outer Action envelope, instead of assuming one field location for all routes. From 9bf60d1ab7ad40f9e06be17291cb58d80e83ff61 Mon Sep 17 00:00:00 2001 From: daxiongya Date: Tue, 24 Nov 2026 00:47:41 +0800 Subject: [PATCH 2/2] docs(provider): list --preview on get, get-batch and categories Mirror the CLI flag coverage: --preview now also applies to categories (query) and get/get-batch (batch body). Clarify that platform admins are the exception to the 404 for other users. Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 4280df49b2f678eb5e01a48f6240f93dc4158742) --- README.md | 4 ++-- skills/xapi-provider/reference/lifecycle-management.md | 9 ++++++--- skills/xapi/SKILL.md | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2a214a2..c6b6750 100644 --- a/README.md +++ b/README.md @@ -238,8 +238,8 @@ retrying to avoid duplicate services. An older deployed backend may still return Older backends report this state as `SANDBOX`; the CLI accepts both. While a revision is in `PREVIEW`, you can call it for free to self-test. Pass -`--preview` to `list`, `search`, `services` or `call` (API field -`include_preview`) to include your own preview services; they are no longer +`--preview` to `list`, `search`, `categories`, `services`, `get`, `get-batch` +or `call` (API field `include_preview`) to include your own preview services; they are no longer exposed through an API key permission, and any of your keys works. Preview responses carry `X-XAPI-Billing: preview` and usage records mark them with `isPreviewCall: true`. diff --git a/skills/xapi-provider/reference/lifecycle-management.md b/skills/xapi-provider/reference/lifecycle-management.md index 415ddfb..33fad9f 100644 --- a/skills/xapi-provider/reference/lifecycle-management.md +++ b/skills/xapi-provider/reference/lifecycle-management.md @@ -48,14 +48,17 @@ by default; pass `--preview` to opt in: ```bash npx xapi-to search "" --preview npx xapi-to list --service-id --preview +npx xapi-to get --preview npx xapi-to call --preview --input '{"key":"value"}' ``` -The flag sends `include_preview=true` on `list`, `search` and `services`, and -`include_preview: true` in the `call` execute body. Direct Gateway calls to a +The flag sends the query `include_preview=true` on `list`, `search`, +`categories` and `services`, and the body field `include_preview: true` on +`get`/`get-batch` (`POST /v1/actions/batch`) and `call` (`POST +/v1/actions/execute`). Without the flag the field is not sent. Direct Gateway calls to a preview service need no flag. Any of the owner's API keys works; the former key-level `allowSandbox` permission no longer exists and is ignored if sent. -Other users still receive 404. Preview responses carry `X-XAPI-Billing: preview` +Other users receive 404 (platform admins excepted). Preview responses carry `X-XAPI-Billing: preview` (older backends: `sandbox`), and their usage records have `isPreviewCall: true` (older field `isSandboxCall`). A free preview call still spends real upstream supplier credits. diff --git a/skills/xapi/SKILL.md b/skills/xapi/SKILL.md index 9e6bf95..5f12c57 100644 --- a/skills/xapi/SKILL.md +++ b/skills/xapi/SKILL.md @@ -86,7 +86,7 @@ npx xapi-to search "token price" --sort relevance # strongest text match npx xapi-to search "token price" --sort price # lowest comparable price npx xapi-to search "twitter" --include-all-versions # include active non-default majors -# List all APIs (supports --source, --category, --service-id, --page, --page-size; --preview adds your own unpublished PREVIEW services, also on search/services/call) +# List all APIs (supports --source, --category, --service-id, --page, --page-size; --preview, on every discovery/get/call command, adds your own unpublished PREVIEW services) npx xapi-to list npx xapi-to list --source capability npx xapi-to list --category Social --page-size 10