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

# Prompts SDK Reference

> SDK reference for the Prompts API, available in Node.js and Python.

## Prompts

### List Prompts

Returns a list of your prompts. The prompts are returned sorted by creation date, with the most recent prompts appearing first

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.prompts.list(limit=10)

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.prompts.list({});

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "limit": Optional[int],
        "starting_after": Optional[str],
        "ending_before": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      limit?: number;
      startingAfter?: string;
      endingBefore?: string;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "object": Literal["list"],
        "data": {
            "id": str,
            "type": Literal["prompt"],
            "owner": str,
            "domain_id": str,
            "created": str,
            "updated": str,
            "created_by_id": OptionalNullable[str],
            "updated_by_id": OptionalNullable[str],
            "display_name": str,
            "description": OptionalNullable[str],
            "~~`prompt_config`~~": {  # optional
                "stream": Optional[bool],
                "model": OptionalNullable[str],
                "model_db_id": OptionalNullable[str],
                "model_type": OptionalNullable[GetAllPromptsModelType],
                "model_parameters": {  # optional
                    "temperature": Optional[float],
                    "max_tokens": Optional[float],
                    "top_k": Optional[float],
                    "top_p": Optional[float],
                    "frequency_penalty": Optional[float],
                    "presence_penalty": Optional[float],
                    "num_images": Optional[float],
                    "seed": Optional[float],
                    "format_": Optional[Literal["url", "b64_json", "text", "json_object"]],
                    "dimensions": Optional[str],
                    "quality": Optional[str],
                    "style": Optional[str],
                    "response_format": Union[GetAllPromptsResponseFormat1, GetAllPromptsResponseFormat2, GetAllPromptsResponseFormat3, GetAllPromptsResponseFormat4, GetAllPromptsResponseFormat5, GetAllPromptsResponseFormat6],
                    "cache_control": {  # optional
                        "type": Literal["ephemeral"],
                        "ttl": Optional[Literal["5m", "1h"]],
                    },
                    "photo_real_version": Optional[Literal["v1", "v2"]],
                    "encoding_format": Optional[Literal["float", "base64"]],
                    "reasoning_effort": Optional[Literal["none", "disable", "minimal", "low", "medium", "high"]],
                    "budget_tokens": Optional[float],
                    "verbosity": Optional[Literal["low", "medium", "high"]],
                    "thinking_level": Optional[Literal["low", "medium", "high"]],
                },
                "provider": OptionalNullable[GetAllPromptsProvider],
                "integration_id": OptionalNullable[str],
                "version": Optional[str],
                "messages": {
                    "role": Literal["system", "developer", "assistant", "user", "exception", "tool", "prompt", "correction", "expected_output"],
                    "content": Union[str, List[GetAllPromptsContent2]],
                    "tool_calls": {  # optional
                        "id": Optional[str],
                        "index": Optional[float],
                        "type": Literal["function"],
                        "function": {
                            "name": str,
                            "arguments": str,
                        },
                    },
                    "tool_call_id": OptionalNullable[str],
                },
            },
            "prompt": {
                "name": Optional[str],
                "audio": {  # optional
                    "voice": Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
                    "format_": Literal["wav", "mp3", "flac", "opus", "pcm16"],
                },
                "frequency_penalty": OptionalNullable[float],
                "max_tokens": OptionalNullable[int],
                "max_completion_tokens": OptionalNullable[int],
                "logprobs": OptionalNullable[bool],
                "top_logprobs": OptionalNullable[int],
                "n": OptionalNullable[int],
                "presence_penalty": OptionalNullable[float],
                "response_format": Union[GetAllPromptsResponseFormatText, GetAllPromptsResponseFormatJSONObject, GetAllPromptsResponseFormatPromptsJSONSchema],
                "reasoning_effort": Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]],
                "verbosity": Optional[str],
                "seed": OptionalNullable[float],
                "stop": Union[str, List[str]],
                "stream_options": {  # optional
                    "include_usage": Optional[bool],
                },
                "thinking": Union[ThinkingConfigDisabledSchema, ThinkingConfigEnabledSchema, ThinkingConfigAdaptiveSchema],
                "temperature": OptionalNullable[float],
                "top_p": OptionalNullable[float],
                "top_k": OptionalNullable[float],
                "tool_choice": Union[GetAllPromptsToolChoice1, GetAllPromptsToolChoice2],
                "parallel_tool_calls": Optional[bool],
                "modalities": List[Literal["text", "audio"]],
                "guardrails": {  # optional
                    "id": Union[GetAllPromptsID1, str],
                    "execute_on": Literal["input", "output"],
                },
                "plugins": Union[PIIRedactionPluginAuto, PIIRedactionPluginEn, PIIRedactionPluginNl],
                "fallbacks": {  # optional
                    "model": str,
                },
                "retry": {  # optional
                    "count": Optional[float],
                    "on_codes": List[float],
                },
                "cache": {  # optional
                    "ttl": Optional[float],
                    "type": Literal["exact_match"],
                },
                "load_balancer": Union[GetAllPromptsLoadBalancer1],
                "timeout": {  # optional
                    "call_timeout": float,
                },
                "cache_control": {  # optional
                    "type": Literal["ephemeral"],
                    "ttl": Optional[Literal["5m", "1h"]],
                },
                "prompt_cache_key": Optional[str],
                "messages": Union[GetAllPromptsMessagesSystemMessage, GetAllPromptsMessagesUserMessage, GetAllPromptsMessagesAssistantMessage, GetAllPromptsMessagesToolMessage],
                "model": OptionalNullable[str],
                "version": Optional[str],
            },
            "metadata": {  # optional
                "use_cases": List[Literal["Agents simulations", "Agents", "API interaction", "Autonomous Agents", "Chatbots", "Classification", "Code understanding", "Code writing", "Conversation", "Documents QA", "Evaluation", "Extraction", "Multi-modal", "Self-checking", "Sentiment analysis", "SQL", "Summarization", "Tagging", "Translation (document)", "Translation (sentences)"]],
                "language": OptionalNullable[GetAllPromptsLanguage],
            },
        },
        "has_more": bool,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      object: string;
      data: {
        id: string;
        type: string;
        owner: string;
        domainId: string;
        created: string;
        updated: string;
        createdById?: string;
        updatedById?: string;
        displayName: string;
        description?: string;
        ~~`promptConfig`~~?: {
          stream?: boolean;
          model?: string;
          modelDbId?: string;
          modelType?: string;
          modelParameters?: {
            temperature?: number;
            maxTokens?: number;
            topK?: number;
            topP?: number;
            frequencyPenalty?: number;
            presencePenalty?: number;
            numImages?: number;
            seed?: number;
            format?: string;
            dimensions?: string;
            quality?: string;
            style?: string;
            responseFormat?: string;
            cacheControl?: {
              type: string;
              ttl?: string;
            };
            photoRealVersion?: string;
            encodingFormat?: string;
            reasoningEffort?: string;
            budgetTokens?: number;
            verbosity?: string;
            thinkingLevel?: string;
          };
          provider?: string;
          integrationId?: string;
          version?: string;
          messages: {
            role: string;
            content: string;
            toolCalls?: {
              id?: string;
              index?: number;
              type: string;
              function: {
                name: string;
                arguments: string;
              };
            };
            toolCallId?: string;
          };
        };
        prompt: {
          name?: string;
          audio?: {
            voice: string;
            format: string;
          };
          frequencyPenalty?: number;
          maxTokens?: number;
          maxCompletionTokens?: number;
          logprobs?: boolean;
          topLogprobs?: number;
          n?: number;
          presencePenalty?: number;
          responseFormat?: string;
          reasoningEffort?: string;
          verbosity?: string;
          seed?: number;
          stop?: string | string[];
          streamOptions?: {
            includeUsage?: boolean;
          };
          thinking?: string;
          temperature?: number;
          topP?: number;
          topK?: number;
          toolChoice?: string;
          parallelToolCalls?: boolean;
          modalities?: string;
          guardrails?: {
            id: string;
            executeOn: string;
          };
          plugins?: string;
          fallbacks?: {
            model: string;
          };
          retry?: {
            count?: number;
            onCodes?: number[];
          };
          cache?: {
            ttl?: number;
            type: string;
          };
          loadBalancer?: string;
          timeout?: {
            callTimeout: number;
          };
          cacheControl?: {
            type: string;
            ttl?: string;
          };
          promptCacheKey?: string;
          messages?: string;
          model?: string;
          version?: string;
        };
        metadata?: {
          useCases?: string;
          language?: string;
        };
      };
      hasMore: boolean;
    }
    ```
  </CodeGroup>
</Expandable>

### Create a Prompt

Create a prompt

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.prompts.create(request={
          "display_name": "Raymundo83",
          "prompt": {
              "messages": [
                  {
                      "role": "system",
                      "content": "You are a helpful assistant",
                  },
                  {
                      "role": "user",
                      "content": "What is the weather today?",
                  },
              ],
              "model": "openai/gpt-4o",
              "max_tokens": 1000,
              "temperature": 0.7,
          },
          "path": "Default",
      })

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.prompts.create({
      displayName: "Raymundo83",
      prompt: {
        messages: [
          {
            role: "system",
            content: "You are a helpful assistant",
          },
          {
            role: "user",
            content: "What is the weather today?",
          },
        ],
        model: "openai/gpt-4o",
        maxTokens: 1000,
        temperature: 0.7,
      },
      path: "Default",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "display_name": str,  # required
        "description": OptionalNullable[str],
        "metadata": {  # optional
            "use_cases": List[Literal["Agents simulations", "Agents", "API interaction", "Autonomous Agents", "Chatbots", "Classification", "Code understanding", "Code writing", "Conversation", "Documents QA", "Evaluation", "Extraction", "Multi-modal", "Self-checking", "Sentiment analysis", "SQL", "Summarization", "Tagging", "Translation (document)", "Translation (sentences)"]],
            "language": OptionalNullable[CreatePromptLanguage],
        },
        "prompt": {  # required
            "messages": Union[CreatePromptMessagesSystemMessage, CreatePromptMessagesUserMessage, CreatePromptMessagesAssistantMessage, CreatePromptMessagesToolMessage],  # required
            "model": Optional[str],
            "name": Optional[str],
            "audio": {  # optional
                "voice": Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"],  # required
                "format_": Literal["wav", "mp3", "flac", "opus", "pcm16"],  # required
            },
            "frequency_penalty": OptionalNullable[float],
            "max_tokens": OptionalNullable[int],
            "max_completion_tokens": OptionalNullable[int],
            "logprobs": OptionalNullable[bool],
            "top_logprobs": OptionalNullable[int],
            "n": OptionalNullable[int],
            "presence_penalty": OptionalNullable[float],
            "response_format": Union[CreatePromptResponseFormatText, CreatePromptResponseFormatJSONObject, CreatePromptResponseFormatJSONSchema],
            "reasoning_effort": Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]],
            "verbosity": Optional[str],
            "seed": OptionalNullable[float],
            "stop": Union[str, List[str]],
            "stream_options": {  # optional
                "include_usage": Optional[bool],
            },
            "thinking": Union[ThinkingConfigDisabledSchema, ThinkingConfigEnabledSchema, ThinkingConfigAdaptiveSchema],
            "temperature": OptionalNullable[float],
            "top_p": OptionalNullable[float],
            "top_k": OptionalNullable[float],
            "tool_choice": Union[CreatePromptToolChoice1, CreatePromptToolChoice2],
            "parallel_tool_calls": Optional[bool],
            "modalities": List[Literal["text", "audio"]],
            "guardrails": {  # optional
                "id": Union[CreatePromptID1, str],  # required
                "execute_on": Literal["input", "output"],  # required
            },
            "plugins": Union[PIIRedactionPluginAuto, PIIRedactionPluginEn, PIIRedactionPluginNl],
            "fallbacks": {  # optional
                "model": str,  # required
            },
            "retry": {  # optional
                "count": Optional[float],
                "on_codes": List[float],
            },
            "cache": {  # optional
                "ttl": Optional[float],
                "type": Literal["exact_match"],  # required
            },
            "load_balancer": Union[CreatePromptLoadBalancer1],
            "timeout": {  # optional
                "call_timeout": float,  # required
            },
            "cache_control": {  # optional
                "type": Literal["ephemeral"],  # required
                "ttl": Optional[Literal["5m", "1h"]],
            },
            "prompt_cache_key": Optional[str],
        },
        "path": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      displayName: string;  // required
      description?: string;
      metadata?: {
        useCases?: string;
        language?: string;
      };
      prompt: {  // required
        messages: string;  // required
        model?: string;
        name?: string;
        audio?: {
          voice: string;  // required
          format: string;  // required
        };
        frequencyPenalty?: number;
        maxTokens?: number;
        maxCompletionTokens?: number;
        logprobs?: boolean;
        topLogprobs?: number;
        n?: number;
        presencePenalty?: number;
        responseFormat?: string;
        reasoningEffort?: string;
        verbosity?: string;
        seed?: number;
        stop?: string | string[];
        streamOptions?: {
          includeUsage?: boolean;
        };
        thinking?: string;
        temperature?: number;
        topP?: number;
        topK?: number;
        toolChoice?: string;
        parallelToolCalls?: boolean;
        modalities?: string;
        guardrails?: {
          id: string;  // required
          executeOn: string;  // required
        };
        plugins?: string;
        fallbacks?: {
          model: string;  // required
        };
        retry?: {
          count?: number;
          onCodes?: number[];
        };
        cache?: {
          ttl?: number;
          type: string;  // required
        };
        loadBalancer?: string;
        timeout?: {
          callTimeout: number;  // required
        };
        cacheControl?: {
          type: string;  // required
          ttl?: string;
        };
        promptCacheKey?: string;
      };
      path: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "type": Literal["prompt"],
        "owner": str,
        "domain_id": str,
        "created": str,
        "updated": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "display_name": str,
        "description": OptionalNullable[str],
        "~~`prompt_config`~~": {  # optional
            "stream": Optional[bool],
            "model": OptionalNullable[str],
            "model_db_id": OptionalNullable[str],
            "model_type": OptionalNullable[ModelType],
            "model_parameters": {  # optional
                "temperature": Optional[float],
                "max_tokens": Optional[float],
                "top_k": Optional[float],
                "top_p": Optional[float],
                "frequency_penalty": Optional[float],
                "presence_penalty": Optional[float],
                "num_images": Optional[float],
                "seed": Optional[float],
                "format_": Optional[Literal["url", "b64_json", "text", "json_object"]],
                "dimensions": Optional[str],
                "quality": Optional[str],
                "style": Optional[str],
                "response_format": Union[CreatePromptResponseFormat1, CreatePromptResponseFormat2, CreatePromptResponseFormat3, CreatePromptResponseFormat4, CreatePromptResponseFormat5, CreatePromptResponseFormat6],
                "cache_control": {  # optional
                    "type": Literal["ephemeral"],
                    "ttl": Optional[Literal["5m", "1h"]],
                },
                "photo_real_version": Optional[Literal["v1", "v2"]],
                "encoding_format": Optional[Literal["float", "base64"]],
                "reasoning_effort": Optional[Literal["none", "disable", "minimal", "low", "medium", "high"]],
                "budget_tokens": Optional[float],
                "verbosity": Optional[Literal["low", "medium", "high"]],
                "thinking_level": Optional[Literal["low", "medium", "high"]],
            },
            "provider": OptionalNullable[CreatePromptProvider],
            "integration_id": OptionalNullable[str],
            "version": Optional[str],
            "messages": {
                "role": Literal["system", "developer", "assistant", "user", "exception", "tool", "prompt", "correction", "expected_output"],
                "content": Union[str, List[CreatePromptContentPromptsResponse2]],
                "tool_calls": {  # optional
                    "id": Optional[str],
                    "index": Optional[float],
                    "type": Literal["function"],
                    "function": {
                        "name": str,
                        "arguments": str,
                    },
                },
                "tool_call_id": OptionalNullable[str],
            },
        },
        "prompt": {
            "name": Optional[str],
            "audio": {  # optional
                "voice": Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
                "format_": Literal["wav", "mp3", "flac", "opus", "pcm16"],
            },
            "frequency_penalty": OptionalNullable[float],
            "max_tokens": OptionalNullable[int],
            "max_completion_tokens": OptionalNullable[int],
            "logprobs": OptionalNullable[bool],
            "top_logprobs": OptionalNullable[int],
            "n": OptionalNullable[int],
            "presence_penalty": OptionalNullable[float],
            "response_format": Union[CreatePromptResponseFormatPromptsText, CreatePromptResponseFormatPromptsJSONObject, CreatePromptResponseFormatPromptsResponse200JSONSchema],
            "reasoning_effort": Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]],
            "verbosity": Optional[str],
            "seed": OptionalNullable[float],
            "stop": Union[str, List[str]],
            "stream_options": {  # optional
                "include_usage": Optional[bool],
            },
            "thinking": Union[ThinkingConfigDisabledSchema, ThinkingConfigEnabledSchema, ThinkingConfigAdaptiveSchema],
            "temperature": OptionalNullable[float],
            "top_p": OptionalNullable[float],
            "top_k": OptionalNullable[float],
            "tool_choice": Union[CreatePromptToolChoicePrompts1, CreatePromptToolChoicePrompts2],
            "parallel_tool_calls": Optional[bool],
            "modalities": List[Literal["text", "audio"]],
            "guardrails": {  # optional
                "id": Union[CreatePromptIDPrompts1, str],
                "execute_on": Literal["input", "output"],
            },
            "plugins": Union[PIIRedactionPluginAuto, PIIRedactionPluginEn, PIIRedactionPluginNl],
            "fallbacks": {  # optional
                "model": str,
            },
            "retry": {  # optional
                "count": Optional[float],
                "on_codes": List[float],
            },
            "cache": {  # optional
                "ttl": Optional[float],
                "type": Literal["exact_match"],
            },
            "load_balancer": Union[CreatePromptLoadBalancerPrompts1],
            "timeout": {  # optional
                "call_timeout": float,
            },
            "cache_control": {  # optional
                "type": Literal["ephemeral"],
                "ttl": Optional[Literal["5m", "1h"]],
            },
            "prompt_cache_key": Optional[str],
            "messages": Union[CreatePromptMessagesPromptsSystemMessage, CreatePromptMessagesPromptsUserMessage, CreatePromptMessagesPromptsAssistantMessage, CreatePromptMessagesPromptsToolMessage],
            "model": OptionalNullable[str],
            "version": Optional[str],
        },
        "metadata": {  # optional
            "use_cases": List[Literal["Agents simulations", "Agents", "API interaction", "Autonomous Agents", "Chatbots", "Classification", "Code understanding", "Code writing", "Conversation", "Documents QA", "Evaluation", "Extraction", "Multi-modal", "Self-checking", "Sentiment analysis", "SQL", "Summarization", "Tagging", "Translation (document)", "Translation (sentences)"]],
            "language": OptionalNullable[CreatePromptPromptsLanguage],
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      type: string;
      owner: string;
      domainId: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      displayName: string;
      description?: string;
      ~~`promptConfig`~~?: {
        stream?: boolean;
        model?: string;
        modelDbId?: string;
        modelType?: string;
        modelParameters?: {
          temperature?: number;
          maxTokens?: number;
          topK?: number;
          topP?: number;
          frequencyPenalty?: number;
          presencePenalty?: number;
          numImages?: number;
          seed?: number;
          format?: string;
          dimensions?: string;
          quality?: string;
          style?: string;
          responseFormat?: string;
          cacheControl?: {
            type: string;
            ttl?: string;
          };
          photoRealVersion?: string;
          encodingFormat?: string;
          reasoningEffort?: string;
          budgetTokens?: number;
          verbosity?: string;
          thinkingLevel?: string;
        };
        provider?: string;
        integrationId?: string;
        version?: string;
        messages: {
          role: string;
          content: string;
          toolCalls?: {
            id?: string;
            index?: number;
            type: string;
            function: {
              name: string;
              arguments: string;
            };
          };
          toolCallId?: string;
        };
      };
      prompt: {
        name?: string;
        audio?: {
          voice: string;
          format: string;
        };
        frequencyPenalty?: number;
        maxTokens?: number;
        maxCompletionTokens?: number;
        logprobs?: boolean;
        topLogprobs?: number;
        n?: number;
        presencePenalty?: number;
        responseFormat?: string;
        reasoningEffort?: string;
        verbosity?: string;
        seed?: number;
        stop?: string | string[];
        streamOptions?: {
          includeUsage?: boolean;
        };
        thinking?: string;
        temperature?: number;
        topP?: number;
        topK?: number;
        toolChoice?: string;
        parallelToolCalls?: boolean;
        modalities?: string;
        guardrails?: {
          id: string;
          executeOn: string;
        };
        plugins?: string;
        fallbacks?: {
          model: string;
        };
        retry?: {
          count?: number;
          onCodes?: number[];
        };
        cache?: {
          ttl?: number;
          type: string;
        };
        loadBalancer?: string;
        timeout?: {
          callTimeout: number;
        };
        cacheControl?: {
          type: string;
          ttl?: string;
        };
        promptCacheKey?: string;
        messages?: string;
        model?: string;
        version?: string;
      };
      metadata?: {
        useCases?: string;
        language?: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Retrieve a Prompt

Retrieves a prompt object

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.prompts.retrieve(id="<id>")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.prompts.retrieve({
      id: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "type": Literal["prompt"],
        "owner": str,
        "domain_id": str,
        "created": str,
        "updated": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "display_name": str,
        "description": OptionalNullable[str],
        "~~`prompt_config`~~": {  # optional
            "stream": Optional[bool],
            "model": OptionalNullable[str],
            "model_db_id": OptionalNullable[str],
            "model_type": OptionalNullable[GetOnePromptModelType],
            "model_parameters": {  # optional
                "temperature": Optional[float],
                "max_tokens": Optional[float],
                "top_k": Optional[float],
                "top_p": Optional[float],
                "frequency_penalty": Optional[float],
                "presence_penalty": Optional[float],
                "num_images": Optional[float],
                "seed": Optional[float],
                "format_": Optional[Literal["url", "b64_json", "text", "json_object"]],
                "dimensions": Optional[str],
                "quality": Optional[str],
                "style": Optional[str],
                "response_format": Union[GetOnePromptResponseFormat1, GetOnePromptResponseFormat2, GetOnePromptResponseFormat3, GetOnePromptResponseFormat4, GetOnePromptResponseFormat5, GetOnePromptResponseFormat6],
                "cache_control": {  # optional
                    "type": Literal["ephemeral"],
                    "ttl": Optional[Literal["5m", "1h"]],
                },
                "photo_real_version": Optional[Literal["v1", "v2"]],
                "encoding_format": Optional[Literal["float", "base64"]],
                "reasoning_effort": Optional[Literal["none", "disable", "minimal", "low", "medium", "high"]],
                "budget_tokens": Optional[float],
                "verbosity": Optional[Literal["low", "medium", "high"]],
                "thinking_level": Optional[Literal["low", "medium", "high"]],
            },
            "provider": OptionalNullable[GetOnePromptProvider],
            "integration_id": OptionalNullable[str],
            "version": Optional[str],
            "messages": {
                "role": Literal["system", "developer", "assistant", "user", "exception", "tool", "prompt", "correction", "expected_output"],
                "content": Union[str, List[GetOnePromptContent2]],
                "tool_calls": {  # optional
                    "id": Optional[str],
                    "index": Optional[float],
                    "type": Literal["function"],
                    "function": {
                        "name": str,
                        "arguments": str,
                    },
                },
                "tool_call_id": OptionalNullable[str],
            },
        },
        "prompt": {
            "name": Optional[str],
            "audio": {  # optional
                "voice": Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
                "format_": Literal["wav", "mp3", "flac", "opus", "pcm16"],
            },
            "frequency_penalty": OptionalNullable[float],
            "max_tokens": OptionalNullable[int],
            "max_completion_tokens": OptionalNullable[int],
            "logprobs": OptionalNullable[bool],
            "top_logprobs": OptionalNullable[int],
            "n": OptionalNullable[int],
            "presence_penalty": OptionalNullable[float],
            "response_format": Union[GetOnePromptResponseFormatText, GetOnePromptResponseFormatJSONObject, GetOnePromptResponseFormatPromptsJSONSchema],
            "reasoning_effort": Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]],
            "verbosity": Optional[str],
            "seed": OptionalNullable[float],
            "stop": Union[str, List[str]],
            "stream_options": {  # optional
                "include_usage": Optional[bool],
            },
            "thinking": Union[ThinkingConfigDisabledSchema, ThinkingConfigEnabledSchema, ThinkingConfigAdaptiveSchema],
            "temperature": OptionalNullable[float],
            "top_p": OptionalNullable[float],
            "top_k": OptionalNullable[float],
            "tool_choice": Union[GetOnePromptToolChoice1, GetOnePromptToolChoice2],
            "parallel_tool_calls": Optional[bool],
            "modalities": List[Literal["text", "audio"]],
            "guardrails": {  # optional
                "id": Union[GetOnePromptID1, str],
                "execute_on": Literal["input", "output"],
            },
            "plugins": Union[PIIRedactionPluginAuto, PIIRedactionPluginEn, PIIRedactionPluginNl],
            "fallbacks": {  # optional
                "model": str,
            },
            "retry": {  # optional
                "count": Optional[float],
                "on_codes": List[float],
            },
            "cache": {  # optional
                "ttl": Optional[float],
                "type": Literal["exact_match"],
            },
            "load_balancer": Union[GetOnePromptLoadBalancer1],
            "timeout": {  # optional
                "call_timeout": float,
            },
            "cache_control": {  # optional
                "type": Literal["ephemeral"],
                "ttl": Optional[Literal["5m", "1h"]],
            },
            "prompt_cache_key": Optional[str],
            "messages": Union[GetOnePromptMessagesSystemMessage, GetOnePromptMessagesUserMessage, GetOnePromptMessagesAssistantMessage, GetOnePromptMessagesToolMessage],
            "model": OptionalNullable[str],
            "version": Optional[str],
        },
        "metadata": {  # optional
            "use_cases": List[Literal["Agents simulations", "Agents", "API interaction", "Autonomous Agents", "Chatbots", "Classification", "Code understanding", "Code writing", "Conversation", "Documents QA", "Evaluation", "Extraction", "Multi-modal", "Self-checking", "Sentiment analysis", "SQL", "Summarization", "Tagging", "Translation (document)", "Translation (sentences)"]],
            "language": OptionalNullable[GetOnePromptLanguage],
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      type: string;
      owner: string;
      domainId: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      displayName: string;
      description?: string;
      ~~`promptConfig`~~?: {
        stream?: boolean;
        model?: string;
        modelDbId?: string;
        modelType?: string;
        modelParameters?: {
          temperature?: number;
          maxTokens?: number;
          topK?: number;
          topP?: number;
          frequencyPenalty?: number;
          presencePenalty?: number;
          numImages?: number;
          seed?: number;
          format?: string;
          dimensions?: string;
          quality?: string;
          style?: string;
          responseFormat?: string;
          cacheControl?: {
            type: string;
            ttl?: string;
          };
          photoRealVersion?: string;
          encodingFormat?: string;
          reasoningEffort?: string;
          budgetTokens?: number;
          verbosity?: string;
          thinkingLevel?: string;
        };
        provider?: string;
        integrationId?: string;
        version?: string;
        messages: {
          role: string;
          content: string;
          toolCalls?: {
            id?: string;
            index?: number;
            type: string;
            function: {
              name: string;
              arguments: string;
            };
          };
          toolCallId?: string;
        };
      };
      prompt: {
        name?: string;
        audio?: {
          voice: string;
          format: string;
        };
        frequencyPenalty?: number;
        maxTokens?: number;
        maxCompletionTokens?: number;
        logprobs?: boolean;
        topLogprobs?: number;
        n?: number;
        presencePenalty?: number;
        responseFormat?: string;
        reasoningEffort?: string;
        verbosity?: string;
        seed?: number;
        stop?: string | string[];
        streamOptions?: {
          includeUsage?: boolean;
        };
        thinking?: string;
        temperature?: number;
        topP?: number;
        topK?: number;
        toolChoice?: string;
        parallelToolCalls?: boolean;
        modalities?: string;
        guardrails?: {
          id: string;
          executeOn: string;
        };
        plugins?: string;
        fallbacks?: {
          model: string;
        };
        retry?: {
          count?: number;
          onCodes?: number[];
        };
        cache?: {
          ttl?: number;
          type: string;
        };
        loadBalancer?: string;
        timeout?: {
          callTimeout: number;
        };
        cacheControl?: {
          type: string;
          ttl?: string;
        };
        promptCacheKey?: string;
        messages?: string;
        model?: string;
        version?: string;
      };
      metadata?: {
        useCases?: string;
        language?: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Update a Prompt

Update a prompt

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.prompts.update(id="<id>", prompt={
          "messages": [
              {
                  "role": "system",
                  "content": "You are a helpful assistant",
              },
              {
                  "role": "user",
                  "content": "Hello!",
              },
          ],
          "model": "anthropic/claude-3-5-sonnet-20241022",
          "temperature": 0.5,
      }, path="Default")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.prompts.update({
      id: "<id>",
      requestBody: {
        prompt: {
          messages: [
            {
              role: "system",
              content: "You are a helpful assistant",
            },
            {
              role: "user",
              content: "Hello!",
            },
          ],
          model: "anthropic/claude-3-5-sonnet-20241022",
          temperature: 0.5,
        },
        path: "Default",
      },
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,  # required
        "owner": Optional[str],
        "domain_id": Optional[str],
        "created": Optional[str],
        "updated": Optional[str],
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "display_name": Optional[str],
        "description": OptionalNullable[str],
        "prompt": {  # optional
            "messages": Union[UpdatePromptMessagesSystemMessage, UpdatePromptMessagesUserMessage, UpdatePromptMessagesAssistantMessage, UpdatePromptMessagesToolMessage],
            "model": OptionalNullable[str],
            "name": Optional[str],
            "audio": {  # optional
                "voice": Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"],  # required
                "format_": Literal["wav", "mp3", "flac", "opus", "pcm16"],  # required
            },
            "frequency_penalty": OptionalNullable[float],
            "max_tokens": OptionalNullable[int],
            "max_completion_tokens": OptionalNullable[int],
            "logprobs": OptionalNullable[bool],
            "top_logprobs": OptionalNullable[int],
            "n": OptionalNullable[int],
            "presence_penalty": OptionalNullable[float],
            "response_format": Union[UpdatePromptResponseFormatText, UpdatePromptResponseFormatJSONObject, UpdatePromptResponseFormatJSONSchema],
            "reasoning_effort": Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]],
            "verbosity": Optional[str],
            "seed": OptionalNullable[float],
            "stop": Union[str, List[str]],
            "stream_options": {  # optional
                "include_usage": Optional[bool],
            },
            "thinking": Union[ThinkingConfigDisabledSchema, ThinkingConfigEnabledSchema, ThinkingConfigAdaptiveSchema],
            "temperature": OptionalNullable[float],
            "top_p": OptionalNullable[float],
            "top_k": OptionalNullable[float],
            "tool_choice": Union[UpdatePromptToolChoice1, UpdatePromptToolChoice2],
            "parallel_tool_calls": Optional[bool],
            "modalities": List[Literal["text", "audio"]],
            "guardrails": {  # optional
                "id": Union[UpdatePromptID1, str],  # required
                "execute_on": Literal["input", "output"],  # required
            },
            "plugins": Union[PIIRedactionPluginAuto, PIIRedactionPluginEn, PIIRedactionPluginNl],
            "fallbacks": {  # optional
                "model": str,  # required
            },
            "retry": {  # optional
                "count": Optional[float],
                "on_codes": List[float],
            },
            "cache": {  # optional
                "ttl": Optional[float],
                "type": Literal["exact_match"],  # required
            },
            "load_balancer": Union[UpdatePromptLoadBalancer1],
            "timeout": {  # optional
                "call_timeout": float,  # required
            },
            "cache_control": {  # optional
                "type": Literal["ephemeral"],  # required
                "ttl": Optional[Literal["5m", "1h"]],
            },
            "prompt_cache_key": Optional[str],
        },
        "metadata": {  # optional
            "use_cases": List[Literal["Agents simulations", "Agents", "API interaction", "Autonomous Agents", "Chatbots", "Classification", "Code understanding", "Code writing", "Conversation", "Documents QA", "Evaluation", "Extraction", "Multi-modal", "Self-checking", "Sentiment analysis", "SQL", "Summarization", "Tagging", "Translation (document)", "Translation (sentences)"]],
            "language": OptionalNullable[UpdatePromptLanguage],
        },
        "path": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;  // required
      requestBody?: {
        owner?: string;
        domainId?: string;
        created?: string;
        updated?: string;
        createdById?: string;
        updatedById?: string;
        displayName?: string;
        description?: string;
        prompt?: {
          messages?: string;
          model?: string;
          name?: string;
          audio?: {
            voice: string;  // required
            format: string;  // required
          };
          frequencyPenalty?: number;
          maxTokens?: number;
          maxCompletionTokens?: number;
          logprobs?: boolean;
          topLogprobs?: number;
          n?: number;
          presencePenalty?: number;
          responseFormat?: string;
          reasoningEffort?: string;
          verbosity?: string;
          seed?: number;
          stop?: string | string[];
          streamOptions?: {
            includeUsage?: boolean;
          };
          thinking?: string;
          temperature?: number;
          topP?: number;
          topK?: number;
          toolChoice?: string;
          parallelToolCalls?: boolean;
          modalities?: string;
          guardrails?: {
            id: string;  // required
            executeOn: string;  // required
          };
          plugins?: string;
          fallbacks?: {
            model: string;  // required
          };
          retry?: {
            count?: number;
            onCodes?: number[];
          };
          cache?: {
            ttl?: number;
            type: string;  // required
          };
          loadBalancer?: string;
          timeout?: {
            callTimeout: number;  // required
          };
          cacheControl?: {
            type: string;  // required
            ttl?: string;
          };
          promptCacheKey?: string;
        };
        metadata?: {
          useCases?: string;
          language?: string;
        };
        path?: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "type": Literal["prompt"],
        "owner": str,
        "domain_id": str,
        "created": str,
        "updated": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "display_name": str,
        "description": OptionalNullable[str],
        "~~`prompt_config`~~": {  # optional
            "stream": Optional[bool],
            "model": OptionalNullable[str],
            "model_db_id": OptionalNullable[str],
            "model_type": OptionalNullable[UpdatePromptModelType],
            "model_parameters": {  # optional
                "temperature": Optional[float],
                "max_tokens": Optional[float],
                "top_k": Optional[float],
                "top_p": Optional[float],
                "frequency_penalty": Optional[float],
                "presence_penalty": Optional[float],
                "num_images": Optional[float],
                "seed": Optional[float],
                "format_": Optional[Literal["url", "b64_json", "text", "json_object"]],
                "dimensions": Optional[str],
                "quality": Optional[str],
                "style": Optional[str],
                "response_format": Union[UpdatePromptResponseFormat1, UpdatePromptResponseFormat2, UpdatePromptResponseFormat3, UpdatePromptResponseFormat4, UpdatePromptResponseFormat5, UpdatePromptResponseFormat6],
                "cache_control": {  # optional
                    "type": Literal["ephemeral"],
                    "ttl": Optional[Literal["5m", "1h"]],
                },
                "photo_real_version": Optional[Literal["v1", "v2"]],
                "encoding_format": Optional[Literal["float", "base64"]],
                "reasoning_effort": Optional[Literal["none", "disable", "minimal", "low", "medium", "high"]],
                "budget_tokens": Optional[float],
                "verbosity": Optional[Literal["low", "medium", "high"]],
                "thinking_level": Optional[Literal["low", "medium", "high"]],
            },
            "provider": OptionalNullable[UpdatePromptProvider],
            "integration_id": OptionalNullable[str],
            "version": Optional[str],
            "messages": {
                "role": Literal["system", "developer", "assistant", "user", "exception", "tool", "prompt", "correction", "expected_output"],
                "content": Union[str, List[UpdatePromptContentPromptsResponse2]],
                "tool_calls": {  # optional
                    "id": Optional[str],
                    "index": Optional[float],
                    "type": Literal["function"],
                    "function": {
                        "name": str,
                        "arguments": str,
                    },
                },
                "tool_call_id": OptionalNullable[str],
            },
        },
        "prompt": {
            "name": Optional[str],
            "audio": {  # optional
                "voice": Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
                "format_": Literal["wav", "mp3", "flac", "opus", "pcm16"],
            },
            "frequency_penalty": OptionalNullable[float],
            "max_tokens": OptionalNullable[int],
            "max_completion_tokens": OptionalNullable[int],
            "logprobs": OptionalNullable[bool],
            "top_logprobs": OptionalNullable[int],
            "n": OptionalNullable[int],
            "presence_penalty": OptionalNullable[float],
            "response_format": Union[UpdatePromptResponseFormatPromptsText, UpdatePromptResponseFormatPromptsJSONObject, UpdatePromptResponseFormatPromptsResponse200JSONSchema],
            "reasoning_effort": Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]],
            "verbosity": Optional[str],
            "seed": OptionalNullable[float],
            "stop": Union[str, List[str]],
            "stream_options": {  # optional
                "include_usage": Optional[bool],
            },
            "thinking": Union[ThinkingConfigDisabledSchema, ThinkingConfigEnabledSchema, ThinkingConfigAdaptiveSchema],
            "temperature": OptionalNullable[float],
            "top_p": OptionalNullable[float],
            "top_k": OptionalNullable[float],
            "tool_choice": Union[UpdatePromptToolChoicePrompts1, UpdatePromptToolChoicePrompts2],
            "parallel_tool_calls": Optional[bool],
            "modalities": List[Literal["text", "audio"]],
            "guardrails": {  # optional
                "id": Union[UpdatePromptIDPrompts1, str],
                "execute_on": Literal["input", "output"],
            },
            "plugins": Union[PIIRedactionPluginAuto, PIIRedactionPluginEn, PIIRedactionPluginNl],
            "fallbacks": {  # optional
                "model": str,
            },
            "retry": {  # optional
                "count": Optional[float],
                "on_codes": List[float],
            },
            "cache": {  # optional
                "ttl": Optional[float],
                "type": Literal["exact_match"],
            },
            "load_balancer": Union[UpdatePromptLoadBalancerPrompts1],
            "timeout": {  # optional
                "call_timeout": float,
            },
            "cache_control": {  # optional
                "type": Literal["ephemeral"],
                "ttl": Optional[Literal["5m", "1h"]],
            },
            "prompt_cache_key": Optional[str],
            "messages": Union[UpdatePromptMessagesPromptsSystemMessage, UpdatePromptMessagesPromptsUserMessage, UpdatePromptMessagesPromptsAssistantMessage, UpdatePromptMessagesPromptsToolMessage],
            "model": OptionalNullable[str],
            "version": Optional[str],
        },
        "metadata": {  # optional
            "use_cases": List[Literal["Agents simulations", "Agents", "API interaction", "Autonomous Agents", "Chatbots", "Classification", "Code understanding", "Code writing", "Conversation", "Documents QA", "Evaluation", "Extraction", "Multi-modal", "Self-checking", "Sentiment analysis", "SQL", "Summarization", "Tagging", "Translation (document)", "Translation (sentences)"]],
            "language": OptionalNullable[UpdatePromptPromptsLanguage],
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      type: string;
      owner: string;
      domainId: string;
      created: string;
      updated: string;
      createdById?: string;
      updatedById?: string;
      displayName: string;
      description?: string;
      ~~`promptConfig`~~?: {
        stream?: boolean;
        model?: string;
        modelDbId?: string;
        modelType?: string;
        modelParameters?: {
          temperature?: number;
          maxTokens?: number;
          topK?: number;
          topP?: number;
          frequencyPenalty?: number;
          presencePenalty?: number;
          numImages?: number;
          seed?: number;
          format?: string;
          dimensions?: string;
          quality?: string;
          style?: string;
          responseFormat?: string;
          cacheControl?: {
            type: string;
            ttl?: string;
          };
          photoRealVersion?: string;
          encodingFormat?: string;
          reasoningEffort?: string;
          budgetTokens?: number;
          verbosity?: string;
          thinkingLevel?: string;
        };
        provider?: string;
        integrationId?: string;
        version?: string;
        messages: {
          role: string;
          content: string;
          toolCalls?: {
            id?: string;
            index?: number;
            type: string;
            function: {
              name: string;
              arguments: string;
            };
          };
          toolCallId?: string;
        };
      };
      prompt: {
        name?: string;
        audio?: {
          voice: string;
          format: string;
        };
        frequencyPenalty?: number;
        maxTokens?: number;
        maxCompletionTokens?: number;
        logprobs?: boolean;
        topLogprobs?: number;
        n?: number;
        presencePenalty?: number;
        responseFormat?: string;
        reasoningEffort?: string;
        verbosity?: string;
        seed?: number;
        stop?: string | string[];
        streamOptions?: {
          includeUsage?: boolean;
        };
        thinking?: string;
        temperature?: number;
        topP?: number;
        topK?: number;
        toolChoice?: string;
        parallelToolCalls?: boolean;
        modalities?: string;
        guardrails?: {
          id: string;
          executeOn: string;
        };
        plugins?: string;
        fallbacks?: {
          model: string;
        };
        retry?: {
          count?: number;
          onCodes?: number[];
        };
        cache?: {
          ttl?: number;
          type: string;
        };
        loadBalancer?: string;
        timeout?: {
          callTimeout: number;
        };
        cacheControl?: {
          type: string;
          ttl?: string;
        };
        promptCacheKey?: string;
        messages?: string;
        model?: string;
        version?: string;
      };
      metadata?: {
        useCases?: string;
        language?: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Delete a Prompt

Delete a prompt

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      orq.prompts.delete(id="<id>")

      # Use the SDK ...

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    await orq.prompts.delete({
      id: "<id>",
    });

  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

### List Versions

Returns a list of your prompt versions. The prompt versions are returned sorted by creation date, with the most recent prompt versions appearing first

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.prompts.list_versions(prompt_id="<id>", limit=10)

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.prompts.listVersions({
      promptId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "prompt_id": str,  # required
        "limit": Optional[int],
        "starting_after": Optional[str],
        "ending_before": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      promptId: string;  // required
      limit?: number;
      startingAfter?: string;
      endingBefore?: string;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "object": Literal["list"],
        "data": {
            "id": str,
            "created_by_id": OptionalNullable[str],
            "updated_by_id": OptionalNullable[str],
            "description": OptionalNullable[str],
            "~~`prompt_config`~~": {  # optional
                "stream": Optional[bool],
                "model": OptionalNullable[str],
                "model_db_id": OptionalNullable[str],
                "model_type": OptionalNullable[ListPromptVersionsModelType],
                "model_parameters": {  # optional
                    "temperature": Optional[float],
                    "max_tokens": Optional[float],
                    "top_k": Optional[float],
                    "top_p": Optional[float],
                    "frequency_penalty": Optional[float],
                    "presence_penalty": Optional[float],
                    "num_images": Optional[float],
                    "seed": Optional[float],
                    "format_": Optional[Literal["url", "b64_json", "text", "json_object"]],
                    "dimensions": Optional[str],
                    "quality": Optional[str],
                    "style": Optional[str],
                    "response_format": Union[ListPromptVersionsResponseFormat1, ListPromptVersionsResponseFormat2, ListPromptVersionsResponseFormat3, ListPromptVersionsResponseFormat4, ListPromptVersionsResponseFormat5, ListPromptVersionsResponseFormat6],
                    "cache_control": {  # optional
                        "type": Literal["ephemeral"],
                        "ttl": Optional[Literal["5m", "1h"]],
                    },
                    "photo_real_version": Optional[Literal["v1", "v2"]],
                    "encoding_format": Optional[Literal["float", "base64"]],
                    "reasoning_effort": Optional[Literal["none", "disable", "minimal", "low", "medium", "high"]],
                    "budget_tokens": Optional[float],
                    "verbosity": Optional[Literal["low", "medium", "high"]],
                    "thinking_level": Optional[Literal["low", "medium", "high"]],
                },
                "provider": OptionalNullable[ListPromptVersionsProvider],
                "integration_id": OptionalNullable[str],
                "version": Optional[str],
                "messages": {
                    "role": Literal["system", "developer", "assistant", "user", "exception", "tool", "prompt", "correction", "expected_output"],
                    "content": Union[str, List[ListPromptVersionsContent2]],
                    "tool_calls": {  # optional
                        "id": Optional[str],
                        "index": Optional[float],
                        "type": Literal["function"],
                        "function": {
                            "name": str,
                            "arguments": str,
                        },
                    },
                    "tool_call_id": OptionalNullable[str],
                },
            },
            "prompt": {
                "name": Optional[str],
                "audio": {  # optional
                    "voice": Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
                    "format_": Literal["wav", "mp3", "flac", "opus", "pcm16"],
                },
                "frequency_penalty": OptionalNullable[float],
                "max_tokens": OptionalNullable[int],
                "max_completion_tokens": OptionalNullable[int],
                "logprobs": OptionalNullable[bool],
                "top_logprobs": OptionalNullable[int],
                "n": OptionalNullable[int],
                "presence_penalty": OptionalNullable[float],
                "response_format": Union[ListPromptVersionsResponseFormatText, ListPromptVersionsResponseFormatJSONObject, ListPromptVersionsResponseFormatPromptsJSONSchema],
                "reasoning_effort": Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]],
                "verbosity": Optional[str],
                "seed": OptionalNullable[float],
                "stop": Union[str, List[str]],
                "stream_options": {  # optional
                    "include_usage": Optional[bool],
                },
                "thinking": Union[ThinkingConfigDisabledSchema, ThinkingConfigEnabledSchema, ThinkingConfigAdaptiveSchema],
                "temperature": OptionalNullable[float],
                "top_p": OptionalNullable[float],
                "top_k": OptionalNullable[float],
                "tool_choice": Union[ListPromptVersionsToolChoice1, ListPromptVersionsToolChoice2],
                "parallel_tool_calls": Optional[bool],
                "modalities": List[Literal["text", "audio"]],
                "guardrails": {  # optional
                    "id": Union[ListPromptVersionsID1, str],
                    "execute_on": Literal["input", "output"],
                },
                "plugins": Union[PIIRedactionPluginAuto, PIIRedactionPluginEn, PIIRedactionPluginNl],
                "fallbacks": {  # optional
                    "model": str,
                },
                "retry": {  # optional
                    "count": Optional[float],
                    "on_codes": List[float],
                },
                "cache": {  # optional
                    "ttl": Optional[float],
                    "type": Literal["exact_match"],
                },
                "load_balancer": Union[ListPromptVersionsLoadBalancer1],
                "timeout": {  # optional
                    "call_timeout": float,
                },
                "cache_control": {  # optional
                    "type": Literal["ephemeral"],
                    "ttl": Optional[Literal["5m", "1h"]],
                },
                "prompt_cache_key": Optional[str],
                "messages": Union[ListPromptVersionsMessagesSystemMessage, ListPromptVersionsMessagesUserMessage, ListPromptVersionsMessagesAssistantMessage, ListPromptVersionsMessagesToolMessage],
                "model": OptionalNullable[str],
                "version": Optional[str],
            },
            "metadata": {  # optional
                "use_cases": List[Literal["Agents simulations", "Agents", "API interaction", "Autonomous Agents", "Chatbots", "Classification", "Code understanding", "Code writing", "Conversation", "Documents QA", "Evaluation", "Extraction", "Multi-modal", "Self-checking", "Sentiment analysis", "SQL", "Summarization", "Tagging", "Translation (document)", "Translation (sentences)"]],
                "language": OptionalNullable[ListPromptVersionsLanguage],
            },
            "timestamp": str,
        },
        "has_more": bool,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      object: string;
      data: {
        id: string;
        createdById?: string;
        updatedById?: string;
        description?: string;
        ~~`promptConfig`~~?: {
          stream?: boolean;
          model?: string;
          modelDbId?: string;
          modelType?: string;
          modelParameters?: {
            temperature?: number;
            maxTokens?: number;
            topK?: number;
            topP?: number;
            frequencyPenalty?: number;
            presencePenalty?: number;
            numImages?: number;
            seed?: number;
            format?: string;
            dimensions?: string;
            quality?: string;
            style?: string;
            responseFormat?: string;
            cacheControl?: {
              type: string;
              ttl?: string;
            };
            photoRealVersion?: string;
            encodingFormat?: string;
            reasoningEffort?: string;
            budgetTokens?: number;
            verbosity?: string;
            thinkingLevel?: string;
          };
          provider?: string;
          integrationId?: string;
          version?: string;
          messages: {
            role: string;
            content: string;
            toolCalls?: {
              id?: string;
              index?: number;
              type: string;
              function: {
                name: string;
                arguments: string;
              };
            };
            toolCallId?: string;
          };
        };
        prompt: {
          name?: string;
          audio?: {
            voice: string;
            format: string;
          };
          frequencyPenalty?: number;
          maxTokens?: number;
          maxCompletionTokens?: number;
          logprobs?: boolean;
          topLogprobs?: number;
          n?: number;
          presencePenalty?: number;
          responseFormat?: string;
          reasoningEffort?: string;
          verbosity?: string;
          seed?: number;
          stop?: string | string[];
          streamOptions?: {
            includeUsage?: boolean;
          };
          thinking?: string;
          temperature?: number;
          topP?: number;
          topK?: number;
          toolChoice?: string;
          parallelToolCalls?: boolean;
          modalities?: string;
          guardrails?: {
            id: string;
            executeOn: string;
          };
          plugins?: string;
          fallbacks?: {
            model: string;
          };
          retry?: {
            count?: number;
            onCodes?: number[];
          };
          cache?: {
            ttl?: number;
            type: string;
          };
          loadBalancer?: string;
          timeout?: {
            callTimeout: number;
          };
          cacheControl?: {
            type: string;
            ttl?: string;
          };
          promptCacheKey?: string;
          messages?: string;
          model?: string;
          version?: string;
        };
        metadata?: {
          useCases?: string;
          language?: string;
        };
        timestamp: string;
      };
      hasMore: boolean;
    }
    ```
  </CodeGroup>
</Expandable>

### Get Version

Retrieves a specific version of a prompt by its ID and version ID.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.prompts.get_version(prompt_id="<id>", version_id="<id>")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.prompts.getVersion({
      promptId: "<id>",
      versionId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "prompt_id": str,  # required
        "version_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      promptId: string;  // required
      versionId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "id": str,
        "created_by_id": OptionalNullable[str],
        "updated_by_id": OptionalNullable[str],
        "description": OptionalNullable[str],
        "~~`prompt_config`~~": {  # optional
            "stream": Optional[bool],
            "model": OptionalNullable[str],
            "model_db_id": OptionalNullable[str],
            "model_type": OptionalNullable[GetPromptVersionModelType],
            "model_parameters": {  # optional
                "temperature": Optional[float],
                "max_tokens": Optional[float],
                "top_k": Optional[float],
                "top_p": Optional[float],
                "frequency_penalty": Optional[float],
                "presence_penalty": Optional[float],
                "num_images": Optional[float],
                "seed": Optional[float],
                "format_": Optional[Literal["url", "b64_json", "text", "json_object"]],
                "dimensions": Optional[str],
                "quality": Optional[str],
                "style": Optional[str],
                "response_format": Union[GetPromptVersionResponseFormat1, GetPromptVersionResponseFormat2, GetPromptVersionResponseFormat3, GetPromptVersionResponseFormat4, GetPromptVersionResponseFormat5, GetPromptVersionResponseFormat6],
                "cache_control": {  # optional
                    "type": Literal["ephemeral"],
                    "ttl": Optional[Literal["5m", "1h"]],
                },
                "photo_real_version": Optional[Literal["v1", "v2"]],
                "encoding_format": Optional[Literal["float", "base64"]],
                "reasoning_effort": Optional[Literal["none", "disable", "minimal", "low", "medium", "high"]],
                "budget_tokens": Optional[float],
                "verbosity": Optional[Literal["low", "medium", "high"]],
                "thinking_level": Optional[Literal["low", "medium", "high"]],
            },
            "provider": OptionalNullable[GetPromptVersionProvider],
            "integration_id": OptionalNullable[str],
            "version": Optional[str],
            "messages": {
                "role": Literal["system", "developer", "assistant", "user", "exception", "tool", "prompt", "correction", "expected_output"],
                "content": Union[str, List[GetPromptVersionContent2]],
                "tool_calls": {  # optional
                    "id": Optional[str],
                    "index": Optional[float],
                    "type": Literal["function"],
                    "function": {
                        "name": str,
                        "arguments": str,
                    },
                },
                "tool_call_id": OptionalNullable[str],
            },
        },
        "prompt": {
            "name": Optional[str],
            "audio": {  # optional
                "voice": Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"],
                "format_": Literal["wav", "mp3", "flac", "opus", "pcm16"],
            },
            "frequency_penalty": OptionalNullable[float],
            "max_tokens": OptionalNullable[int],
            "max_completion_tokens": OptionalNullable[int],
            "logprobs": OptionalNullable[bool],
            "top_logprobs": OptionalNullable[int],
            "n": OptionalNullable[int],
            "presence_penalty": OptionalNullable[float],
            "response_format": Union[GetPromptVersionResponseFormatText, GetPromptVersionResponseFormatJSONObject, GetPromptVersionResponseFormatPromptsJSONSchema],
            "reasoning_effort": Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]],
            "verbosity": Optional[str],
            "seed": OptionalNullable[float],
            "stop": Union[str, List[str]],
            "stream_options": {  # optional
                "include_usage": Optional[bool],
            },
            "thinking": Union[ThinkingConfigDisabledSchema, ThinkingConfigEnabledSchema, ThinkingConfigAdaptiveSchema],
            "temperature": OptionalNullable[float],
            "top_p": OptionalNullable[float],
            "top_k": OptionalNullable[float],
            "tool_choice": Union[GetPromptVersionToolChoice1, GetPromptVersionToolChoice2],
            "parallel_tool_calls": Optional[bool],
            "modalities": List[Literal["text", "audio"]],
            "guardrails": {  # optional
                "id": Union[GetPromptVersionID1, str],
                "execute_on": Literal["input", "output"],
            },
            "plugins": Union[PIIRedactionPluginAuto, PIIRedactionPluginEn, PIIRedactionPluginNl],
            "fallbacks": {  # optional
                "model": str,
            },
            "retry": {  # optional
                "count": Optional[float],
                "on_codes": List[float],
            },
            "cache": {  # optional
                "ttl": Optional[float],
                "type": Literal["exact_match"],
            },
            "load_balancer": Union[GetPromptVersionLoadBalancer1],
            "timeout": {  # optional
                "call_timeout": float,
            },
            "cache_control": {  # optional
                "type": Literal["ephemeral"],
                "ttl": Optional[Literal["5m", "1h"]],
            },
            "prompt_cache_key": Optional[str],
            "messages": Union[GetPromptVersionMessagesSystemMessage, GetPromptVersionMessagesUserMessage, GetPromptVersionMessagesAssistantMessage, GetPromptVersionMessagesToolMessage],
            "model": OptionalNullable[str],
            "version": Optional[str],
        },
        "metadata": {  # optional
            "use_cases": List[Literal["Agents simulations", "Agents", "API interaction", "Autonomous Agents", "Chatbots", "Classification", "Code understanding", "Code writing", "Conversation", "Documents QA", "Evaluation", "Extraction", "Multi-modal", "Self-checking", "Sentiment analysis", "SQL", "Summarization", "Tagging", "Translation (document)", "Translation (sentences)"]],
            "language": OptionalNullable[GetPromptVersionLanguage],
        },
        "timestamp": str,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      id: string;
      createdById?: string;
      updatedById?: string;
      description?: string;
      ~~`promptConfig`~~?: {
        stream?: boolean;
        model?: string;
        modelDbId?: string;
        modelType?: string;
        modelParameters?: {
          temperature?: number;
          maxTokens?: number;
          topK?: number;
          topP?: number;
          frequencyPenalty?: number;
          presencePenalty?: number;
          numImages?: number;
          seed?: number;
          format?: string;
          dimensions?: string;
          quality?: string;
          style?: string;
          responseFormat?: string;
          cacheControl?: {
            type: string;
            ttl?: string;
          };
          photoRealVersion?: string;
          encodingFormat?: string;
          reasoningEffort?: string;
          budgetTokens?: number;
          verbosity?: string;
          thinkingLevel?: string;
        };
        provider?: string;
        integrationId?: string;
        version?: string;
        messages: {
          role: string;
          content: string;
          toolCalls?: {
            id?: string;
            index?: number;
            type: string;
            function: {
              name: string;
              arguments: string;
            };
          };
          toolCallId?: string;
        };
      };
      prompt: {
        name?: string;
        audio?: {
          voice: string;
          format: string;
        };
        frequencyPenalty?: number;
        maxTokens?: number;
        maxCompletionTokens?: number;
        logprobs?: boolean;
        topLogprobs?: number;
        n?: number;
        presencePenalty?: number;
        responseFormat?: string;
        reasoningEffort?: string;
        verbosity?: string;
        seed?: number;
        stop?: string | string[];
        streamOptions?: {
          includeUsage?: boolean;
        };
        thinking?: string;
        temperature?: number;
        topP?: number;
        topK?: number;
        toolChoice?: string;
        parallelToolCalls?: boolean;
        modalities?: string;
        guardrails?: {
          id: string;
          executeOn: string;
        };
        plugins?: string;
        fallbacks?: {
          model: string;
        };
        retry?: {
          count?: number;
          onCodes?: number[];
        };
        cache?: {
          ttl?: number;
          type: string;
        };
        loadBalancer?: string;
        timeout?: {
          callTimeout: number;
        };
        cacheControl?: {
          type: string;
          ttl?: string;
        };
        promptCacheKey?: string;
        messages?: string;
        model?: string;
        version?: string;
      };
      metadata?: {
        useCases?: string;
        language?: string;
      };
      timestamp: string;
    }
    ```
  </CodeGroup>
</Expandable>
