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

# Fetch Deployed Prompt

> Given a deployment_id, fetches the deployed prompt and its details. Can be optionally used to fill-in the templated prompt with provided inputs.

<RequestExample>
  ```python python theme={null}
  p = Parea(api_key="PAREA_API_KEY")  # replace with your API key

  def main() -> UseDeployedPromptResponse:
      return p.get_prompt(
          UseDeployedPrompt(
              deployment_id="p-qZrnFesaeCpqcXJ_yL3wi",
              llm_inputs={"x": "Python", "y": "Flask"},
          )
      )
  ```

  ```typescript typescript theme={null}
  const p = new Parea("PAREA_API_KEY"); // replace with your API key

  export const main = async (): Promise<UseDeployedPromptResponse> => {
    return await p.getPrompt({
      deployment_id: 'p-qZrnFesaeCpqcXJ_yL3wi',
      llm_inputs: {
          x: "Python", y: "Flask",
      },
    });
  };
  ```

  ```bash Example Request theme={null}
  curl --location 'https://parea-ai-backend-us-9ac16cdbc7a7b006.onporter.run/api/parea/v1/deployed-prompt' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: PAREA_API_KEY' \
  --data '{
      "deployment_id": "p-qZrnFesaeCpqcXJ_yL3wi",
      "llm_inputs": {"x": "Python", "y": "Flask"}
  }'
  ```
</RequestExample>


## OpenAPI

````yaml post /api/parea/v1/deployed-prompt
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /api/parea/v1/deployed-prompt:
    post:
      summary: Fetch Deployed Prompt
      description: >-
        Given a deployment_id, fetches the deployed prompt and its details. Can
        be optionally used to fill-in the templated prompt with provided inputs.
      operationId: fetch_deployed_prompt_api_parea_v1_deployed_prompt_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeploymentPromptIdSchema'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDeployedPromptResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - APIKeyHeader: []
        - APIKeyHeader: []
components:
  schemas:
    DeploymentPromptIdSchema:
      properties:
        deployment_id:
          type: string
          title: Deployment Id
          description: ID of deployed prompt
        llm_inputs:
          anyOf:
            - type: object
            - type: 'null'
          title: Llm Inputs
          description: >-
            If provided, these key-value pairs will be used to replace the
            corresponding keys in the templated prompt
      type: object
      required:
        - deployment_id
      title: DeploymentPromptIdSchema
      example:
        deployment_id: p-qZrnFesaeCpqcXJ_yL3wi
        llm_inputs:
          x: Python
          'y': Flask
    GetDeployedPromptResponseSchema:
      properties:
        deployment_id:
          type: string
          title: Deployment Id
          description: >-
            This is the ID for a deployed prompt. You can find your deployed
            prompts on the Deployments tab.
        version_number:
          type: number
          title: Version Number
          description: Version number of the deployed prompt
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the deployed prompt
        functions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Functions
          description: If deployed prompt has function, these will appear as JSON strings.
        function_call:
          anyOf:
            - type: string
            - type: 'null'
          title: Function Call
          description: If deployed prompt has a specified function call, it will appear.
        prompt:
          anyOf:
            - $ref: '#/components/schemas/PromptSchema'
            - type: 'null'
          description: The messages of the deployed prompt
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: Model name of deployed prompt
        provider:
          anyOf:
            - $ref: '#/components/schemas/ProviderName'
            - type: 'null'
          description: Provider name of deployed prompt
        model_params:
          anyOf:
            - type: object
            - type: 'null'
          title: Model Params
          description: Model parameters of deployed prompt
      type: object
      required:
        - deployment_id
        - version_number
      title: GetDeployedPromptResponseSchema
      examples:
        - deployment_id: p-qZrnFesaeCpqcXJ_yL3wi
          functions: []
          model: gpt-4o-mini
          model_params:
            frequency_penalty: 0
            presence_penalty: 0
            temp: 0.5
            top_p: 1
          name: hello world
          prompt:
            inputs:
              x: Python
              'y': Flask
            messages:
              - content: >-
                  I want a Hello World program in Python. Using the Flask
                  framework.
                role: user
            raw_messages:
              - content: >-
                  I want a Hello World program in {{x}}. Using the {{y}}
                  framework.
                role: user
          provider: openai
          version_number: 1
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PromptSchema:
      properties:
        raw_messages:
          items:
            type: object
          type: array
          title: Raw Messages
          description: List of templated messages as they were created in the UI.
        messages:
          items:
            type: object
          type: array
          title: Messages
          description: >-
            If `inputs` were given in request, these messages will be the
            filled-in version of `raw_messages`. Otherwise, they will be the
            same as `raw_messages`.
        inputs:
          anyOf:
            - type: object
            - type: 'null'
          title: Inputs
          description: >-
            If you would like to fill in your prompt template with inputs you
            can provided then as a dictionary. The keys should match the names
            of the deployed prompt templateâ€™s variables.
      type: object
      required:
        - raw_messages
        - messages
      title: PromptSchema
    ProviderName:
      type: string
      enum:
        - openai
        - azure
        - anthropic
        - anyscale
        - vertexai
        - aws_bedrock
        - openrouter
        - mistral
        - litellm
        - groq
        - fireworks
        - cohere
      title: ProviderName
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-user-id

````