Skillz Market SDK

Creator API

Create and monetize your AI skills with the Creator API.

Creator API

The Creator API lets you build monetized AI skills with zero crypto knowledge. Define your skills, set prices, and start earning.

Getting Started

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

npx @skillzmarket/sdk init

This guides you through:

  1. Getting an API key from skillz.market/dashboard
  2. Configuring your wallet address for receiving payments
  3. Saving to .env

Overview

import { skill, serve } from '@skillzmarket/sdk/creator';
 
// Define skills
const summarize = skill({
  price: '$0.005',
  description: 'Summarize text using AI',
}, async ({ text }) => {
  return { summary: text.slice(0, 100) + '...' };
});
 
// Serve them
serve({ summarize }, {
  register: {
    endpoint: 'https://your-server.com',
    enabled: true,
  },
});

Run with:

npx tsx index.ts

Key Functions

FunctionDescription
skill(options, handler)Define a monetized skill
serve(skills, options?)Start the skill server
register(skills, options)Register skills with marketplace
init()Interactive CLI setup
checkConfig()Validate SDK configuration

How It Works

  1. Setup - Get an API key from the dashboard (one-time wallet signature)
  2. Define - Use skill() to create skill definitions with pricing
  3. Serve - Use serve() to start an x402-protected server
  4. Register - Skills are automatically registered with Skillz Market
  5. Earn - Receive USDC directly to your wallet on each call

Authentication

The SDK uses API key authentication for registration:

  • Sign once in the dashboard to create your account
  • Create an API key in the "API Keys" section
  • Use the API key in your SDK - no private key needed for serving!

Benefits:

  • No private key stored in your skill server
  • Rotate/revoke keys anytime
  • Same security (wallet verified at account creation)

Quick Example

import { skill, serve } from '@skillzmarket/sdk/creator';
 
// A simple echo skill
const echo = skill({
  price: '$0.001',
  description: 'Echoes input back',
}, async (input) => {
  return { echo: input };
});
 
// An uppercase skill
const uppercase = skill({
  price: '$0.0005',
  description: 'Converts text to uppercase',
}, async ({ text }: { text: string }) => {
  return { result: text.toUpperCase() };
});
 
// Serve both skills
serve({ echo, uppercase }, {
  port: 3002,
  register: {
    endpoint: 'https://your-server.com',
    enabled: true,
  },
});

Configuration Helpers

init()

Interactive CLI setup:

npx @skillzmarket/sdk init

Or programmatically:

import { init } from '@skillzmarket/sdk/creator';
await init();

checkConfig()

Validate your configuration:

import { checkConfig } from '@skillzmarket/sdk/creator';
 
const config = checkConfig();
if (!config.configured) {
  console.error('Issues:', config.issues);
  process.exit(1);
}

Server Output

When you run your server, you'll see:

==================================================
  Skillz Market - Creator Server
==================================================

  URL:      http://localhost:3002
  Network:  eip155:8453
  Wallet:   0x...

  Skills:
    POST /echo - 0.001 USDC
         Echoes input back
    POST /uppercase - 0.0005 USDC
         Converts text to uppercase

==================================================

  Registering skills with Skillz Market...

  ✓ Registered skills:
    - echo (echo-abc123)
    - uppercase (uppercase-def456)

==================================================

Next Steps

On this page