> ## Documentation Index
> Fetch the complete documentation index at: https://hercules.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Decisions with Jev

> Let your app classify, route, moderate, and score content automatically with Jev on Hercules AI Gateway. Fast, low cost, no API keys needed.

Use Jev to let your app make decisions about content automatically: sort support tickets, flag spam, route leads, or score answers against a rubric.

Jev (an AI model from TypeSafe built for decisions, not writing) answers typed questions with a confidence for each option instead of a paragraph of text. It is built into Hercules AI Gateway, answers in well under a second, and costs a fraction of a chatbot model. No API keys needed.

### How do I set it up?

Ask Hercules to use Jev for the decision you want your app to make. Hercules picks Jev for decisions like these by default, and naming it makes sure.

```text Route support tickets wrap theme={}
Use Jev to sort each new support ticket into billing, technical, or account, and to mark it urgent if it's time-sensitive
```

```text Moderate reviews wrap theme={}
Use Jev to check each product review for spam or abuse. Hide it when Jev is confident, and send borderline ones to me for review
```

```text Score leads wrap theme={}
Use Jev to score each new lead from poor to strong fit based on their company and message
```

### What can I build with it?

* **Routing:** Send tickets, emails, or form submissions to the right team
* **Moderation:** Flag spam, abuse, or off-topic posts before they go live
* **Tagging:** Pick a category, tag, or folder for new content
* **Checks:** Answer yes/no questions, like "Is this a refund request?"
* **Scoring:** Rate content against a rubric, like lead quality or answer quality

### What kinds of answers does Jev give?

Jev answers three kinds of questions:

* **Yes/no:** The chance the answer is yes, from 0 to 1
* **Choice:** The best option from a list you define, with a confidence for each option
* **Score:** A rating on a scale you define, like poor, fair, good, excellent

Your app can ask several questions about the same content in one request.

### How is it different from a chatbot model?

Chatbot models write text. Jev only makes decisions, so it returns answers your app can act on directly, with a confidence it is right. Your app can act automatically when Jev is confident and send unclear cases to a person.

Use a chatbot model through [AI Gateway](/docs/apps/ai-gateway) when the output is text a person reads, like a reply or a summary.

### How is billing handled?

Jev usage is billed through Hercules Cloud, like other AI Gateway usage. Jev only charges for the content it reads, and the answers are free. It is one of the lowest-cost models on AI Gateway.

### Additional FAQ

<AccordionGroup>
  <Accordion title="How does it work technically?">
    Hercules AI Gateway serves the TypeSafe API. Use the TypeSafe SDK (`@typesafe-ai/sdk`) with the Hercules base URL:

    ```ts theme={}
    import { TypeSafeClient } from "@typesafe-ai/sdk";

    const client = new TypeSafeClient({
      apiKey: process.env.HERCULES_API_KEY,
      baseURL: "https://ai-gateway.hercules.app/typesafe",
    });

    const { answers } = await client.systemOne({
      state: "I was charged twice for my subscription.",
      questions: {
        refund: { type: "noul", instructions: "Is the customer asking for money back?" },
        department: {
          type: "choice",
          instructions: "Which team should handle this?",
          criteria: { billing: "Charges and refunds", technical: "Bugs and outages" },
        },
      },
    });

    answers.refund.noul; // 0.98
    answers.department.choice; // "billing"
    ```

    The `HERCULES_API_KEY` is automatically available in your app's environment. Call Jev from your app's backend, never from the browser.
  </Accordion>

  <Accordion title="I already use TypeSafe. What do I change?">
    Change the base URL to `https://ai-gateway.hercules.app/typesafe` and the API key to your
    `HERCULES_API_KEY`. Requests and responses stay the same. Model names `jev-latest`,
    `typesafe/jev`, and `typesafe-ai/jev` all work.
  </Accordion>

  <Accordion title="What happens if my Hercules Cloud balance runs out?">
    Jev requests fail until you add credits, the same as other AI Gateway requests. Ask Hercules to
    add a fallback, like a default category, so your app keeps working.
  </Accordion>

  <Accordion title="Is there rate limiting?">
    Yes. Jev counts toward the same AI Gateway rate limit as your other AI requests. If you need
    higher limits, please contact support.
  </Accordion>
</AccordionGroup>
