apiosk-gateway
SKILL.md
apiosk-gateway
Use this skill when calling https://gateway.apiosk.com for paid endpoints, publishing APIs, or working with listing-type discovery.
When to use
- You need to call an Apiosk endpoint and receive
402 Payment Required. - You need to create an
x-paymentproof and retry the request. - You need to browse listing groups (
/types,/types/:listing_type/v1,/v1/apis). - You need to publish/update/delete APIs through gateway management routes.
Core endpoints
GET /typesGET /types/:listing_type/v1GET /v1/apisGET /v1/balance?address=0x...GET /v1/usage?address=0x...&period=all|today|week|monthPOST /v1/apis/registerPOST /v1/apis/:slugGET /v1/apis/mine?wallet=0x...DELETE /v1/apis/:slug?wallet=0x...ANY /:api_slug/*path(paid proxy calls)
Listing types
- Public browse groups:
apidatasetscompute
- Internal listing types supported by the gateway data model:
apiskillproductdatasetserviceconnector
For discovery, always start with:
GET /typesGET /types/<group>/v1GET /v1/apiswithsearch,category,sort,order,limit,offset
Payment flow (x402)
- Send the request without
x-payment. - If response is
402, parseaccepts[0]from JSON:schemenetworkmaxAmountRequiredpayToassetmaxTimeoutSecondsextra.nameandextra.version(token EIP-712 domain)
- Build a
TransferWithAuthorizationpayload and sign it with EIP-712. - Create proof:
x402Version: 1schemenetworkpayload.signaturepayload.authorization(from,to,value,validAfter,validBefore,nonce)
- Base64-encode the proof JSON.
- Retry the exact same HTTP method/path/body with header
x-payment: <base64-proof>.
If the retry returns 402 again, generate a new nonce and fresh validBefore and retry once more.
Create payment proof (reference)
Use EIP-3009 TransferWithAuthorization typed data:
- Domain:
name = requirement.extra.name(fallbackUSD Coin)version = requirement.extra.version(fallback2)chainIdfromrequirement.networkverifyingContract = requirement.asset
- Types:
from,to,value,validAfter,validBefore,nonce
- Message:
from = caller walletto = requirement.payTovalue = requirement.maxAmountRequiredvalidAfter = 0validBefore = now + requirement.maxTimeoutSecondsnonce = random 32-byte hex
Network-to-chainId defaults:
base-sepolia=>84532base=>8453ethereum=>1polygon=>137arbitrum=>42161
Publishing APIs (upload flow)
Use POST /v1/apis/register with JSON:
{
"name": "My API",
"slug": "my-api",
"endpoint_url": "https://example.com",
"price_usd": 0.01,
"description": "My paid API",
"owner_wallet": "0x...",
"category": "data"
}
Required auth headers for register/update/mine/delete:
x-wallet-addressx-wallet-signaturex-wallet-timestampx-wallet-nonce
Canonical signed message:
Apiosk auth
action:<action>
wallet:<lowercase_wallet>
resource:<resource>
timestamp:<unix_seconds>
nonce:<nonce>
Action/resource mapping:
- register:
action=register_api,resource=register:<slug> - update:
action=update_api,resource=update:<slug> - mine:
action=my_apis,resource=mine:<wallet> - delete:
action=delete_api,resource=delete:<slug>
Agent behavior requirements
- Treat
402as a normal state transition, not a terminal failure. - Never invent payment requirements; always use values from the latest
402response. - Preserve method/path/body between initial and paid retry.
- Prefer lowest-cost endpoint when multiple options satisfy the same task.
- Surface cost before paid calls when possible (
price_usdfrom API discovery endpoints). - If publishing fails with
Unauthorized, re-check wallet signature inputs (action,resource, lowercase wallet, timestamp freshness).