Skillz Market SDK
Getting Started

Quick Start

Get up and running with the Skillz Market SDK in 5 minutes.

Quick Start

This guide will get you calling or creating paid AI skills in just a few minutes.

Creator: Monetize Your Skills

If you want to create and monetize your own AI skills:

1. Install the SDK

pnpm add @skillzmarket/sdk viem

2. Run the Setup Wizard

The easiest way to get started is with the interactive setup:

npx @skillzmarket/sdk init

This will guide you through:

  • Getting an API key from skillz.market/dashboard
  • Configuring your wallet address for receiving payments
  • Saving the configuration to .env

3. Define Your Skills

import { skill, serve } from '@skillzmarket/sdk/creator';
 
// Define a simple skill
const echo = skill({
  price: '$0.001',
  description: 'Echoes input back',
}, async (input) => {
  return { echo: input };
});
 
// Define another skill
const uppercase = skill({
  price: '$0.0005',
  description: 'Converts text to uppercase',
}, async ({ text }: { text: string }) => {
  return { result: text.toUpperCase() };
});

4. Serve Your Skills

serve({ echo, uppercase }, {
  register: {
    endpoint: 'https://your-server.com',
    enabled: true,
  },
});

5. Run Your Server

npx tsx index.ts

Your skills are now live and accepting payments!


Consumer: Call Paid Skills

If you want to use paid skills from the marketplace:

1. Install the SDK

pnpm add @skillzmarket/sdk viem

2. Initialize with Your Wallet

import { SkillzMarket } from '@skillzmarket/sdk';
 
const market = new SkillzMarket({
  wallet: process.env.WALLET_KEY, // Your private key
});

3. Discover and Call Skills

// Search for skills
const skills = await market.search('image generation');
console.log(skills);
 
// Get skill details
const skill = await market.info('text-to-image');
console.log(`${skill.name} - ${skill.price} ${skill.currency}`);
 
// Call the skill (payment handled automatically)
const result = await market.call('text-to-image', {
  prompt: 'A cyberpunk cityscape at night',
});
console.log(result);

That's it! The SDK automatically handles the x402 payment flow.


What Happens Under the Hood

For Consumers

  1. You call market.call('skill-slug', input)
  2. SDK fetches skill info (endpoint, price)
  3. SDK calls the skill endpoint
  4. Endpoint returns 402 Payment Required
  5. SDK creates USDC payment on Base
  6. SDK retries with payment proof
  7. Skill executes and returns result

For Creators

  1. You sign once in the dashboard to create your account
  2. You get an API key for registration
  3. You define skills with skill(options, handler)
  4. You serve them with serve(skills)
  5. Server starts with x402 payment middleware
  6. Skills are registered with the marketplace
  7. When called, middleware validates payment
  8. Your handler executes
  9. USDC is sent directly to your wallet

Next Steps