Install
openclaw skills install aioz-pin-toolkitRespond to user requests for AIOZ Pin API. Use provided scripts to manage API keys, pin files to IPFS, track usage, and more.
openclaw skills install aioz-pin-toolkitInteract with AIOZ Pin API quickly with API key authentication. A suite of integrated bash scripts is provided to automatically call REST APIs for pinning files, managing API keys, and tracking usage.
This skill uses API key authentication via environment variables:
PINNING_API_KEY: Your AIOZ Pin API key (provided by the platform)PINNING_SECRET_KEY: Your AIOZ Pin secret key (provided by the platform)AIOZ_JWT_TOKEN: Your AIOZ Pin JWT token (for API key management operations)Credential-safe policy:
⚠️ Critical Security Notice:
ps listings, shell history (.bash_history, .zsh_history), and process environment dumps.PINNING_API_KEY, PINNING_SECRET_KEY, or AIOZ_JWT_TOKEN as script arguments.If credentials are not present in the shell session, set them once before running any scripts:
export PINNING_API_KEY="YOUR_PINNING_API_KEY"
export PINNING_SECRET_KEY="YOUR_PINNING_SECRET_KEY"
export AIOZ_JWT_TOKEN="YOUR_JWT_TOKEN" # if needed for API key management
Header mapping used by scripts (credentials read from env vars internally):
PINNING_API_KEY → pinning-api-key headerPINNING_SECRET_KEY → pinning-secret-key headerAIOZ_JWT_TOKEN → Authorization: Bearer headerThis keeps credentials out of repeated command history and avoids accidental exposure.
When the user asks for a feature, use one of the bash scripts located in the scripts/ directory.
Prerequisite: All scripts read credentials from environment variables. Ensure these are set before executing any script:
export PINNING_API_KEY="YOUR_KEY"
export PINNING_SECRET_KEY="YOUR_SECRET"
export AIOZ_JWT_TOKEN="YOUR_JWT" # for API key management only
All scripts below assume credentials are available in the environment (set via export). Do not pass credentials as CLI arguments.
./scripts/pin_files_or_directory.sh FILE_URL./scripts/pin_by_cid.sh CID_HASH [METADATA_NAME]./scripts/get_pin_details.sh PIN_ID./scripts/list_pins.sh [OFFSET] [LIMIT] [PINNED] [SORT_BY] [SORT_ORDER]./scripts/unpin_file.sh PIN_ID./scripts/generate_api_key.sh KEY_NAME [admin] [pinList] [nftList] [unpin] [pinByHash] [pinFileToIPFS] [unpinNFT] [pinNFTToIPFS]./scripts/get_list_api_keys.sh./scripts/delete_api_key.sh KEY_ID./scripts/get_history_usage_data.sh [OFFSET] [LIMIT]./scripts/get_top_up.sh [OFFSET] [LIMIT]./scripts/get_month_usage_data.sh [OFFSET] [LIMIT]Use this script to pin a file by URL to IPFS:
./scripts/pin_files_or_directory.sh "https://example.com/file.zip"
Actual behavior in script:
To pin existing content by its IPFS CID:
./scripts/pin_by_cid.sh "QmHash..." "optional-name"
CID_HASH: The IPFS content hash to pinMETADATA_NAME: Optional name for the pinned contentUse these scripts to manage AIOZ Pin API keys:
# Generate API key with permissions:
./scripts/generate_api_key.sh "my-key" false true false false true true false false
# List API keys:
./scripts/get_list_api_keys.sh
# Delete API key:
./scripts/delete_api_key.sh "KEY_ID"
Actual behavior in scripts:
generate_api_key.sh calls POST /api/apikeys/create with permission flags.false if not provided.get_list_api_keys.sh calls GET /api/apikeys and returns list of keys.delete_api_key.sh calls DELETE /api/apikeys/{keyId} and removes the key.To inspect, list, and manage pins:
./scripts/get_pin_details.sh PIN_ID
GET /api/pinning/{pinId}./scripts/list_pins.sh [OFFSET] [LIMIT] [PINNED] [SORT_BY] [SORT_ORDER]
GET /api/pinning/pins?offset=...&limit=...OFFSET=0, LIMIT=10, PINNED=true, SORT_BY=name, SORT_ORDER=ASC./scripts/unpin_file.sh PIN_ID
DELETE /api/pinning/unpin/{pinId}To retrieve usage and top-up data:
./scripts/get_history_usage_data.sh [OFFSET] [LIMIT]
GET /api/usage/history?offset=...&limit=..../scripts/get_top_up.sh [OFFSET] [LIMIT]
GET /api/usage/topup?offset=...&limit=..../scripts/get_month_usage_data.sh [OFFSET] [LIMIT]
GET /api/usage/month?offset=...&limit=...Pagination notes:
OFFSET default is 0LIMIT default is 10For a typical pin lifecycle, use this sequence:
Setup: Ensure credentials are in the environment before executing any scripts:
export PINNING_API_KEY="YOUR_KEY"
export PINNING_SECRET_KEY="YOUR_SECRET"
Operational steps:
./scripts/pin_files_or_directory.sh "https://example.com/file.zip"
Response: extract pinId and cid from the response.
After pinning, verify the pin status:
./scripts/get_pin_details.sh "PIN_ID"
Response includes: status (active/pending), CID, file size, created date.
To see all pinned content:
./scripts/list_pins.sh 0 10 true name ASC
Response: paginated list of all pins with metadata.
When done, remove the pin:
./scripts/unpin_file.sh "PIN_ID"
Confirms deletion.
(For reference only; prefer using provided scripts)
Prerequisites: These examples assume environment variables are set:
export PINNING_API_KEY="YOUR_KEY"
export PINNING_SECRET_KEY="YOUR_SECRET"
export AIOZ_JWT_TOKEN="YOUR_JWT"
All credentials are referenced as $VARIABLE_NAME (shell expansion) — never hardcoded.
curl -s -X POST "https://api.aiozpin.network/api/files/pin?fileUrl=https://example.com/file.zip" \
-H "pinning-api-key: $PINNING_API_KEY" \
-H "pinning-secret-key: $PINNING_SECRET_KEY" \
-H "Content-Type: application/json"
curl -s -X POST "https://api.aiozpin.network/api/apikeys/create?keyName=my-key&admin=false&pinList=true&nftList=false&unpin=false&pinByHash=true&pinFileToIPFS=true&unpinNFT=false&pinNFTToIPFS=false" \
-H "Authorization: Bearer $AIOZ_JWT_TOKEN" \
-H "Content-Type: application/json"
curl -s "https://api.aiozpin.network/api/pinning/pins?offset=0&limit=10&pinned=true&sortBy=name&sortOrder=ASC" \
-H "pinning-api-key: $PINNING_API_KEY" \
-H "pinning-secret-key: $PINNING_SECRET_KEY"
scripts/ directory.pin_files_or_directory, pin_by_cid, get_pin_details, list_pinspending, inform the user to check again later.PINNING_API_KEY and PINNING_SECRET_KEY are correctly set in the environment (e.g., echo $PINNING_API_KEY).ps, shell history files, and process environment listings.https://api.aiozpin.network/api/ accessibility.PINNING_API_KEY and PINNING_SECRET_KEY are already set in the shell environment. If missing, ask the user for their credentials and set them via:
export PINNING_API_KEY="..."
export PINNING_SECRET_KEY="..."
Do not pass these as script arguments../scripts/pin_files_or_directory.sh "FILE_URL" (credentials come from environment)get_pin_details.sh) or list pins (list_pins.sh)