Skip to main content
POST
/
v2
/
agents
/
prompt
/
validate
Validate Prompt
curl --request POST \
  --url https://api.velt.dev/v2/agents/prompt/validate \
  --header 'Content-Type: application/json' \
  --header 'x-velt-api-key: <x-velt-api-key>' \
  --header 'x-velt-auth-token: <x-velt-auth-token>' \
  --data '
{
  "data": {
    "prompt": "<string>",
    "provider": "<string>",
    "userContextFields": [
      {}
    ]
  }
}
'
import requests

url = "https://api.velt.dev/v2/agents/prompt/validate"

payload = { "data": {
"prompt": "<string>",
"provider": "<string>",
"userContextFields": [{}]
} }
headers = {
"x-velt-api-key": "<x-velt-api-key>",
"x-velt-auth-token": "<x-velt-auth-token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {
'x-velt-api-key': '<x-velt-api-key>',
'x-velt-auth-token': '<x-velt-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({data: {prompt: '<string>', provider: '<string>', userContextFields: [{}]}})
};

fetch('https://api.velt.dev/v2/agents/prompt/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.velt.dev/v2/agents/prompt/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'prompt' => '<string>',
'provider' => '<string>',
'userContextFields' => [
[

]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-api-key: <x-velt-api-key>",
"x-velt-auth-token: <x-velt-auth-token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api.velt.dev/v2/agents/prompt/validate"

payload := strings.NewReader("{\n \"data\": {\n \"prompt\": \"<string>\",\n \"provider\": \"<string>\",\n \"userContextFields\": [\n {}\n ]\n }\n}")

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

req.Header.Add("x-velt-api-key", "<x-velt-api-key>")
req.Header.Add("x-velt-auth-token", "<x-velt-auth-token>")
req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.velt.dev/v2/agents/prompt/validate")
.header("x-velt-api-key", "<x-velt-api-key>")
.header("x-velt-auth-token", "<x-velt-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"prompt\": \"<string>\",\n \"provider\": \"<string>\",\n \"userContextFields\": [\n {}\n ]\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.velt.dev/v2/agents/prompt/validate")

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

request = Net::HTTP::Post.new(url)
request["x-velt-api-key"] = '<x-velt-api-key>'
request["x-velt-auth-token"] = '<x-velt-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"prompt\": \"<string>\",\n \"provider\": \"<string>\",\n \"userContextFields\": [\n {}\n ]\n }\n}"

response = http.request(request)
puts response.read_body
{
  "result": {
    "status": "success",
    "message": "Prompt validated successfully",
    "data": {
      "validationResult": {
        "analysis_prompt": "## Objective\n...\n\n## Scope\n...",
        "requires_tool": "NONE",
        "response_descriptions": {},
        "demos": { "detection_dimensions": [], "cases": [] },
        "suggested_required_inputs": []
      }
    }
  }
}
Use this API to expand a simple instruction into a structured QA task. The response includes:
  • An analysis prompt (markdown-formatted) with objective, scope, detection logic, and output format
  • Per-field response descriptions for AI response shaping
  • Demo test cases organized by detection dimension
  • Tool requirements
  • Suggested required runtime inputs
This is the transformation step that turns a one-line instruction into a comprehensive QA task definition you can persist as an agent.

Endpoint

POST https://api.velt.dev/v2/agents/prompt/validate

Headers

x-velt-api-key
string
required
Your API key.
x-velt-auth-token
string
required

Body

Params

data
object
required

Example Requests

{
  "data": {
    "prompt": "Make sure there are no broken links on the page"
  }
}

2. Expand an accessibility instruction

{
  "data": {
    "prompt": "Check all images have alt text and all form inputs have labels"
  }
}

Response

Success Response

{
  "result": {
    "status": "success",
    "message": "Prompt validated successfully",
    "data": {
      "validationResult": {
        "analysis_prompt": "## Objective\nIdentify all broken or non-functional hyperlinks on the page\n\n## Scope\nAll anchor elements (<a href>) and embedded resource URLs\n\n## Detection Logic\nHTTP HEAD/GET validation of link targets, checking for non-2xx status codes\n\n## Output Format\nList of broken links with source element, target URL, and HTTP status",
        "requires_tool": "TOOL_TEXT_EXTRACTOR",
        "response_descriptions": {
          "title": "Brief description of the broken link",
          "severity": "critical for 5xx errors, high for 4xx, medium for timeouts, low for redirects",
          "targetText": "The anchor text of the broken link",
          "suggestion": "The correct URL or action to fix the broken link",
          "issueType": "broken-link"
        },
        "demos": {
          "detection_dimensions": ["Link targets", "HTTP status codes", "Redirect chains"],
          "cases": [
            {
              "id": "demo-1",
              "title": "Broken link to documentation",
              "tier": "obvious_match",
              "dimension_tested": "HTTP status codes: 404",
              "html": "<a href=\"https://docs.example.com/api\">API Reference</a>",
              "expected": "detected",
              "reason": "Link returns 404 Not Found"
            }
          ]
        },
        "suggested_required_inputs": []
      }
    }
  }
}

Validation result fields

FieldTypeDescription
analysis_promptstringMarkdown-formatted QA analysis prompt (objective, scope, detection logic, output format)
requires_toolstring"TOOL_TEXT_EXTRACTOR" or "NONE"
response_descriptionsobjectPer-field descriptions for AI response shaping
demosobjectDemo test cases with detection_dimensions[] and tiered cases[]
suggested_required_inputsobject[]Runtime-dependent fields the user must provide at execution time

Failure Response

{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
Errors: INVALID_ARGUMENT (missing or empty prompt).
{
  "result": {
    "status": "success",
    "message": "Prompt validated successfully",
    "data": {
      "validationResult": {
        "analysis_prompt": "## Objective\n...\n\n## Scope\n...",
        "requires_tool": "NONE",
        "response_descriptions": {},
        "demos": { "detection_dimensions": [], "cases": [] },
        "suggested_required_inputs": []
      }
    }
  }
}