> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endprompt.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompts Overview

> Understanding prompts and how they power your endpoints

Prompts are the instructions that tell the LLM what to do. In Endprompt, prompts are versioned, testable, and independent from your endpoint URLs—letting you iterate safely without changing your application code.

## What is a Prompt?

A prompt consists of:

* **Template** — The instruction text, using Liquid templating
* **Model** — Which LLM to use (GPT-4, Claude, etc.)
* **Settings** — Temperature, max tokens, and other parameters
* **Status** — Draft, Live, or Archived

```liquid theme={null}
You are a helpful assistant that summarizes text.

## Instructions
- Read the text carefully
- Extract the main points
- Write a concise summary

## Text
{{ inputs.text }}

## Output
Return a JSON object with a "summary" field.
```

## Why Prompts Are Powerful

<CardGroup cols={2}>
  <Card title="Versioning" icon="code-branch">
    Every save creates a version. Rollback instantly if something breaks.
  </Card>

  <Card title="A/B Testing" icon="vials">
    Attach multiple prompts to one endpoint. Test which performs better.
  </Card>

  <Card title="Safe Iteration" icon="shield-check">
    Test changes in Draft status before promoting to Live.
  </Card>

  <Card title="Model Flexibility" icon="arrows-rotate">
    Switch models without changing code. Try GPT-4 vs Claude instantly.
  </Card>
</CardGroup>

## Prompt Lifecycle

Prompts follow a status workflow:

```mermaid theme={null}
stateDiagram-v2
    [*] --> Draft: Create
    Draft --> Live: Promote
    Live --> Draft: Demote
    Live --> Archived: Archive
    Draft --> Archived: Archive
    Archived --> Draft: Restore
```

| Status       | Description                   | Can be Default? |
| ------------ | ----------------------------- | --------------- |
| **Draft**    | Work in progress, for testing | No              |
| **Live**     | Production-ready              | Yes             |
| **Archived** | Deprecated, hidden from lists | No              |

## Prompts vs Endpoints

Understanding the relationship:

| Concept          | What It Is                 | Example                        |
| ---------------- | -------------------------- | ------------------------------ |
| **Endpoint**     | Stable API URL             | `/api/v1/summarize`            |
| **Prompt**       | LLM instruction template   | "Summarize this text..."       |
| **Relationship** | One endpoint, many prompts | Endpoint has 3 prompt versions |

<Tip>
  Your integration code calls the endpoint URL. The prompt can change behind the scenes without affecting your code.
</Tip>

## Multiple Prompts per Endpoint

You can attach multiple prompts to a single endpoint:

* **Different models** — GPT-4 for quality, GPT-3.5 for speed
* **Different approaches** — Concise summary vs detailed analysis
* **Different versions** — v1, v2, v3 of your prompt
* **A/B testing** — Compare performance between prompts

When calling your endpoint, you can specify which prompt to use:

```bash theme={null}
# Use default prompt
curl -X POST .../api/v1/summarize

# Use specific prompt
curl -X POST .../api/v1/summarize?prompt=detailed-summary-v2
```

## The Prompt Editor

The prompt editor provides:

* **Syntax highlighting** for Liquid templates
* **Variable autocomplete** for input fields
* **Live preview** of rendered output
* **Side-by-side testing** to run and see results immediately

## Key Components

<AccordionGroup>
  <Accordion title="Template" icon="file-code">
    The instruction text sent to the LLM. Uses Liquid templating to inject input values.
  </Accordion>

  <Accordion title="Model Selection" icon="microchip">
    Choose from supported providers (OpenAI, Anthropic) and models (GPT-4, Claude).
  </Accordion>

  <Accordion title="Temperature" icon="temperature-half">
    Controls randomness. Lower (0.1-0.3) for consistent outputs, higher (0.7-1.0) for creativity.
  </Accordion>

  <Accordion title="Max Tokens" icon="text-size">
    Maximum length of the LLM response. Higher values allow longer outputs but cost more.
  </Accordion>

  <Accordion title="System Prompt" icon="terminal">
    Optional system-level instruction that sets the AI's persona or behavior (for models that support it).
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Liquid Templating" icon="code" href="/prompts/liquid-templating">
    Learn the template syntax for dynamic prompts
  </Card>

  <Card title="Create a Prompt" icon="plus" href="/prompts/create-prompt">
    Step-by-step guide to creating your first prompt
  </Card>
</CardGroup>
