API Reference v1
The Context Layer API
Fetch your prompts dynamically at runtime. Decouple your AI logic from your application code.
GET
/api/v1/promptOperational
Query Parameters
slugRequiredThe unique identifier string of the prompt you want to fetch.
versionOptionalSpecific version number. Defaults to the latest published version.
Headers
x-api-keyRequiredYour secret API key. Used to identify your workspace and enforce rate limits.
Request Examples
curl -X GET "https://openprompt.sparktac.in/api/v1/prompt?slug=my-awesome-prompt" \ -H "x-api-key: YOUR_API_KEY"
Response Format
{
"meta": {
"title": "My Awesome Prompt",
"description": "A very useful system prompt",
"slug": "my-awesome-prompt",
"owner_id": 123,
"is_public": false,
"created_at": "2024-01-01T10:00:00.000Z",
"updated_at": "2024-01-02T15:30:00.000Z"
},
"version": {
"number": 2,
"content": "You are a helpful AI assistant...",
"changelog": "Improved clarity",
"created_at": "2024-01-02T15:30:00.000Z"
}
}