API Documentation

Integrate Anvil o1's vendor prediction capabilities into your applications. The API accepts solicitation text and metadata, returning ranked vendor predictions with confidence scores.

Base URL https://anvil-api-production.up.railway.app
GET / Health check and model info
Response
{ "status": "ok", "model": "anvil-o1", "vendors": 500 }
Click "Try it" to see response
GET /samples Get sample solicitations for testing
Response
[ { "id": 0, "text": "Solicitation description...", "psc": "59", "naics": "334419", "set_aside": "", "amount": 250000, "actual_winner": "VENDOR NAME" }, // ... 30 samples total ]
Click "Try it" to see response
POST /predict Predict top vendors for a solicitation
Request Body
Parameter Type Description
textrequired string The solicitation description text
pscoptional string Product Service Code (e.g., "59", "23")
naicsoptional string NAICS industry code (e.g., "334419")
set_asideoptional string Set-aside type (e.g., "Small Business")
amountoptional number Estimated contract value in USD
Example Request
curl -X POST https://anvil-api-production.up.railway.app/predict \ -H "Content-Type: application/json" \ -d '{ "text": "Procurement for military vehicle replacement parts", "psc": "23", "naics": "336992", "amount": 150000 }'
Response
{ "predictions": [ { "rank": 1, "vendor": "OSHKOSH DEFENSE LLC", "confidence": 15.42 }, { "rank": 2, "vendor": "BAE SYSTEMS", "confidence": 8.31 }, // ... top 10 vendors ], "total_vendors": 500, "inference_time_ms": 28.4, "token_count": 12, "top_terms": [ { "term": "vehicle", "weight": 0.412 }, { "term": "military", "weight": 0.385 }, // ... top 15 terms ], "confidence_distribution": [15.42, 8.31, /* top 50 */] }
Response Fields
Field Type Description
predictions array Top 10 predicted vendors with rank and confidence %
total_vendors number Total vendors in the model (500)
inference_time_ms number Model inference time in milliseconds
token_count number Number of TF-IDF tokens extracted from input
top_terms array Top 15 influential terms with TF-IDF weights
confidence_distribution array Confidence scores for top 50 vendors (for charting)
Status Codes
200 Successful prediction
400 Missing or empty text field
Click "Try it" to see response