Skip to Content
Playground is live 🎉 Test up to 9 models at a time against your prompts.Try it out here.
Docs homepage

PromptStash Documentation

Welcome to the PromptStash docs. This guide helps you get an API key and retrieve prompts from your projects, plus links to explore the Playground.

Create an API key

You can create and manage API keys in the app.

  1. Go to /app/api-keys.
  2. Click “Create API Key” and give it a descriptive name.
  3. Copy the generated key and store it securely. It is shown only once.

API Keys page

Retrieve a prompt from the API

Use the public endpoint to retrieve a prompt version by slug.

  • Method: GET
  • URL: https://promptstash.app/api/prompts/retrieve
  • Required headers:
    • x-api-key: your API key
    • x-project-slug: the project slug
    • x-prompt-slug: the prompt slug
  • Optional headers:
    • x-tag: version tag to target; defaults to active

Successful response (200):

{ "content": "...prompt content...", "name": "Version name", "version": 3, "tags": ["active"] }

Error responses:

  • 400: { ok: false, error: "Missing required headers" }
  • 401: { ok: false, error: "Invalid API key" }
  • 404: { ok: false, error: "Prompt not found or has no matching versions" }

Example using curl:

curl -X GET \ 'https://promptstash.app/api/prompts/retrieve' \ -H 'x-api-key: YOUR_API_KEY' \ -H 'x-project-slug: your-project' \ -H 'x-prompt-slug: your-prompt' \ -H 'x-tag: active'

Example using fetch:

const res = await fetch("https://promptstash.app/api/prompts/retrieve", { method: "GET", headers: { "x-api-key": process.env.PROMPTSTASH_API_KEY!, "x-project-slug": "your-project", "x-prompt-slug": "your-prompt", // 'x-tag': 'active', // optional }, }); if (!res.ok) throw new Error(await res.text()); const data = await res.json(); // data: { content, name, version, tags }

Next steps

Last updated on