Developer API

Integrate OpenPrompt directly into your applications. Fetch your managed prompts programmatically with our simple REST API.

Authentication

Secure access to your private prompts.

Public prompts can be accessed without authentication. For private prompts, you must include your API key in the request header.

Get your API Key

Generate keys in your profile settings.

GET/api/v1/prompt

Parameters

slug
Required
String
The unique identifier of the prompt.
version
Optional
Integer
Specific version number. Defaults to latest.

Headers

x-api-key
Optional
String
Required for private prompts.

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"
  }
}