---
name: jev-decisions
description: "Integrate or troubleshoot Jev native decision requests through LLM API Gateway, using /v1/decisions or /v1/systemone with state and questions instead of chat messages."
---

# Jev native decisions through LLM API Gateway

Use Jev for classification, scoring, routing, and yes/no gates. It returns typed decisions, not generated chat text. Preserve the user's integration target; do not replace a gateway call with a vendor-direct call.

## Select the endpoint and matching key

| Connection | Full POST URL | Credential |
|---|---|---|
| Recommended gateway | `https://api.llm-token.cn/v1/decisions` | Gateway API key |
| Compatible gateway | `https://api.llm-token.cn/v1/systemone` | Same gateway API key |
| TypeSafe direct, only when explicitly chosen | `https://api.typesafe.ai/v1/systemone` | TypeSafe API key |

The website origins `llm-agent.cc` and `llm-token.cn` are not the API host. If a client already uses `https://api.llm-token.cn/v1` as its Base URL, append `/decisions` or `/systemone` only. Do not duplicate `/v1`, use community `/api/v1/decisions` paths, or send gateway keys to the TypeSafe host.

Ordinary OpenAI `chat.completions.create()`, Anthropic `messages.create()`, and Responses calls are not native decisions calls. Changing the model name to `jev-latest` does not make them compatible. Use a native decisions client or explicit HTTP request; omit chat-specific fields and streaming.

## Build the native payload

- `model`: use `jev-latest` unless the user's live gateway catalog specifies another permitted ID. Vendor aliases are not proof of gateway availability.
- `state`: text, object, or array holding the material to evaluate.
- `questions`: a nonempty object keyed by stable question IDs. Each question needs `type` and `instructions`.
- `noul`: yes/no probability; `criteria` is optional.
- `choice`: `criteria` is an object mapping each option to its description.
- `score`: `criteria` is an ordered array of level descriptions.
- Do not send top-level `messages`, `prompt`, `input`, `max_tokens`, or `stream` as substitutes for the native fields.

Keep questions focused and combine their results in application code. Do not silently drop zero probabilities, nested `false`, or explicit zero usage.

## Minimal request

Set the gateway key in `LLM_API_KEY` without writing it into source, command history, logs, or public output. The example below performs a real, potentially billed call. A request to write documentation, generate code, or diagnose logs does not by itself authorize executing it.

```bash
curl -sS -X POST https://api.llm-token.cn/v1/decisions \
  -H "Authorization: Bearer $LLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d @- <<'JSON'
{
  "model": "jev-latest",
  "state": "The order is due today and the payment has failed.",
  "questions": {
    "is_urgent": {
      "type": "noul",
      "instructions": "Does this require urgent attention?"
    }
  }
}
JSON
```

Parse the returned `model`, `answers`, and `usage`. Answer keys match the question IDs:

- Noul: `answers.is_urgent.noul`, a number from 0 to 1; zero is valid.
- Choice: `choice`, `probabilities`, and `confidence`.
- Score: `score`, `legend`, `probabilities`, and `confidence`.

Do not expect `choices[0].message.content` or an SSE stream. Probability is a decision signal, not authority to execute a payment, deletion, or external message.

## Troubleshoot the actual request

For `500 / convert_request_failed` containing `this channel only supports native decisions requests`, inspect the effective URL and top-level field names. Calls to `/v1/chat/completions`, `/v1/messages`, or `/v1/responses` must be replaced with a native decisions request. More credit or usage-based billing cannot repair a protocol mismatch.

Keep 401/403 authorization, 429 rate limits, invalid payloads, and upstream failures distinct from this error. Do not automatically replay a possibly accepted or billed POST; this gateway does not provide a general idempotency guarantee for decisions. Confirm the result before any separate retry. Report code generation, offline validation, a real API response, and billing evidence as separate outcomes.

## Sources

Endpoint/schema reference checked on 2026-10-07; recheck when the contract changes:

- [Gateway endpoint tutorial](https://llm-agent.cc/en/tutorials/api-endpoints)
- [Gateway live model catalog](https://llm-agent.cc/en/model-pricing)
- [TypeSafe API reference](https://docs.typesafe.ai/api)
- [TypeSafe quick start](https://docs.typesafe.ai/introduction/quickstart)
