Skip to content
API referenceRender a prompt

Render a prompt

POST/v1/prompts/{slug}/render

Render a prompt.

Fills a version's {{name}} placeholders with the given variables and returns the messages, without calling a model. A placeholder with no value is left as written. Requires membership of the prompt's workspace (organization admins have it).

Errors: 400 for an invalid version_ref; 404 when the prompt, version or label does not exist, or the prompt has no default version and none is named.

Authorization

  • AuthorizationBearer va_

    A platform API key (va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.

Path parameters

  • slugstringrequired

    the prompt's slug

Query parameters

  • organizationstringrequired

    slug of the organization that owns it

Request body application/json

the variables, and which version to render

  • variablesmap<string, string>required

    Values for the template's {{name}} placeholders, as a JSON object of strings. A placeholder with no value is left as written.

  • version_refstring

    Which version to use: a version number (for example 3), latest (the highest version number, whatever its status) or @ followed by a label (for example @staging). Omit it for the default version: the one the production label points at, else the PUBLISHED version. An unknown version or label is a 404, any other value a 400.

Responses

200application/json
  • version_numberinteger<int32>

    The version that was rendered.

  • messagesobject[]

    The rendered messages, in order.

    Child attributes
    • roleenum<string>required

      Who the message is from: system, user, assistant or tool (required).

      One of "system", "user", "assistant", "tool"

    • contentstringrequired

      The message text (required). Each {{name}} placeholder is replaced with the value of variable name when the prompt is rendered or run; a placeholder with no value is left as written.

NVIDIA Inception Program member

VectorAxis is built by GK Labs, a member of NVIDIA Inception.