> This page is for version 0.5.0.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo-helix/latest/llms.txt
> - 0.8.0: https://docs.nvidia.com/nemo-helix/v0.8.0/llms.txt
> - 0.7.1: https://docs.nvidia.com/nemo-helix/v0.7.1/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo-helix/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo-helix/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo-helix/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo-helix/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo-helix/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo-helix/v0.3.0/llms.txt
> - 0.2.0: https://docs.nvidia.com/nemo-helix/v0.2.0/llms.txt

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

# Create Prompt

POST /apis/models/v2/workspaces/{workspace}/prompts
Content-Type: application/json

Create a new prompt.

Reference: https://docs.nvidia.com/nemo-helix/documentation/reference/api-reference/prompts/create-prompt-apis-models-v-2-workspaces-workspace-prompts-post

## Request

### Path parameters

- `workspace` (string, required)

### Body (application/json)

This endpoint expects a CreatePromptRequest.

- `name` (string, required) — Name of the prompt. Name must start with a lowercase letter, be 2-63 characters, and use lowercase letters, digits, hyphens, and dots (no consecutive hyphens, cannot end with a hyphen).
- `project` (string, optional) — The URN of the project associated with this prompt.
- `description` (string, optional)
- `messages` (list of PromptMessage, optional)
- `input_variables` (list of string, optional)
- `tools` (list of ChatCompletionTool, optional)
- `tool_choice` (CreatePromptRequestToolChoice, optional)
- `response_format` (map from string to any, optional)
- `inference_params` (InferenceParams, optional) — 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.
- `tags` (list of string, optional)

## Response

### 201

Create a new prompt

- `name` (string, required) — Name of the entity. Name/workspace combo must be unique across all entities. Name must start with a lowercase letter, be 2-63 characters, and use lowercase letters, digits, hyphens, and dots (no consecutive hyphens, cannot end with a hyphen).
- `workspace` (string, required) — The workspace of the entity. Allowed characters: letters (a-z, A-Z), digits (0-9), underscores, hyphens, and dots.
- `created_at` (datetime, required) — The timestamp of model entity creation
- `updated_at` (datetime, required) — The timestamp of the last model entity update
- `id` (string, optional) — Unique identifier for the prompt.
- `project` (string, optional) — The URN of the project associated with this entity.
- `description` (string, optional) — Optional description of the prompt.
- `messages` (list of PromptMessage, optional) — Ordered list of chat messages that make up the prompt.
- `input_variables` (list of string, optional) — Names of the Jinja2 template variables the prompt expects.
- `tools` (list of ChatCompletionTool, optional) — Optional OpenAI-compatible tool definitions to send with the prompt.
- `tool_choice` (PromptToolChoice, optional) — Controls which (if any) tool is called: 'none', 'auto', 'required', or a named-tool object.
- `response_format` (map from string to any, optional) — Optional OpenAI-compatible response_format, e.g. a json_schema structured-output spec.
- `inference_params` (InferenceParams, optional) — Optional default model and sampling parameters (temperature, top_p, max_tokens, ...).
- `tags` (list of string, optional) — Optional free-form tags for organizing prompts.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### PromptMessage

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 }}`).

- `role` (enum, required) — The role of the message author.
  - Allowed values: `system`, `developer`, `user`, `assistant`
- `content` (string, required) — Templated message content. May contain template variables.

### ChatCompletionTool

An OpenAI-compatible tool definition (currently always a function tool).

- `type` ("function", required) — The type of the tool. Currently only 'function' is supported.
- `function` (FunctionDefinition, required) — The function definition for this tool.

### CreatePromptRequestToolChoice

### InferenceParams

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.

- `model` (string, optional) — Model identifier
- `temperature` (double, optional) — 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` (integer, optional) — Max tokens to generate
- `max_completion_tokens` (integer, optional) — Max tokens to generate
- `top_p` (double, optional) — 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` (list of string, optional)

### PromptToolChoice

Controls which (if any) tool is called: 'none', 'auto', 'required', or a named-tool object.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (map from string to any, optional)

### FunctionDefinition

An OpenAI-compatible function definition for tool calling. Mirrors the ``function`` object the Inference Gateway forwards to OpenAI-compatible backends.

- `name` (string, required) — The name of the function to be called.
- `description` (string, optional) — A description of what the function does, used by the model to decide when and how to call it.
- `parameters` (map from string to any, optional) — The parameters the function accepts, described as a JSON Schema object.
- `strict` (boolean, optional) — Whether to enforce strict schema adherence when generating the function call.

### ValidationErrorLocItems

## Examples

**Request**

```json
{
  "name": "support-bot-system"
}
```

**Response**

```json
{
  "name": "llama-3.1-8b",
  "workspace": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "id": "string",
  "project": "string",
  "description": "string",
  "messages": [
    {
      "role": "system",
      "content": "string"
    }
  ],
  "input_variables": [
    "string"
  ],
  "tools": [
    {
      "type": "string",
      "function": {
        "name": "string",
        "description": "string",
        "parameters": {},
        "strict": true
      }
    }
  ],
  "tool_choice": {},
  "response_format": {},
  "inference_params": {
    "model": "string",
    "temperature": 1.1,
    "max_tokens": 1,
    "max_completion_tokens": 1,
    "top_p": 0.5,
    "stop": [
      "string"
    ]
  },
  "tags": [
    "string"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/apis/models/v2/workspaces/workspace/prompts"

payload = { "name": "support-bot-system" }
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.example.com/apis/models/v2/workspaces/workspace/prompts';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"name":"support-bot-system"}'
};

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://api.example.com/apis/models/v2/workspaces/workspace/prompts"

	payload := strings.NewReader("{\n  \"name\": \"support-bot-system\"\n}")

	req, _ := http.NewRequest("POST", 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://api.example.com/apis/models/v2/workspaces/workspace/prompts")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"support-bot-system\"\n}"

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.post("https://api.example.com/apis/models/v2/workspaces/workspace/prompts")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"support-bot-system\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/apis/models/v2/workspaces/workspace/prompts', [
  'body' => '{
  "name": "support-bot-system"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/apis/models/v2/workspaces/workspace/prompts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```