Skip to content

Prompts

What is a prompt?

A prompt is a reusable template that defines how an AI model should process your inputs. Each prompt specifies the model to use, the input fields it expects, and the output format it produces. Prompts are created and published by authors in the BetterPrompt marketplace.

Every prompt has a unique promptId (a UUID) that you use to reference it in API calls.

Versions

Prompts can be updated over time. Each published update creates a new version with its own promptVersionId. When you call the API without specifying a version, you get the latest published version.

You can pin your integration to a specific version to avoid unexpected changes:

bash
# Get the latest version (default)
curl "https://api.betterprompt.me/v1/prompts/<PROMPT_ID>" \
  -H "Authorization: Bearer $BETTERPROMPT_API_KEY"

# Pin to a specific version
curl "https://api.betterprompt.me/v1/prompts/<PROMPT_ID>?versionId=<VERSION_ID>" \
  -H "Authorization: Bearer $BETTERPROMPT_API_KEY"

Input configuration

Each prompt defines the inputs it expects. When you retrieve a prompt or prompt version, the response includes a config object describing the input configuration.

Inputs are split into two categories:

  • textInputs — free-form text fields. Each key is an input your code must provide as a string value.
  • imageInputs — images the prompt expects. Images can be provided as URLs or Base64-encoded strings.

Retrieve the input configuration via GET /v1/prompts/:promptId or GET /v1/prompt-versions/:promptVersionId.

Discovering prompts

Browse the BetterPrompt marketplace or search programmatically using the API:

bash
curl "https://api.betterprompt.me/v1/prompts/publish?q=blog" \
  -H "Authorization: Bearer $BETTERPROMPT_API_KEY"

Typical workflow

  1. Find a prompt — browse the marketplace or use Search prompts.
  2. Inspect the prompt — call Retrieve a prompt to get its configuration and metadata.
  3. Run it — send the matching inputs to Create a run.

API reference