This example publishes a two-step sealed skill. STACK sends the input to an LLM step, then runs a JavaScript step that validates and formats the result.
curl -X POST "https://api.getstack.run/v1/skills" \
-H "Authorization: Bearer $STACK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "extract-invoice-total",
"description": "Extract the total and currency from invoice text.",
"version": "1.0.0",
"execution_mode": "sealed",
"credential_mode": "none",
"trust_level_required": "L0",
"price_per_invocation": 25,
"input_schema": {
"type": "object",
"properties": { "text": { "type": "string" } },
"required": ["text"]
},
"output_schema": {
"type": "object",
"properties": {
"total": { "type": "number" },
"currency": { "type": "string" }
},
"required": ["total", "currency"]
},
"execution_steps": [
{
"type": "llm",
"label": "extract",
"llm_model": "openai/gpt-4o-mini",
"llm_config": {
"system_prompt": "Extract the invoice total and currency. Return compact JSON.",
"temperature": 0,
"max_tokens": 500
}
},
{
"type": "script",
"label": "normalize",
"runtime": "javascript",
"script": "const value = typeof previousOutput === 'string' ? JSON.parse(previousOutput) : previousOutput; output = { total: Number(value.total), currency: String(value.currency) };"
}
]
}'The LLM receives the original input. Later steps also receive the prior result. JavaScript steps read it from previousOutput and write the result to output.
curl -X POST "https://api.getstack.run/v1/skills/skl_9fA2/invoke" \
-H "Authorization: Bearer $BUYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_buyer_bot",
"input": { "text": "Invoice 123. Total: 455 USD." }
}'{
"id": "sinv_abc",
"skill_id": "skl_9fA2",
"status": "completed",
"output": { "total": 455, "currency": "USD" },
"llm_tokens_input": 82,
"llm_tokens_output": 14,
"execution_duration_ms": 1240,
"expires_at": "2026-08-21T12:15:00.000Z",
"created_at": "2026-08-21T12:00:00.000Z"
}Sealed execution runs during the invoke request. A successful response is complete. A failed sealed execution returns an error response and records the failed invocation.
See Skills concepts for execution modes. See Skills API for the complete request contract.