Skip to main content

Decisions API

Send context and a question. Get a structured decision.

Create an API key in your account settings and buy credits. Send Authorization: Bearer YOUR_API_KEY and a unique Idempotency-Key for each decision. The key owner pays for usage; never expose keys in browser code.

A Jev API example for your next integration

Call the iajev REST API with cURL. Receive a choice, probabilities, and confidence as JSON.

Read the iajev API documentation
Request
curl https://iajev.com/api/v1/decisions/run \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Idempotency-Key: YOUR_UNIQUE_REQUEST_ID' \
  -H 'Content-Type: application/json' \
  --data '{
  "state": {
    "message": "I was charged twice for my subscription last month and still haven'\''t received a refund.",
    "plan": "pro",
    "country": "US"
  },
  "decision": {
    "type": "choice",
    "question": "Which team should handle this request?",
    "choices": [
      "Billing",
      "Technical",
      "Sales",
      "Fraud"
    ]
  }
}'

Request fields

state.message
Required text; 1–8,000 characters.
state.<field>
Up to 5 optional extra fields alongside message. Names: 1–40 characters. Values: text up to 300 characters, a finite number, or a boolean. Nested objects are not supported.
decision.type
Use "choice". Scoring and boolean requests are not yet supported by this API.
decision.question
Required text; 1–300 characters.
decision.choices
2–8 unique, non-empty strings; up to 80 characters each.

Response fields

decision
The selected choice.
confidence
A separate confidence estimate between 0 and 1.
results
Each choice and its probability, sorted from highest to lowest.
meta
Latency in milliseconds and a request ID for troubleshooting.
billing
Credits charged, inputTokens, and outputTokens for this request.

Errors and limits

400
Invalid input or missing Idempotency-Key.
401
Missing, invalid, expired, or revoked API key.
402
Insufficient available credits.
409
Request pending, previously failed, or idempotency key reused with different input.
403
Account is unverified or disabled.
413
Request exceeds 16,000 UTF-8 bytes, including all fields.
415
Content-Type must be application/json.
429
API key rate limit reached. Respect the Retry-After header.
502 / 503 / 504
Decision unavailable or timed out. Avoid immediate repeated retries.
Response shape
{
  "decision": "Billing",
  "confidence": 0.8,
  "results": [
    { "value": "Billing", "probability": 0.87 },
    { "value": "Technical", "probability": 0.10 },
    { "value": "Sales", "probability": 0.02 },
    { "value": "Fraud", "probability": 0.01 }
  ],
  "meta": { "latencyMs": 218, "requestId": "…" },
  "billing": { "credits": 1, "inputTokens": 380, "outputTokens": 0 }
}
Check your available credits
curl https://iajev.com/api/v1/credits -H 'Authorization: Bearer YOUR_API_KEY'

Each paid request temporarily reserves 32 credits, then charges 1 credit per started 1,000 input tokens (minimum 1). Unused credits are released; failed requests are not charged. Keep the same Idempotency-Key when retrying after a connection error. HTTP 409 REQUEST_PENDING means wait and retry with the same key; REQUEST_FAILED requires a new key. Reusing a key with different input returns 409.

Do not include secrets or unnecessary personal data. Context is sent for inference. Signed-in and API requests store inputs, results, and billing records in your private history. Saved decisions also retain their input context. Anonymous previews store rate-limit counters without decision history.