API Reference

Integrate SaltSkills with your AI pipelines. Fetch skill definitions as raw Markdown for direct use as system prompts, or query the full catalog programmatically.

Quick Start

Fetch a skill as raw Markdown and use it as a system prompt in your AI pipeline.

// Fetch a skill and use it as a system prompt
const response = await fetch('/api/skills/react-component-generator', {
  headers: { 'Accept': 'text/markdown' }
})
const skillPrompt = await response.text()

// Use with AI SDK
import { generateText } from 'ai'

const result = await generateText({
  model: 'openai/gpt-4o',
  system: skillPrompt,
  prompt: 'Create a SearchInput component with debounce',
})

console.log(result.text)

Content Negotiation

Request JSON or raw Markdown via Accept headers or format parameter.

Filterable Catalog

Query skills by category, tags, and visibility level.

Visibility Controls

Skills can be public, team-only, or private to control access.

Endpoints

GET
/api/skills

List all skills with optional filters

Query Parameters

NameTypeDescription
categorystringFilter by category name
tagstringFilter by tag
visibilitystringFilter by visibility (public, team, private)
formatstringResponse format: json (default) or markdown
POST
/api/skills

Create a new skill

Request Body

FieldTypeRequiredDescription
titlestringYesSkill title
contentstringYesMarkdown content
descriptionstringNoShort description
categorystringNoCategory name
tagsstring[]NoArray of tags
visibilitystringNopublic, team, or private
GET
/api/skills/:slug

Get a specific skill by slug

Query Parameters

NameTypeDescription
formatstringSet to "markdown" or "raw" for raw content

Accept Headers

text/markdownReturns raw Markdown content for AI consumption
application/jsonReturns full JSON object (default)

SDK Examples

Python

import requests

# Fetch all skills as Markdown
response = requests.get(
    'https://your-domain.com/api/skills',
    params={'format': 'markdown', 'category': 'Code Generation'}
)
skills_md = response.text

# Fetch a specific skill for AI consumption
skill = requests.get(
    'https://your-domain.com/api/skills/react-component-generator',
    headers={'Accept': 'text/markdown'}
)
system_prompt = skill.text

TypeScript / Node.js

// List all skills filtered by tag
const res = await fetch('/api/skills?tag=typescript&format=json')
const { skills, total } = await res.json()

// Use a skill as system prompt with AI SDK
import { generateText } from 'ai'

const skillRes = await fetch('/api/skills/sql-query-optimizer', {
  headers: { 'Accept': 'text/markdown' }
})
const systemPrompt = await skillRes.text()

const result = await generateText({
  model: 'openai/gpt-4o',
  system: systemPrompt,
  prompt: 'Optimize this query: SELECT * FROM users WHERE ...',
})