Developers
Public catalog API
Browse and invoke public prompts without signing in
API base URL
https://api.promptcache.app
Public endpoints do not require authentication for read and invoke. Fork requires a signed-in user (JWT from POST /api/v1/auth/login).
Use the @optiqlabs/promptcache-sdk package for a typed client, see JavaScript / TypeScript SDK.
List public prompts
Code
GET /api/v1/public/prompts?page=1&limit=20&search=&tags=Responses may include Cache-Control: public, max-age=60, stale-while-revalidate=300.
Response
Code
{
"prompts": [
{
"_id": "…",
"name": "Email Responder",
"description": "…",
"variables": [],
"tags": ["email"],
"author": { "name": "Alice Smith", "imageUrl": "…" },
"forkCount": 12,
"viewCount": 340
}
],
"pagination": { "page": 1, "limit": 20, "total": 42, "pages": 3 }
}Get a public prompt
Code
GET /api/v1/public/prompts/:idIncrements viewCount on each call.
Invoke a public prompt
Code
POST /api/v1/public/prompts/:id/invoke
Content-Type: application/json
{ "variables": { "customer_name": "Alice" } }Same response shape as authenticated invoke.
Fork a public prompt
Requires a user session (Bearer JWT). Forks the last published version into the target organization.
Code
POST /api/v1/public/prompts/:id/fork
Authorization: Bearer <access_jwt>
Content-Type: application/json
{
"organizationId": "<orgId>",
"name": "My Copy of Email Responder"
}ACTIVEmembership inorganizationId.- Forked prompt is private by default.
forkedFromVersionIdpoints at the source published version.- Increments
forkCounton the public prompt.
