---
title: "Test Prompt"
method: POST
path: "/prompts/test"
tags: ["prompts"]
---

# Test Prompt

`POST /prompts/test`

Test a prompt by rendering it with variables and executing an LLM call.

This endpoint allows testing prompts before saving them to the database.
The response is always streamed.

👉 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)

Example Request:
```bash
curl -X POST "http://localhost:4000/prompts/test" \
    -H "Authorization: Bearer <your_api_key>" \
    -H "Content-Type: application/json" \
    -d '{
        "dotprompt_content": "---\nmodel: gpt-4o\ntemperature: 0.7\n---\n\nUser: Hello {{name}}",
        "prompt_variables": {
            "name": "World"
        }
    }'
```

## Request body

- TestPromptRequest
  - `conversation_history` object[], nullable
  - `dotprompt_content` string, required
  - `prompt_variables` object, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-15** `19cc785a8024` — 2 info
  - api tag `prompts` added
  - api tag `Prompt Management` removed
- **2026-08-14** `9c80d9af446a` — 2 info
  - api tag `Prompt Management` added
  - api tag `prompts` removed

[Change history](https://skmtc.dev/flock/apis/litellm-api/changes/prompts/test/post.md)

---

[API](https://skmtc.dev/flock/apis/litellm-api.md) · [All operations](https://skmtc.dev/flock/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flock/litellm-api/revisions/19cc785a8024/schema)
