POST /chat
The /chat endpoint is the primary interface for interacting with H.A.R.V.E.Y., the AI-powered pricing assistant. Submit natural language questions about pricing models and receive comprehensive analysis results.
Endpoint
POST http://localhost:8086/chat
Request Body
The natural language question about pricing. Cannot be empty. Examples:
“What is the cheapest plan with SSO?”
“How many subscription configurations are available?”
“Find the optimal plan for 100 users with advanced features”
Single pricing URL to analyze (alternative to pricing_urls) Unique identifier for this pricing URL
HTTP/HTTPS URL pointing to a pricing page
Array of pricing URLs for multi-pricing comparison Each item is an object with:
id (string, required): Unique identifier
url (string, required): Pricing page URL
Single Pricing2Yaml content as a string (alternative to pricing_yamls)
Array of Pricing2Yaml content strings for analysis
Request Schema
{
"question" : "string" ,
"pricing_url" : {
"id" : "string" ,
"url" : "string"
},
"pricing_urls" : [
{
"id" : "string" ,
"url" : "string"
}
],
"pricing_yaml" : "string" ,
"pricing_yamls" : [ "string" ]
}
Response
Natural language answer to the question, synthesized by H.A.R.V.E.Y. from tool results and context
The execution plan generated by H.A.R.V.E.Y. List of actions to execute. Each action can be:
A string: "summary", "iPricing", "validate", "subscriptions", "optimal"
An object with action-specific parameters (name, objective, pricing_url, filters, solver)
Whether a user-supplied Pricing2Yaml is mandatory to proceed
Whether the agent consulted the Pricing2Yaml specification
Detailed results from executing the plan Array of execution step records, each containing:
index (number): Step order
action (string): Action name
payload (object): Tool response data
objective (string, optional): For optimal action
filters (object, optional): Applied filters
solver (string, optional): CSP solver used
url (string, optional): Pricing URL
pricingContext (string, optional): Context reference
List of action names executed (when multiple steps)
The final tool response payload
Examples
Simple Query with URL
curl -X POST http://localhost:8086/chat \
-H "Content-Type: application/json" \
-d '{
"question": "What is the cheapest plan?",
"pricing_url": {
"id": "github",
"url": "https://github.com/pricing"
}
}'
Query with Uploaded YAML
curl -X POST http://localhost:8086/chat \
-H "Content-Type: application/json" \
-d '{
"question": "How many plans include SSO?",
"pricing_yaml": "saasName: MyApp\nsyntaxVersion: 2.1\ncurrency: USD\nfeatures:\n sso:\n description: Single Sign-On\n valueType: BOOLEAN\n defaultValue: false\n type: INTEGRATION\nplans:\n basic:\n price: 10\n features:\n sso: false\n pro:\n price: 50\n features:\n sso: true"
}'
Optimization Query with Filters
curl -X POST http://localhost:8086/chat \
-H "Content-Type: application/json" \
-d '{
"question": "Find the cheapest plan with SSO and at least 100 users",
"pricing_url": {
"id": "saas-a",
"url": "https://example.com/pricing"
}
}'
Multi-Pricing Comparison
import requests
response = requests.post(
"http://localhost:8086/chat" ,
json = {
"question" : "Which service offers cheaper plans for 50 users?" ,
"pricing_urls" : [
{ "id" : "service-a" , "url" : "https://service-a.com/pricing" },
{ "id" : "service-b" , "url" : "https://service-b.com/pricing" }
]
}
)
data = response.json()
print ( f "Answer: { data[ 'answer' ] } " )
Response Example
{
"answer" : "The cheapest plan that includes SSO is the 'Pro' plan at $50.00 USD per month. This plan includes Single Sign-On (SSO) authentication and supports up to 100 users." ,
"plan" : {
"actions" : [
"iPricing" ,
{
"name" : "optimal" ,
"objective" : "minimize" ,
"pricing_url" : "uploaded://pricing" ,
"filters" : {
"features" : [ "sso" ]
},
"solver" : "minizinc"
}
],
"requires_uploaded_yaml" : false ,
"use_pricing2yaml_spec" : false
},
"result" : {
"actions" : [ "iPricing" , "optimal" ],
"steps" : [
{
"index" : 0 ,
"action" : "iPricing" ,
"payload" : {
"pricing_yaml" : "saasName: MyApp \n ..."
},
"pricingContext" : "uploaded://pricing"
},
{
"index" : 1 ,
"action" : "optimal" ,
"objective" : "minimize" ,
"filters" : {
"features" : [ "sso" ]
},
"solver" : "minizinc" ,
"payload" : {
"optimal" : {
"subscription" : {
"plan" : "pro" ,
"addOns" : []
},
"cost" : "50.0 USD" ,
"breakdown" : {
"plan" : "50.0 USD" ,
"addOns" : []
}
}
},
"pricingContext" : "uploaded://pricing"
}
],
"lastPayload" : {
"optimal" : {
"subscription" : {
"plan" : "pro" ,
"addOns" : []
},
"cost" : "50.0 USD" ,
"breakdown" : {
"plan" : "50.0 USD" ,
"addOns" : []
}
}
}
}
}
Error Responses
400 Bad Request
{
"detail" : "Question is required."
}
502 Bad Gateway
{
"detail" : "MCP server connection failed: Connection refused"
}
Query Types
H.A.R.V.E.Y. can handle various query types:
Optimization Queries
“What is the cheapest plan with X feature?”
“Find the most expensive configuration”
“Best value for Y users”
Enumeration Queries
“How many subscription options are available?”
“List all plans with feature X”
“Show configurations under $100”
Validation Queries
“Is this pricing model valid?”
“Check for errors in the YAML”
“Validate the configuration”
“What features are available?”
“Explain the pricing structure”
“What is the currency?”
Notes
URL detection: H.A.R.V.E.Y. automatically detects URLs in the question text
Deduplication: Identical URLs and YAML contents are automatically deduplicated
Multi-context: When multiple pricing sources are provided, actions must specify pricing_url
Filter grounding: H.A.R.V.E.Y. uses exact feature and usage limit names from the YAML
Default solver: minizinc is used by default unless choco is explicitly requested
Upload YAML Upload Pricing2Yaml files before querying
MCP Tools Learn about available MCP server tools