Skillz Market SDK

Registration

Register your skills with the Skillz Market for discovery.

Registration

Register your skills with the Skillz Market so users can discover them.

Getting an API Key

Before registering skills, you need an API key:

  1. Go to skillz.market/dashboard
  2. Connect your wallet and sign to authenticate (one-time)
  3. Navigate to the "API Keys" section
  4. Click "Create Key" and save it securely

Or use the interactive setup:

npx @skillzmarket/sdk init

Configuration

Set your API key and wallet address:

# In .env file
SKILLZ_API_KEY=sk_...
SKILLZ_WALLET_ADDRESS=0x...

Or pass them directly:

serve({ echo }, {
  apiKey: 'sk_...',
  wallet: '0x...',
  register: {
    endpoint: 'https://your-server.com',
    enabled: true,
  },
});

Auto-Registration via serve()

The easiest way is to enable auto-registration in serve():

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

When the server starts, skills are automatically registered using your API key.

Manual Registration

Use register() for more control:

import { skill, register } from '@skillzmarket/sdk/creator';
 
const echo = skill({ price: '$0.001' }, async (input) => ({ echo: input }));
 
const results = await register({ echo }, {
  apiKey: process.env.SKILLZ_API_KEY!,
  paymentAddress: process.env.SKILLZ_WALLET_ADDRESS!,
  endpoint: 'https://your-server.com',
});
 
for (const result of results) {
  if (result.success) {
    console.log(`Registered: ${result.name} -> ${result.slug}`);
  } else {
    console.error(`Failed: ${result.name} - ${result.error}`);
  }
}

Registration Options

interface RegistrationOptions {
  endpoint: string;              // Your public server URL (required)
  apiUrl?: string;               // Default: 'https://api.skillz.market'
  enabled?: boolean;             // Default: true
  onError?: 'throw' | 'warn' | 'silent';  // Default: 'warn'
  groups?: string[];             // Global groups (merged with per-skill)
  batch?: {
    concurrency?: number;        // Max concurrent registrations (default: 5)
  };
}

endpoint (Required)

The public URL where your skills are accessible:

register({ echo }, {
  apiKey: 'sk_...',
  paymentAddress: '0x...',
  endpoint: 'https://api.example.com',
  // Skills will be registered as:
  // POST https://api.example.com/echo
});

onError

Control how registration errors are handled:

ValueBehavior
'throw'Throw an error if registration fails
'warn'Log a warning (default)
'silent'Ignore failures silently
serve({ echo }, {
  register: {
    endpoint: 'https://your-server.com',
    onError: 'throw',  // Fail fast if registration fails
  },
});

Registration Results

The register() function returns an array of results:

interface RegistrationResult {
  name: string;       // Skill name
  success: boolean;   // Whether registration succeeded
  slug?: string;      // Assigned slug (if successful)
  error?: string;     // Error message (if failed)
}
const results = await register({ echo, summarize }, options);
 
const successful = results.filter(r => r.success);
const failed = results.filter(r => !r.success);
 
console.log(`Registered ${successful.length}/${results.length} skills`);

Authentication

Registration uses API key authentication:

# Set in environment
SKILLZ_API_KEY=sk_...
SKILLZ_WALLET_ADDRESS=0x...

Benefits over wallet signing:

  • No private key needed in your skill server
  • Can rotate/revoke keys anytime
  • Same security (wallet ownership verified when creating account)

Server Output

When auto-registration succeeds:

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

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

  Skills:
    POST /echo - 0.001 USDC
    POST /summarize - 0.005 USDC

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

  Registering skills with Skillz Market...

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

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

Updating Registered Skills

When you restart your server with auto-registration enabled, skills are re-registered. Updates are applied if:

  • Price changed
  • Description changed
  • Input/output schemas changed
  • Endpoint changed

Assigning Skills to Groups

Skills can be assigned to groups during registration. Groups must already exist and belong to your account (create them via the dashboard).

Important: At least one group is required per skill. You can assign groups either globally (applies to all skills) or per-skill.

Global Groups

All skills get these groups:

serve({ summarize, translate }, {
  register: {
    endpoint: 'https://your-server.com',
    groups: ['ai-tools'],  // Both skills get 'ai-tools'
  },
});

Per-Skill Groups

Define groups directly on each skill:

const summarize = skill({
  price: '$0.005',
  groups: ['text-processing'],  // Just this skill
}, async ({ text }) => ({ summary: '...' }));
 
const translate = skill({
  price: '$0.003',
  groups: ['translation'],
}, async ({ text, lang }) => ({ translated: '...' }));
 
serve({ summarize, translate }, {
  register: {
    endpoint: 'https://your-server.com',
    groups: ['ai-tools'],  // Global groups
  },
});
// summarize → ['ai-tools', 'text-processing']
// translate → ['ai-tools', 'translation']

Manual Registration with Groups

const results = await register({ summarize }, {
  apiKey: process.env.SKILLZ_API_KEY!,
  paymentAddress: process.env.SKILLZ_WALLET_ADDRESS!,
  endpoint: 'https://your-server.com',
  groups: ['ai-tools'],  // Global groups
});

Updating Skills

Use updateSkill() to update existing skills, including changing their groups:

import { updateSkill } from '@skillzmarket/sdk/creator';
 
const result = await updateSkill('my-skill-slug', {
  description: 'Updated description',
  groups: ['new-group', 'another-group'],  // Replace all groups
}, {
  apiKey: process.env.SKILLZ_API_KEY!,
});
 
if (result.success) {
  console.log('Skill updated!');
} else {
  console.error('Update failed:', result.error);
}

Update Options

interface SkillUpdateData {
  description?: string;
  price?: string;           // e.g., '$0.005'
  groups?: string[];        // Replaces existing groups
  inputSchema?: JsonSchema;
  outputSchema?: JsonSchema;
  isActive?: boolean;
}

Parallel Registration

Skills are registered in parallel with a configurable concurrency limit:

serve({ skill1, skill2, skill3, /* ... */ skill20 }, {
  register: {
    endpoint: 'https://your-server.com',
    groups: ['my-group'],
    batch: {
      concurrency: 10,  // Register up to 10 skills at once
    },
  },
});

Default concurrency is 5. Increase for faster registration with many skills.

Example: Conditional Registration

Only register in production:

serve({ echo, summarize }, {
  register: {
    endpoint: process.env.PUBLIC_URL!,
    enabled: process.env.NODE_ENV === 'production',
    onError: process.env.NODE_ENV === 'production' ? 'throw' : 'warn',
  },
});

API Key Security

  • Store API keys securely (environment variables, secrets manager)
  • Never commit API keys to source control
  • Add .env to .gitignore
  • Use separate keys for development/production
  • Rotate keys if compromised via the dashboard

Next Steps