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

# Create a prompt version

> Create a prompt version



## OpenAPI

````yaml /public-apis/openapi/prompts.json post /v1/prompts/versions
openapi: 3.0.0
info:
  version: 1.0.0
  contact:
    name: Maxim Engineering
    email: eng@getmaxim.ai
  title: Maxim SDK API - prompts
  description: API documentation for Maxim SDK prompts endpoints
servers:
  - url: https://api.getmaxim.ai
security: []
paths:
  /v1/prompts/versions:
    post:
      tags:
        - Prompt Version
      summary: Create a prompt version
      description: Create a prompt version
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                promptId:
                  type: string
                  description: Prompt identifier
                description:
                  type: string
                  description: Version description
                modelName:
                  type: string
                  description: Name of the model
                modelProvider:
                  type: string
                  enum:
                    - openai
                    - azure
                    - huggingface
                    - anthropic
                    - together
                    - google
                    - groq
                    - bedrock
                    - maxim
                    - cohere
                    - ollama
                    - xai
                    - vertex
                    - mistral
                    - fireworks
                  description: Provider of the model
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum:
                          - assistant
                          - user
                          - system
                          - model
                          - chatbot
                          - tool
                        description: Role of the message sender
                      content:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              anyOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - text
                                      description: Content type
                                    text:
                                      type: string
                                      description: Text content
                                  required:
                                    - type
                                    - text
                                  description: Text content object
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - image_url
                                      description: Content type
                                    image_url:
                                      type: object
                                      properties:
                                        url:
                                          type: string
                                          description: Image URL
                                        detail:
                                          type: string
                                          enum:
                                            - auto
                                            - low
                                            - high
                                          description: Image detail level
                                      required:
                                        - url
                                      description: Image URL configuration
                                  required:
                                    - type
                                    - image_url
                                  description: Image URL content object
                              description: Content schema
                          - nullable: true
                        description: Message content
                      tool_call_id:
                        type: string
                        description: Tool call ID for tool messages
                      tool_calls:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Tool call identifier
                            type:
                              type: string
                              enum:
                                - function
                              description: Tool call type
                            function:
                              type: object
                              properties:
                                name:
                                  type: string
                                  description: Function name
                                arguments:
                                  type: string
                                  description: Function arguments as JSON string
                              required:
                                - name
                                - arguments
                              description: Function call details
                          required:
                            - id
                            - type
                            - function
                          description: Tool call object
                        description: Tool calls made by the assistant in this message
                    required:
                      - role
                    description: Message to send to the model
                  description: Array of messages
                modelParameters:
                  type: object
                  properties:
                    promptTools:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                            description: Tool name
                          description:
                            type: string
                            description: Tool description
                          config:
                            type: object
                            additionalProperties:
                              nullable: true
                            description: Tool configuration
                        required:
                          - name
                      description: Array of prompt tools
                  default: {}
                  additionalProperties:
                    nullable: true
                  description: Model parameters including prompt tools
              required:
                - promptId
                - description
                - modelName
                - modelProvider
                - messages
      responses:
        '200':
          description: Prompt version created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      version:
                        type: number
                      description:
                        type: string
                      promptId:
                        type: string
                      config:
                        type: object
                        properties:
                          model:
                            type: string
                          author:
                            type: object
                            properties:
                              id:
                                type: string
                              name:
                                type: string
                              email:
                                type: string
                              image:
                                type: string
                            required:
                              - id
                              - name
                              - email
                              - image
                          messages:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                index:
                                  type: number
                                payload:
                                  type: object
                                  properties:
                                    role:
                                      type: string
                                    content:
                                      type: string
                                  required:
                                    - role
                                    - content
                                currentType:
                                  type: string
                                originalType:
                                  type: string
                              required:
                                - id
                                - index
                                - payload
                                - currentType
                                - originalType
                          provider:
                            type: string
                          modelParameters:
                            type: object
                            properties:
                              top_p:
                                type: number
                              max_tokens:
                                type: number
                              promptTools:
                                type: array
                                items:
                                  nullable: true
                              temperature:
                                type: number
                              image_detail:
                                type: object
                                properties:
                                  detail:
                                    type: string
                                required:
                                  - detail
                              response_format:
                                type: object
                                properties:
                                  type:
                                    type: string
                                required:
                                  - type
                              frequency_penalty:
                                type: number
                            required:
                              - top_p
                              - max_tokens
                              - promptTools
                              - temperature
                              - image_detail
                              - response_format
                              - frequency_penalty
                        required:
                          - model
                          - author
                          - messages
                          - provider
                          - modelParameters
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      deletedAt:
                        type: string
                        nullable: true
                    required:
                      - id
                      - version
                      - description
                      - promptId
                      - config
                      - createdAt
                      - updatedAt
                      - deletedAt
                required:
                  - data
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
        '404':
          description: Prompt not found
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-maxim-api-key
      description: API key for authentication

````