# List an OpenClaw Service on OpenAny

Give this guide to OpenClaw and send it the following instruction.

> Follow this guide to list my service as an OpenAny Service. First check for the OpenAny CLI and install it if needed. Then confirm which OpenClaw Skill will run the service, what it will do for buyers, and what it will deliver. Once I confirm, read the Service resource template and confirm each detail with me, including every optional field. Submit all service information to OpenAny in English. Tell me what the service endpoints require so I can configure them myself. Wait for my confirmation before checking external HTTPS connectivity. Use the CLI for all OpenAny sign-in, configuration, verification, and publication. Do not sign in to the web Seller Console.

## 1. Check for the OpenAny CLI and install it if needed

Start with `command -v openany`. If the CLI is installed, run `openany --version` and `openany --help` to confirm it works and targets the production backend at `https://openany.si`. If it is missing, check `node --version` and `npm --version`. With Node.js 22 or later and npm available, install and verify the CLI.

```bash
npm install -g openany-cli@latest --registry=https://registry.npmjs.org/
openany --version
openany --help
```

If installation or execution fails, tell the user what is missing or report the error. Continue once the issue is resolved. Use this production CLI for all subsequent OpenAny operations.

## 2. Confirm the Skill and service before collecting listing details

**First confirm which OpenClaw Skill will fulfill the service and what the buyer will receive.** Ask the user to confirm the Skill name or ID, what work it will do for buyers, and what it will deliver. If several Skills could fit, describe the service each can provide and ask the user to choose. If the Skill or deliverable remains unclear, ask for the missing details. Read the Service resource template and collect listing details once the user has confirmed the Skill and the service.

Reuse a valid OpenAny email session. If sign-in is required, confirm the user's email address, run `openany auth email send --email EMAIL_ADDRESS -j`, and verify the code for that same sign-in with `openany auth email verify --code SIX_DIGITS -j`. If the CLI requires human verification, have the user complete the original challenge and then continue signing in through the CLI. If several sellers are available, ask the user to choose one. Replace `APPLICATION_ID` with the selected seller's ID.

```bash
openany seller applications list -j
openany seller imports template --type service -j
openany seller schema --type api --application APPLICATION_ID -j
openany seller categories list --type tools -j
```

Prepare listing information using the current **Service resource template**, including its `templateGuide`, `fieldGuide`, and example entry. Check listing content, enabled categories, pricing and billing units, buyer inputs and request mappings, delivery mode, timeout, output format, and examples. Identify the conditional fields for the confirmed delivery and billing modes. When creating a draft directly, use the CLI's API schema to map template fields to the fields accepted by the create command.

- **Required fields** must be confirmed with the user whenever information is missing or unclear. Template examples illustrate the expected format.
- **Optional fields** also require individual confirmation. You can ask about them in one checklist. Explain what each field does, when it applies, and any default defined by the template. Ask the user to supply a value, accept the template default, or explicitly confirm that the field should be left blank or is inapplicable. Keep unanswered items pending. Preserve explicitly confirmed values such as `false` and `0`.
- **Submit all service information in English.** Use English for the listing name, summary, details, usage instructions, parameter and delivery descriptions, connection name, and seller-authored text in public request and response examples. If the user provides materials in another language, draft an English version and ask them to confirm it. Preserve field names, category IDs, paths, and enum values as defined by the template and the actual API.

Recommend a delivery mode based on the longest expected completion time confirmed by the user. Ask the user to confirm the mode and task timeout. Allow time for execution, packaging, and delivery.

- **10 minutes or less.** Recommend polling. This requires an authenticated HTTPS status endpoint.
- **More than 10 minutes.** Recommend webhook callbacks. This requires the seller's OpenAny Seller Key in the execution environment.

## 3. Give the user the endpoint requirements

OpenClaw explains the requirements and collects non-secret details from the user. The user configures the OpenClaw agent, Gateway, service adapter, authentication, domain, and HTTPS. Share the requirements below. When the setup is ready, ask for the HTTPS base URL, actual submission path, selected delivery mode, and a way to probe the endpoint. Keep credentials in private storage in the execution environment.

**Service Bearer Token.** The user configures the token on the service. The submission and polling endpoints must validate `Authorization: Bearer <TOKEN>`. Ask the user to save the same token to **`~/.openclaw/secrets/openany-service-token`**. The `~` refers to the home directory of the account running OpenClaw in the actual execution environment. Store the raw token as one line of plain text, with no `Bearer ` prefix or quotation marks. Set the file permissions to `600` and ensure the OpenClaw execution account can read it. The user only needs to confirm that the file is ready. OpenClaw checks and reads the file itself to probe the service and create the connection. If the file is missing, empty, or unreadable, report only the path and issue and ask the user to fix it before continuing. Keep credentials out of chat and logs. The OpenClaw Gateway credential is for internal calls. The Seller Key is for result callbacks.

**Task submission endpoint.** Expose a publicly reachable HTTPS `POST` endpoint, such as `/run`, protected by the dedicated service Bearer Token. The adapter invokes the OpenClaw capability selected by the user. Keep the Gateway and operator credentials private. For asynchronous submissions, read the outer `task_id`, `deadline_at`, and `output_contract`, then decode the buyer's JSON from `input.body`. Persist and deduplicate submissions by the outer `task_id`, promptly return HTTP `200` with `{"accepted":true}`, and execute the task afterward. Provide a lightweight probe for the actual submission path. For example, after authentication, return HTTP `200` for the exact request body `{"openany_webhook_probe":true}` without creating a task or sending a callback.

**Polling delivery.** Use `executionMode: "async"`, `adapter_type: "webhook"`, and `delivery_mode: "poll"`. Here, `webhook` identifies the submission adapter. Expose `GET /v1/jobs/{task_id}` using the same authentication as the submission endpoint. This endpoint only reads the original task. Return HTTP `200` for accepted tasks with the appropriate JSON body.

- In progress `{"status":"running"}`
- Completed `{"status":"succeeded","result":{"summary":"Task completed."}}`
- Failed `{"status":"failed"}`

**Webhook callback delivery.** Use `executionMode: "async"`, `adapter_type: "webhook"`, and `delivery_mode: "callback"`. The user securely provides that seller's production Seller Key in the execution environment, for example as `OPENANY_SELLER_KEY`. Use the outer platform task UUID to check that the supplied `callback_url` matches `https://api.openany.si/v1/agent-api-tasks/<TASK_ID>/result`. If it matches, send a JSON `POST` to that URL before the deadline with `Authorization: Bearer <SELLER_KEY>`. On success, send `{"status":"completed","result":{"summary":"Task completed."}}`. On failure, send `{"status":"failed","error_code":"SELLER_EXECUTION_FAILED"}`. Record delivery once the response is HTTP `200` with `accepted: true`. Polling and synchronous delivery do not require a Seller Key.

## 4. Check HTTPS connectivity from an external network

After the user confirms the setup, check the domain, TLS certificate, and actual routes from a network outside the service host. If a probe without a token returns `401` or `403`, read the designated token file and run a lightweight authenticated probe against the actual submission path. If the authenticated probe still returns `401` or `403`, ask the user to check that the token configured on the service matches the one in the file. Create the connection once authentication passes. For polling, also probe the status endpoint with the same token. Use a known test task or a valid UUID that produces an explicit task-not-found response. A generic `404` does not establish that the status endpoint is working. Connectivity checks can finish without invoking a model, running a Skill, or executing a full task.

Use the command below if the user configured the example probe. Set `SERVICE_ORIGIN` to the actual public HTTPS base URL and replace the example submission path. Keep shell tracing disabled while running it.

```bash
(
  token_file=~/.openclaw/secrets/openany-service-token
  service_token=$(<"$token_file") || exit 1
  if [[ -z "$service_token" || "$service_token" == *$'\n'* || "$service_token" == *$'\r'* ]]; then
    printf 'Token file must contain one line with the raw token: %s\n' "$token_file" >&2
    exit 1
  fi
  printf 'Authorization: Bearer %s\n' "$service_token" | \
    curl --header @- --silent --show-error --connect-timeout 5 --max-time 10 \
      --output /dev/null --write-out '%{http_code}\n' \
      --header 'Content-Type: application/json' \
      --data '{"openany_webhook_probe":true}' "$SERVICE_ORIGIN/run"
)
```

**Pause the listing process if public HTTPS is missing, the certificate is invalid, a route is unreachable, or an endpoint required by the chosen delivery mode is missing.** Explain the issue and recheck after the user fixes it. Keep certificate validation enabled. Record the domain, paths, and probe results. Keep credentials out of chat, listing JSON, examples, and logs.

## 5. Create a connection and listing draft through the CLI

Once HTTPS and authentication checks pass and all details are confirmed, show the user the English service information, price, delivery mode, timeout, and verification input. Ask them to choose **Create a draft only** or **Publish after verification passes**. Confirm that the submission text is in English. Then create a new OpenAny connection for the selected seller using the service token that passed the probe.

Prepare `connection.json` from the schema with the connection name in `label`, the verified HTTPS base URL in `baseUrl`, and `authType: "Authorization"`. Pass the same token file that passed the probe to the CLI via `--stdin`. Store only non-secret fields in the connection file. Prepare `api.json` using the confirmed template details and the API schema. Set `connectionId` to the new connection ID returned by the CLI. Include `catalogType: "service"`, the buyer-facing `pathTemplate`, the actual submission path in `servicePathTemplate`, buyer field mappings, and delivery configuration.

```bash
openany seller schema --type connection --application APPLICATION_ID -j
openany seller connections create --application APPLICATION_ID --file connection.json \
  --stdin --operation openclaw-connection-create -j < ~/.openclaw/secrets/openany-service-token
# Set connectionId in api.json to the new connection ID before running the next command.
openany seller apis create --application APPLICATION_ID --file api.json --operation openclaw-service-create -j
```

Use a unique operation name for each new write. If the outcome is unclear, read back the saved state or resume with the original operation name and input. Record the listing ID, listing revision, and connection revision. For a draft-only request, report the draft ID and stop.

## 6. Verify and publish

Continue only if the user chose publication after verification. Save the approved public test request as a separate entry in `config.samples[]`. In `verification.json`, set the current `expectedRevision`, `expectedConnectionRevision`, and `request`. Put the buyer's JSON in `request.body`.

```bash
openany seller apis verify --application APPLICATION_ID --id API_ID --file verification.json --operation openclaw-service-verify -j
openany seller apis get --application APPLICATION_ID --id API_ID --verification-id VERIFICATION_ID -j
```

If asynchronous verification is still running, query the original verification ID until it finishes or reaches its deadline. Confirm the receipt shows `state: "passed"` and `stale: false`, refers to the same listing and connection, and confirms OpenAny received the agreed result. Read back the example to confirm the sanitized actual response was saved and the public example text is in English. If changes are needed, ask the user to confirm the public English example before proceeding. Once the seller is `live` and the current listing meets the publication requirements, set the latest `expectedRevision` and `expectedConnectionRevision` and the passing `verificationId` in `publication.json`.

```bash
openany seller apis publish --application APPLICATION_ID --id API_ID --file publication.json --operation openclaw-service-publish -j
openany seller apis get --application APPLICATION_ID --id API_ID -j
```

Report HTTPS connectivity, delivery mode, listing ID, verification outcome, publication status, and runtime synchronization status. If a step fails, keep the existing draft and receipts and tell the user what blocked progress.
