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

# Generate an improved prompt based on comparison results



## OpenAPI

````yaml https://raw.githubusercontent.com/getplumai/docs/refs/heads/main/api-reference/openapi.yaml post /improve_prompt
openapi: 3.0.0
info:
  title: Plum API
  version: 1.1.0
servers:
  - url: https://beta.getplum.ai/v1
security: []
paths:
  /improve_prompt:
    post:
      summary: Generate an improved prompt based on comparison results
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt_comparison_results:
                  type: object
                  description: Results from the /compare_prompts endpoint
                seed_data_id:
                  type: string
                  description: Optional ID of seed dataset to use for prompt improvement
              required:
                - prompt_comparison_results
      responses:
        '200':
          description: Improved prompt successfully generated
          content:
            application/json:
              schema:
                type: object
                properties:
                  improved_prompt:
                    type: string
                  original_prompt:
                    type: string
                  metrics_id:
                    type: string
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````