> ## 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.

# Create an Endpoint

> Step-by-step guide to creating a new endpoint

This guide walks you through creating a new endpoint from scratch.

## Before You Start

Think about:

* **What will this endpoint do?** — Summarize text? Classify content? Generate responses?
* **What inputs does it need?** — Text, numbers, options, files?
* **What outputs should it return?** — Structured JSON? Simple text?

## Creating the Endpoint

<Steps>
  <Step title="Navigate to Endpoints">
    Click **Endpoints** in the sidebar to open the endpoints list.
  </Step>

  <Step title="Click Create">
    Click the **Create Endpoint** button in the top-right corner.
  </Step>

  <Step title="Fill in Basic Details">
    Complete the form:

    | Field           | Description                   | Example                                                            |
    | --------------- | ----------------------------- | ------------------------------------------------------------------ |
    | **Name**        | Human-readable name           | `Email Subject Generator`                                          |
    | **Path**        | API URL path (must be unique) | `/api/v1/generate-subject`                                         |
    | **Category**    | Organizational group          | `Email`                                                            |
    | **Description** | What this endpoint does       | `Generates compelling email subject lines from email body content` |
  </Step>

  <Step title="Set Visibility">
    Choose who can see this endpoint:

    * **Public** — All team members can view and use
    * **Internal** — Only visible to you and admins
  </Step>

  <Step title="Save">
    Click **Create** to save your endpoint.
  </Step>
</Steps>

## Path Requirements

Your endpoint path must follow these rules:

<AccordionGroup>
  <Accordion title="Must start with /api/v1/" icon="check">
    All paths begin with `/api/v1/` for consistency and future versioning.

    ✅ `/api/v1/summarize`\
    ❌ `/summarize`
  </Accordion>

  <Accordion title="Must be unique" icon="fingerprint">
    No two endpoints can have the same path within your tenant.
  </Accordion>

  <Accordion title="Use lowercase and hyphens" icon="font">
    Paths should be lowercase with hyphens separating words.

    ✅ `/api/v1/generate-subject`\
    ❌ `/api/v1/GenerateSubject`
  </Accordion>

  <Accordion title="Keep it short and descriptive" icon="text">
    Good paths describe what the endpoint does.

    ✅ `/api/v1/classify-sentiment`\
    ❌ `/api/v1/do-the-thing`
  </Accordion>
</AccordionGroup>

## After Creation

Once created, you'll land on the endpoint detail page. From here you should:

1. **Define Input Schema** — Specify what data your endpoint accepts
2. **Define Output Schema** (optional) — Specify the response structure
3. **Create a Prompt** — Write the LLM instruction
4. **Test** — Verify everything works
5. **Set Default** — Promote and set the default prompt

<Note>
  An endpoint without a default prompt will return an error when called. Make sure to create and set a default prompt before using it in production.
</Note>

## Example: Building a Sentiment Analyzer

Let's create a complete endpoint for sentiment analysis:

### Step 1: Basic Details

| Field       | Value                                                                                     |
| ----------- | ----------------------------------------------------------------------------------------- |
| Name        | `Sentiment Analyzer`                                                                      |
| Path        | `/api/v1/analyze-sentiment`                                                               |
| Category    | `Analysis`                                                                                |
| Description | `Analyzes text and returns sentiment (positive, negative, neutral) with confidence score` |

### Step 2: Input Schema

Add one required field:

| Field  | Type   | Required | Description         |
| ------ | ------ | -------- | ------------------- |
| `text` | String | Yes      | The text to analyze |

### Step 3: Output Schema

Define the expected response:

| Field         | Type   | Description                             |
| ------------- | ------ | --------------------------------------- |
| `sentiment`   | String | One of: positive, negative, neutral     |
| `confidence`  | Number | Confidence score between 0 and 1        |
| `explanation` | String | Brief explanation of the classification |

### Step 4: Create Prompt

```liquid theme={null}
Analyze the sentiment of the following text and classify it as positive, negative, or neutral.

Text to analyze:
{{ inputs.text }}

Respond with a JSON object containing:
- sentiment: "positive", "negative", or "neutral"
- confidence: a number between 0 and 1 indicating your confidence
- explanation: a brief explanation of why you chose this classification

Be accurate and objective in your analysis.
```

## Duplicating Endpoints

Need a similar endpoint? You can duplicate an existing one:

1. Find the endpoint in your list
2. Click the **⋯** menu
3. Select **Duplicate**
4. Modify the name and path
5. Adjust schema and prompts as needed

<Tip>
  Duplicating is great for creating variations (e.g., `summarize-short` and `summarize-detailed`) that share similar structures.
</Tip>

## Deleting Endpoints

<Warning>
  Deleting an endpoint is permanent and will break any applications using it. Make sure nothing depends on the endpoint before deleting.
</Warning>

To delete:

1. Go to the endpoint's **Settings** tab
2. Scroll to the Danger Zone
3. Click **Delete Endpoint**
4. Confirm by typing the endpoint name

## Next Steps

<CardGroup cols={2}>
  <Card title="Define Input Schema" icon="arrow-right-to-bracket" href="/endpoints/input-schema">
    Specify what data your endpoint accepts
  </Card>

  <Card title="Define Output Schema" icon="arrow-right-from-bracket" href="/endpoints/output-schema">
    Specify what data your endpoint returns
  </Card>
</CardGroup>
