DEVELOPER QUICKSTART

Jev API Quickstart

Create an API key, send your first Choice request with curl or Python, and read the structured response from the Jev API gateway.

1. Create a key and choose a safe runtime

Create an API key in your Best Jev AI account. Keep it in a server-side environment variable or secret manager; do not put it in browser JavaScript, a mobile app bundle, or source control.

  • Endpoint: POST https://bestjevai.com/v1/systemone
  • Authorization: Bearer <API_KEY>
  • Model: typesafe/jev-1.13

2. Send one bounded Choice decision

Provide a state with the facts the decision needs, then define a question with a finite set of choices. Question IDs become keys in the response, so use stable, descriptive names.

curl https://bestjevai.com/v1/systemone \
  -H "Authorization: Bearer $JEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "typesafe/jev-1.13",
    "state": "The customer was charged twice for one order.",
    "questions": {
      "next_step": {
        "type": "choice",
        "instructions": "What should support do next?",
        "criteria": {
          "refund_review": "Review the duplicate charge for a refund",
          "request_receipt": "Ask the customer for a receipt",
          "billing_support": "Send the case to billing support"
        }
      }
    }
          }'

Python equivalent

The same JSON contract works from a server-side Python process. Read the API key from the environment rather than writing it into the script.

import os
import requests

response = requests.post(
    "https://bestjevai.com/v1/systemone",
    headers={"Authorization": f"Bearer {os.environ['JEV_API_KEY']}"},
    json={
        "model": "typesafe/jev-1.13",
        "state": "The customer was charged twice for one order.",
        "questions": {
            "next_step": {
                "type": "choice",
                "instructions": "What should support do next?",
                "criteria": {
                    "refund_review": "Review the duplicate charge",
                    "request_receipt": "Ask for a receipt",
                    "billing_support": "Send to billing support",
                },
            }
        },
    },
    timeout=20,
)
response.raise_for_status()
result = response.json()["data"]["result"]

3. Read the answer and decide in your code

A successful API-key request returns a standard response envelope. Read the answer by its question ID, inspect its probability distribution, and keep action thresholds in your application.

{
  "code": 0,
  "message": "ok",
  "data": {
    "result": {
      "answers": {
        "next_step": {
          "type": "choice",
          "choice": "refund_review",
          "probabilities": {
            "refund_review": 0.81,
            "request_receipt": 0.07,
            "billing_support": 0.12
          },
          "confidence": 0.76
        }
      },
      "usage": { "input_tokens": 42, "output_tokens": 18 },
      "elapsedMs": 184
    },
    "creditsUsed": 1
  }
}

Example values are illustrative. A probability is a model signal, not a guarantee or an authorization decision.

Continue to the endpoint reference

Open the Playground