fluxmodel.ai Docs
ChatTypeSafe Jev

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/json

Use 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?"
      }
    }
  }
}
FieldRequiredDescription
modelYesSet to typesafe/jev
inputYesAn object containing state and questions
input.stateYesState to evaluate, typically a string or JSON object; arrays and null are also supported
input.questionsYesAn object of questions; each nonempty key is your question ID and is reused in the response
input.questions.<id>.typeYesnoul, choice, or score
input.questions.<id>.instructionsYesEvaluation instructions for this question; a clear string is a good starting point
input.questions.<id>.criteriaDepends on typeDecision 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

Typecriteria formatMain result
noulOptional or null; when an object is supplied, only the "true" and "false" keys are allowed, describing affirmative and negative criterianoul: a number from 0 to 1; values closer to 1 support an affirmative answer
choiceRequired object mapping option keys to their descriptionschoice: the selected option key, with probabilities and confidence
scoreRequired array of at least two rating levels in orderscore: 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, and answers.impact.score.
  • probabilities contains values for the options or rating levels, and confidence is between 0 and 1. A noul answer returns its noul value without a separate confidence field.
  • The returned model may identify a specific model version. Do not require it to exactly match the requested name typesafe/jev.
  • usage.input_tokens and usage.output_tokens report input and output token counts. Add them if you need a total; do not require an additional total_tokens field. 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

SymptomWhat to check
Authentication failureCheck 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 deniedConfirm that typesafe/jev is enabled for the token group; contact an administrator to check availability if the issue persists
Invalid request parametersCheck 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 rejectedRemove stream: true and wait for the complete JSON response as shown above
No text found in a successful responseRead 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.

On this page