> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo-platform/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo-platform/_mcp/server.

# Update Prompt

PUT https://host.com/apis/models/v2/workspaces/{workspace}/prompts/{name}
Content-Type: application/json

Update an existing prompt (full replacement of mutable fields).

Reference: https://docs.nvidia.com/nemo-platform/nemo-platform/documentation/reference/api-reference/prompts/update-prompt-apis-models-v-2-workspaces-workspace-prompts-name-put

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Nemo Platform API
  version: 1.0.0
paths:
  /apis/models/v2/workspaces/{workspace}/prompts/{name}:
    put:
      operationId: update-prompt-apis-models-v-2-workspaces-workspace-prompts-name-put
      summary: Update Prompt
      description: Update an existing prompt (full replacement of mutable fields).
      tags:
        - subpackage_prompts
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
        - name: name
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Update an existing prompt
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePromptRequest'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    PromptMessageRole:
      type: string
      enum:
        - system
        - developer
        - user
        - assistant
      description: |-
        Role of a message author in a chat prompt.

        Follows the OpenAI chat schema the Inference Gateway speaks
        (``/v1/chat/completions``).
      title: PromptMessageRole
    PromptMessage:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/PromptMessageRole'
          description: The role of the message author.
        content:
          type: string
          description: Templated message content. May contain template variables.
      required:
        - role
        - content
      description: |-
        A single templated message in a chat prompt.

        ``content`` is a Jinja2 template body that may reference the prompt's
        declared ``input_variables`` (e.g. ``{{ topic }}``).
      title: PromptMessage
    FunctionDefinition:
      type: object
      properties:
        name:
          type: string
          description: The name of the function to be called.
        description:
          type: string
          description: >-
            A description of what the function does, used by the model to decide
            when and how to call it.
        parameters:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            The parameters the function accepts, described as a JSON Schema
            object.
        strict:
          type: boolean
          description: >-
            Whether to enforce strict schema adherence when generating the
            function call.
      required:
        - name
      description: |-
        An OpenAI-compatible function definition for tool calling.

        Mirrors the ``function`` object the Inference Gateway forwards to
        OpenAI-compatible backends.
      title: FunctionDefinition
    ChatCompletionTool:
      type: object
      properties:
        type:
          type: string
          enum:
            - function
          description: The type of the tool. Currently only 'function' is supported.
        function:
          $ref: '#/components/schemas/FunctionDefinition'
          description: The function definition for this tool.
      required:
        - type
        - function
      description: An OpenAI-compatible tool definition (currently always a function tool).
      title: ChatCompletionTool
    UpdatePromptRequestToolChoice:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      title: UpdatePromptRequestToolChoice
    InferenceParams:
      type: object
      properties:
        model:
          type: string
          description: Model identifier
        temperature:
          type: number
          format: double
          description: >-
            Float value between 0 and 1. temp of 0 indicates greedy decoding,
            where the token with highest prob is chosen. Temperature can't be
            set to 0.0 currently
        max_tokens:
          type: integer
          description: Max tokens to generate
        max_completion_tokens:
          type: integer
          description: Max tokens to generate
        top_p:
          type: number
          format: double
          description: >-
            Float value between 0 and 1; limits to the top tokens within a
            certain probability. top_p=0 means the model will only consider the
            single most likely token for the next prediction
        stop:
          type: array
          items:
            type: string
      description: >-
        Parameters for model inference. Extra fields can be supplied for
        additional options applied to the inference request directly. Fields not
        supported by the model may cause inference errors during evaluation.
      title: InferenceParams
    UpdatePromptRequest:
      type: object
      properties:
        project:
          type: string
          description: The URN of the project associated with this prompt.
        description:
          type: string
        messages:
          type: array
          items:
            $ref: '#/components/schemas/PromptMessage'
        input_variables:
          type: array
          items:
            type: string
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionTool'
        tool_choice:
          $ref: '#/components/schemas/UpdatePromptRequestToolChoice'
        response_format:
          type: object
          additionalProperties:
            description: Any type
        inference_params:
          $ref: '#/components/schemas/InferenceParams'
        tags:
          type: array
          items:
            type: string
      description: >-
        Request model for replacing a Prompt's mutable fields (full update).


        The prompt name and workspace come from the URL path and cannot be
        changed.
      title: UpdatePromptRequest
    PromptToolChoice:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: >-
        Controls which (if any) tool is called: 'none', 'auto', 'required', or a
        named-tool object.
      title: PromptToolChoice
    Prompt:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the prompt.
        name:
          type: string
          description: >-
            Name of the entity. Name/workspace combo must be unique across all
            entities. Allowed characters: letters (a-z, A-Z), digits (0-9),
            underscores, hyphens, and dots.
        workspace:
          type: string
          description: >-
            The workspace of the entity. Allowed characters: letters (a-z, A-Z),
            digits (0-9), underscores, hyphens, and dots.
        project:
          type: string
          description: The URN of the project associated with this entity.
        created_at:
          type: string
          format: date-time
          description: The timestamp of model entity creation
        updated_at:
          type: string
          format: date-time
          description: The timestamp of the last model entity update
        description:
          type: string
          description: Optional description of the prompt.
        messages:
          type: array
          items:
            $ref: '#/components/schemas/PromptMessage'
          description: Ordered list of chat messages that make up the prompt.
        input_variables:
          type: array
          items:
            type: string
          description: Names of the Jinja2 template variables the prompt expects.
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ChatCompletionTool'
          description: Optional OpenAI-compatible tool definitions to send with the prompt.
        tool_choice:
          $ref: '#/components/schemas/PromptToolChoice'
          description: >-
            Controls which (if any) tool is called: 'none', 'auto', 'required',
            or a named-tool object.
        response_format:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            Optional OpenAI-compatible response_format, e.g. a json_schema
            structured-output spec.
        inference_params:
          $ref: '#/components/schemas/InferenceParams'
          description: >-
            Optional default model and sampling parameters (temperature, top_p,
            max_tokens, ...).
        tags:
          type: array
          items:
            type: string
          description: Optional free-form tags for organizing prompts.
      required:
        - name
        - workspace
        - created_at
        - updated_at
      description: >-
        A reusable, stored chat prompt.


        A Prompt captures the messages, declared template variables, optional
        tool

        definitions, and default inference parameters needed to invoke a model

        through the Inference Gateway. The unique identifier is workspace/name.
      title: Prompt
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          type: object
          additionalProperties:
            description: Any type
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "name": "llama-3.1-8b",
  "workspace": "research-team-alpha",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-04-20T14:45:00Z",
  "id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
  "project": "nlp-models/llama",
  "description": "A prompt designed for the LLaMA 3.1 8B model to assist with natural language understanding tasks.",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant specialized in summarizing technical documents."
    }
  ],
  "input_variables": [
    "document_text"
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "summarize_text",
        "description": "Generates a concise summary of the provided text input.",
        "parameters": {},
        "strict": true
      }
    }
  ],
  "tool_choice": "auto",
  "response_format": {},
  "inference_params": {
    "model": "llama-3.1-8b",
    "temperature": 0.7,
    "max_tokens": 512,
    "max_completion_tokens": 256,
    "top_p": 0.9,
    "stop": [
      "\n\n"
    ]
  },
  "tags": [
    "llama",
    "summarization",
    "v3.1"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://host.com/apis/models/v2/workspaces/workspace/prompts/name"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://host.com/apis/models/v2/workspaces/workspace/prompts/name';
const options = {method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://host.com/apis/models/v2/workspaces/workspace/prompts/name"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://host.com/apis/models/v2/workspaces/workspace/prompts/name")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://host.com/apis/models/v2/workspaces/workspace/prompts/name")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://host.com/apis/models/v2/workspaces/workspace/prompts/name', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://host.com/apis/models/v2/workspaces/workspace/prompts/name");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/apis/models/v2/workspaces/workspace/prompts/name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```