Velaron.AI

DocsAPI reference

Evaluations

Typed answers about a piece of text, from TypeSafe AI's Jev: a probability, a choice from options you give, or a level on a rubric. For routing, classifying and checking things in code, without parsing prose.

POST/v1/systemone

POST/typesafe/v1/systemonethe same endpoint under TypeSafe's path

curl
curl https://velaron.ai/v1/systemone \
  -H "Authorization: Bearer $KREDIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "typesafe-ai/jev",
        "state": "I was charged twice for my subscription and want the second charge refunded.",
        "questions": {
          "refund": { "type": "noul", "instructions": "Is the customer asking for money back?" },
          "team": { "type": "choice", "instructions": "Which team should handle this?",
                    "criteria": { "billing": "Charges and refunds", "technical": "Bugs and outages" } },
          "urgency": { "type": "score", "instructions": "How urgent is this?",
                       "criteria": ["Can wait a few days", "Should be handled today", "The customer is blocked"] } } }'

{ "model": "typesafe-ai/jev",
  "answers": {
    "refund": { "type": "noul", "noul": 0.98 },
    "team": { "type": "choice", "choice": "billing", "confidence": 1, "probabilities": { "billing": 1, "technical": 0 } },
    "urgency": { "type": "score", "score": 1.95, "legend": { "0": "Can wait a few days", "1": "Should be handled today", "2": "The customer is blocked" } } },
  "usage": { "input_tokens": 368, "output_tokens": 62 } }

Request#

modelstring · required

An evaluation model (typesafe-ai/jev). A chat model here answers 400 model_not_supported; an evaluation model on /v1/chat/completions is refused the same way.

statestring | object · required

What the model looks at: a message, a document, a JSON record.

questionsobject · required

Named questions, each with a type and instructions. noul answers with a probability that the statement holds. choice needs criteria, an object of option names and descriptions, and answers with one of them plus the probability of each. score needs criteria, an array of rubric levels from lowest to highest, and answers with the expected level (1.95 sits between the second and third) and a legend naming them. All questions are answered in parallel against the same state.

Response#

TypeSafe's JSON, plus x-vels-credits-charged and x-vels-balance. Billed on the input tokens the gateway reports; the answers cost nothing. There is no streaming, and the balance is checked against an estimate of the input before the call goes out.

With the TypeSafe SDK#

The SDK works unchanged: give it your Velaron.AI key as apiKey and the base URL below, with /typesafe in place of /v1.

Base URL
https://velaron.ai/v1