---
title: "Create a prompt"
method: POST
path: "/genai/{connection_id}/prompt"
tags: ["genai", "prompt"]
---

# Create a prompt

`POST /genai/{connection_id}/prompt`

## Request

- Base URL: `http://api.unified.to`
- URL: `http://api.unified.to/genai/{connection_id}/prompt`
- Auth: API key in header `authorization`

## Path parameters

- `connection_id` string, required

## Query parameters

- `fields` string[]
- `raw` string

## Request body

- GenaiPrompt
  - `model_id` string
  - `messages` GenaiContent[]
    - `role` 'SYSTEM' | 'USER' | 'ASSISTANT'
    - `content` string, required
    - `images` string[]: Images for the model to evaluate with this message, as base64 data URLs (data:image/png;base64,...). Only for models with has_vision.
  - `temperature` number: 0-1
  - `max_tokens` number: a float between 0-1
  - `responses` string[]
  - `tokens_used` number
  - `mcp_url` string: Supply a remote MCP URL to send to the LLM API for it to call its tools. Note: Some LLM APIs do not yet support remote MCP URLs.
  - `mcp_deferred_tools` string[]
  - `mcp_authorization_token` string: OAuth Bearer token for MCP servers that require authentication.
  - `questions` GenaiQuestion[]: Typed questions to evaluate against the messages (for decision models such as TypeSafe Jev).
    - `id` string, required: A caller-chosen key; the matching answer is returned with the same id.
    - `type` 'BOOLEAN' | 'CHOICE' | 'SCORE', required
    - `instructions` string, required: The question to evaluate.
    - `options` string[]: CHOICE: the options to select from; SCORE: the ordered levels (lowest first).
  - `answers` GenaiAnswer[]: One answer per question, matched by id.
    - `id` string, required: The id of the genai_prompt question that this answers.
    - `type` 'BOOLEAN' | 'CHOICE' | 'SCORE', required
    - `value` string: CHOICE: the selected option.
    - `score` number: SCORE: the probability-weighted level index; BOOLEAN: the probability (0-1) that the answer is yes.
    - `probabilities` GenaiAnswerProbability[]: CHOICE/SCORE: the probability of every option or level.
      - `option` string, required: CHOICE: the option; SCORE: the level description.
      - `probability` number, required: 0-1
    - `confidence` number: 0-1: how certain the model is of the answer.
  - `skill_ids` string[]: ids of the genai_skill objects (Agent Skills) to make available to the LLM while it answers.
  - `raw` unknown

## Response `200`

Successful

- GenaiPrompt
  - `model_id` string
  - `messages` GenaiContent[]
    - `role` 'SYSTEM' | 'USER' | 'ASSISTANT'
    - `content` string, required
    - `images` string[]: Images for the model to evaluate with this message, as base64 data URLs (data:image/png;base64,...). Only for models with has_vision.
  - `temperature` number: 0-1
  - `max_tokens` number: a float between 0-1
  - `responses` string[]
  - `tokens_used` number
  - `mcp_url` string: Supply a remote MCP URL to send to the LLM API for it to call its tools. Note: Some LLM APIs do not yet support remote MCP URLs.
  - `mcp_deferred_tools` string[]
  - `mcp_authorization_token` string: OAuth Bearer token for MCP servers that require authentication.
  - `questions` GenaiQuestion[]: Typed questions to evaluate against the messages (for decision models such as TypeSafe Jev).
    - `id` string, required: A caller-chosen key; the matching answer is returned with the same id.
    - `type` 'BOOLEAN' | 'CHOICE' | 'SCORE', required
    - `instructions` string, required: The question to evaluate.
    - `options` string[]: CHOICE: the options to select from; SCORE: the ordered levels (lowest first).
  - `answers` GenaiAnswer[]: One answer per question, matched by id.
    - `id` string, required: The id of the genai_prompt question that this answers.
    - `type` 'BOOLEAN' | 'CHOICE' | 'SCORE', required
    - `value` string: CHOICE: the selected option.
    - `score` number: SCORE: the probability-weighted level index; BOOLEAN: the probability (0-1) that the answer is yes.
    - `probabilities` GenaiAnswerProbability[]: CHOICE/SCORE: the probability of every option or level.
      - `option` string, required: CHOICE: the option; SCORE: the level description.
      - `probability` number, required: 0-1
    - `confidence` number: 0-1: how certain the model is of the answer.
  - `skill_ids` string[]: ids of the genai_skill objects (Agent Skills) to make available to the LLM while it answers.
  - `raw` unknown

---

[API](https://skmtc.dev/unified/apis/unified-to-api-2.md) · [All operations](https://skmtc.dev/unified/apis/unified-to-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/unified/apis/unified-to-api-2/revisions/7a38bdd7f089?raw)
