Jev Structured Evaluation
Call typesafe/jev through fluxmodel.ai to evaluate text or structured state with decisions, classifications, and scores, then read answers and token usage directly.
typesafe/jev evaluates a state against questions you define. A single request can return affirmative scores, category selections, and rating scores for tasks such as ticket routing, content evaluation, and rule-assisted review.
Endpoint and Prerequisites
POST https://api.modelsell.cc/v1/responses
Authorization: Bearer $MODELSELL_API_KEY
Content-Type: application/jsonUse a fluxmodel.ai API key whose token group has access to typesafe/jev. Store the key in the server environment variable MODELSELL_API_KEY. The examples read it from the environment; keep it out of browser code and source control.
Calls are synchronous and non-streaming: wait for the HTTP request to return its JSON result. The examples omit stream. Do not set stream: true; there is no task to poll.
Read results from answers
Although the endpoint is /v1/responses, Jev returns its own successful response structure: model, answers, and usage. Read answers directly instead of using generic text response fields such as output_text or choices.
Request Fields
{
"model": "typesafe/jev",
"input": {
"state": "The content to evaluate",
"questions": {
"needs_follow_up": {
"type": "noul",
"instructions": "Does this matter require follow-up?"
}
}
}
}| Field | Required | Description |
|---|---|---|
model | Yes | Set to typesafe/jev |
input | Yes | An object containing state and questions |
input.state | Yes | State to evaluate, typically a string or JSON object; arrays and null are also supported |
input.questions | Yes | An object of questions; each nonempty key is your question ID and is reused in the response |
input.questions.<id>.type | Yes | noul, choice, or score |
input.questions.<id>.instructions | Yes | Evaluation instructions for this question; a clear string is a good starting point |
input.questions.<id>.criteria | Depends on type | Decision criteria, category options, or ordered rating levels, described below |
Use a string state for text evaluation, or an object to provide related context such as a ticket, order, and rules together. You do not need to stringify the object. Nested object or array values may contain numbers, booleans, and null; state itself cannot be a bare number or boolean.
Question Types and criteria
| Type | criteria format | Main result |
|---|---|---|
noul | Optional or null; when an object is supplied, only the "true" and "false" keys are allowed, describing affirmative and negative criteria | noul: a number from 0 to 1; values closer to 1 support an affirmative answer |
choice | Required object mapping option keys to their descriptions | choice: the selected option key, with probabilities and confidence |
score | Required array of at least two rating levels in order | score: a numeric score that may be fractional, with legend, probabilities, and confidence |
Score levels start at index 0; use the returned legend to identify their meanings. A noul result is a number, not a boolean. Define your own threshold if your application needs a yes/no decision. The model's confidence and probabilities describe its evaluation and do not guarantee that the result is correct.
Question instructions and criterion descriptions also support objects, arrays, or null. Start with strings to make your evaluation rules easy to inspect. Use only the type, instructions, and criteria fields inside each question object.
cURL: Submit All Three Question Types
Configure MODELSELL_API_KEY in your execution environment, then run:
curl --fail-with-body --request POST 'https://api.modelsell.cc/v1/responses' \
--header "Authorization: Bearer ${MODELSELL_API_KEY}" \
--header 'Content-Type: application/json' \
--data '{
"model": "typesafe/jev",
"input": {
"state": "Order X42 is missing an installation part. The customer needs it for an exhibition tomorrow and requests a replacement shipment today.",
"questions": {
"urgent": {
"type": "noul",
"instructions": "Does this need priority handling today?",
"criteria": {
"true": "An explicit same-day request or an approaching use deadline",
"false": "No explicit deadline; normal processing is appropriate"
}
},
"team": {
"type": "choice",
"instructions": "Which team should handle this request first?",
"criteria": {
"fulfillment": "Missing parts, replacement shipments, and delivery",
"support": "Setup instructions and troubleshooting",
"sales": "Product selection and purchase questions"
}
},
"impact": {
"type": "score",
"instructions": "How much does this issue affect the customer plans?",
"criteria": [
"Routine question; use is unaffected",
"Use is affected, but a workaround is available",
"Use is blocked and the deadline is approaching"
]
}
}
}
}'Response and Result Parsing
This JSON is an illustration of the response structure. Scores, the model version, and token counts are example values, not measured results:
{
"model": "jev-example-version",
"answers": {
"urgent": {
"type": "noul",
"noul": 0.92
},
"team": {
"type": "choice",
"choice": "fulfillment",
"confidence": 0.87,
"probabilities": {
"fulfillment": 0.91,
"support": 0.07,
"sales": 0.02
}
},
"impact": {
"type": "score",
"score": 1.76,
"confidence": 0.81,
"legend": {
"0": "Routine question; use is unaffected",
"1": "Use is affected, but a workaround is available",
"2": "Use is blocked and the deadline is approaching"
},
"probabilities": {
"0": 0.03,
"1": 0.18,
"2": 0.79
}
}
},
"usage": {
"input_tokens": 310,
"output_tokens": 64
}
}- Index answers by the question IDs you submitted:
answers.urgent.noul,answers.team.choice, andanswers.impact.score. probabilitiescontains values for the options or rating levels, andconfidenceis between 0 and 1. Anoulanswer returns itsnoulvalue without a separateconfidencefield.- The returned
modelmay identify a specific model version. Do not require it to exactly match the requested nametypesafe/jev. usage.input_tokensandusage.output_tokensreport input and output token counts. Add them if you need a total; do not require an additionaltotal_tokensfield. Refer to platform model pricing and usage records for actual charges.
Python: Send a Structured state
Install requests, then run this example on a server with MODELSELL_API_KEY configured:
import os
import requests
payload = {
"model": "typesafe/jev",
"input": {
"state": {
"order_id": "X42",
"missing_parts": ["mounting bracket"],
"replacement_sent": False,
"customer_note": "The equipment is needed at tomorrow's exhibition.",
},
"questions": {
"needs_follow_up": {
"type": "noul",
"instructions": "Is follow-up needed to address the missing part before use?",
}
},
},
}
response = requests.post(
"https://api.modelsell.cc/v1/responses",
headers={"Authorization": f"Bearer {os.environ['MODELSELL_API_KEY']}"},
json=payload,
timeout=60,
)
response.raise_for_status()
data = response.json()
print(data["answers"]["needs_follow_up"]["noul"])
print(data["usage"]["input_tokens"], data["usage"]["output_tokens"])JavaScript: Use fetch
Run this example in a server-side Node.js environment that supports fetch, rather than in a browser page:
const apiKey = process.env.MODELSELL_API_KEY;
if (!apiKey) throw new Error('Missing MODELSELL_API_KEY');
const response = await fetch('https://api.modelsell.cc/v1/responses', {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
signal: AbortSignal.timeout(60_000),
body: JSON.stringify({
model: 'typesafe/jev',
input: {
state: 'An installation part is missing from order X42. Please send a replacement.',
questions: {
team: {
type: 'choice',
instructions: 'Which team should handle this request first?',
criteria: {
fulfillment: 'Missing parts and replacement shipments',
support: 'Setup instructions and troubleshooting',
sales: 'Product selection and purchase questions',
},
},
},
},
}),
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
const data = await response.json();
console.log(data.answers.team.choice);
console.log(data.answers.team.confidence);
console.log(data.usage);The 60-second timeout in these examples is a client setting you can adjust, not a service latency commitment.
Troubleshooting
| Symptom | What to check |
|---|---|
| Authentication failure | Check that the environment variable is set, the fluxmodel.ai key is valid, and the header uses Authorization: Bearer ... |
| Model unavailable, no available channel, or access denied | Confirm that typesafe/jev is enabled for the token group; contact an administrator to check availability if the issue persists |
| Invalid request parameters | Check input.state, input.questions, and each question's type and instructions; choice requires an object for criteria, while score requires an array with at least two items |
| Streaming request rejected | Remove stream: true and wait for the complete JSON response as shown above |
| No text found in a successful response | Read answers, not output_text or choices, using the question IDs from your request |
Errors use the platform's unified error format. Check the HTTP status first, then read error.message from the JSON body. Retain error.code when present to help diagnose the failure. Do not parse an error response as a successful result containing answers, or depend on the original provider's error structure.
For Jev field and question definitions, see the official model documentation, input schema, and output schema. When using fluxmodel.ai, use the platform endpoint and fluxmodel.ai key shown on this page.