apiosk-gateway

Handle Apiosk x402 payments, browse and publish listing types, and create signed payment proofs for paid gateway requests.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "apiosk-gateway" with this command: npx skills add obcraft/apiosk-skill/obcraft-apiosk-skill-apiosk-gateway

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-payment proof 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 /types
  • GET /types/:listing_type/v1
  • GET /v1/apis
  • GET /v1/balance?address=0x...
  • GET /v1/usage?address=0x...&period=all|today|week|month
  • POST /v1/apis/register
  • POST /v1/apis/:slug
  • GET /v1/apis/mine?wallet=0x...
  • DELETE /v1/apis/:slug?wallet=0x...
  • ANY /:api_slug/*path (paid proxy calls)

Listing types

  • Public browse groups:
    • api
    • datasets
    • compute
  • Internal listing types supported by the gateway data model:
    • api
    • skill
    • product
    • dataset
    • service
    • connector

For discovery, always start with:

  1. GET /types
  2. GET /types/<group>/v1
  3. GET /v1/apis with search, category, sort, order, limit, offset

Payment flow (x402)

  1. Send the request without x-payment.
  2. If response is 402, parse accepts[0] from JSON:
    • scheme
    • network
    • maxAmountRequired
    • payTo
    • asset
    • maxTimeoutSeconds
    • extra.name and extra.version (token EIP-712 domain)
  3. Build a TransferWithAuthorization payload and sign it with EIP-712.
  4. Create proof:
    • x402Version: 1
    • scheme
    • network
    • payload.signature
    • payload.authorization (from, to, value, validAfter, validBefore, nonce)
  5. Base64-encode the proof JSON.
  6. 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 (fallback USD Coin)
    • version = requirement.extra.version (fallback 2)
    • chainId from requirement.network
    • verifyingContract = requirement.asset
  • Types:
    • from, to, value, validAfter, validBefore, nonce
  • Message:
    • from = caller wallet
    • to = requirement.payTo
    • value = requirement.maxAmountRequired
    • validAfter = 0
    • validBefore = now + requirement.maxTimeoutSeconds
    • nonce = random 32-byte hex

Network-to-chainId defaults:

  • base-sepolia => 84532
  • base => 8453
  • ethereum => 1
  • polygon => 137
  • arbitrum => 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-address
  • x-wallet-signature
  • x-wallet-timestamp
  • x-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 402 as a normal state transition, not a terminal failure.
  • Never invent payment requirements; always use values from the latest 402 response.
  • 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_usd from API discovery endpoints).
  • If publishing fails with Unauthorized, re-check wallet signature inputs (action, resource, lowercase wallet, timestamp freshness).

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

image-gen

Generate AI images from text prompts. Triggers on: "生成图片", "画一张", "AI图", "generate image", "配图", "create picture", "draw", "visualize", "generate an image".

Archived SourceRecently Updated
General

explainer

Create explainer videos with narration and AI-generated visuals. Triggers on: "解说视频", "explainer video", "explain this as a video", "tutorial video", "introduce X (video)", "解释一下XX(视频形式)".

Archived SourceRecently Updated
General

asr

Transcribe audio files to text using local speech recognition. Triggers on: "转录", "transcribe", "语音转文字", "ASR", "识别音频", "把这段音频转成文字".

Archived SourceRecently Updated