API Reference

AgentLevier API

Your AI agents discover, purchase, and receive skill packs via API. JSON in, JSON out. No UI required.

Base URL https://agentlevier.polsia.app

Quick Start — 3 API calls

// 1. Browse the catalog GET /api/courses // 2. Preview a skill before buying GET /api/courses/expert-comptable/preview // 3. Purchase and receive the skill pack POST /api/purchase { "course_id": "expert-comptable", "payment_token": "pm_..." } // → Returns complete skill pack JSON

Endpoints

GET /api/courses
List all available skill packs. Supports filtering by category and skill type.
ParameterTypeDescription
category optionalstringFilter by category: finance, marketing, operations
skill_type optionalstringFilter by type: system_prompt
q optionalstringSearch in title and description
// Example response { "ok": true, "count": 3, "courses": [ { "id": 1, "slug": "expert-comptable", "title": "Expert Comptable IA", "category": "finance", "price": { "cents": 99, "formatted": "$0.99" }, "links": { "detail": "/api/courses/1", "preview": "/api/courses/1/preview", "purchase": "/api/purchase" } } ] }
GET /api/courses/:id
Get full details for a single course. Accepts numeric ID or slug.
GET /api/courses/expert-comptable GET /api/courses/1
GET /api/courses/:id/preview
Free preview of a skill pack. Shows metadata, compatibility, and a sample instruction without the full content.
// Example response { "ok": true, "preview": { "title": "Expert Comptable IA", "skill_pack_preview": { "version": "1.0", "compatibility": ["gpt-4", "claude-3", ...], "instructions_count": 4, "workflow_steps_count": 3, "sample_instruction": "Analyse chaque transaction..." } } }
POST /api/purchase
Purchase a skill pack programmatically. With a Stripe payment token, the charge is immediate and the skill pack is returned directly. Without a token, a payment URL is returned.
ParameterTypeDescription
course_id requiredstring|numberCourse ID or slug
payment_token optionalstringStripe payment method (pm_...) for instant purchase
email optionalstringBuyer email for receipt
agent_id optionalstringYour agent's identifier for tracking
// With payment token → instant skill pack POST /api/purchase { "course_id": "expert-comptable", "payment_token": "pm_1234..." } // → { ok: true, skill_pack: { system_prompt, instructions, workflow_steps, ... } } // Without token → payment URL POST /api/purchase { "course_id": "expert-comptable" } // → { ok: true, status: "pending_payment", payment: { url: "https://..." } }

Skill Pack Format

After purchase, you receive a complete skill pack in JSON. Inject it directly into your agent's system prompt and context.

{ "version": "1.0", "skill_name": "expert-comptable", "display_name": "Expert Comptable IA", "category": "finance", "compatibility": ["gpt-4", "gpt-4o", "claude-3", "claude-4", "mistral-large"], "system_prompt": "Tu es un expert-comptable...", "instructions": ["Analyse chaque transaction...", ...], "workflow_steps": [ { "step": 1, "action": "categorize_transaction", "description": "..." } ], "reference_data": { /* domain-specific lookup tables */ }, "output_format": { /* expected output structure */ } }

Integration Example

Here's how to integrate AgentLevier into your agent with a few lines of code:

// Node.js / Python — inject a skill pack into your agent // 1. Fetch the catalog const res = await fetch('https://agentlevier.polsia.app/api/courses'); const { courses } = await res.json(); // 2. Purchase the skill you need const purchase = await fetch('https://agentlevier.polsia.app/api/purchase', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ course_id: 'expert-comptable', payment_token: 'pm_...' }) }); const { skill_pack } = await purchase.json(); // 3. Inject into your agent's system prompt const messages = [ { role: 'system', content: skill_pack.system_prompt }, { role: 'user', content: 'Catégorise cette facture: Restaurant 45€ TTC' } ];