# Ask Eevo via curl (SystemOne-compatible API)

> Ask questions about any state through the SystemOne-compatible API, and act on the probabilities.

> [!NOTE]
> Eevo also has a SystemOne-compatible API. It works like any decision model: you describe a state, ask questions about it, and get each answer with probabilities. Not every decision has options and stakeholders. Sometimes your code needs a quick, structured judgement: which queue a ticket goes to, how urgent it is, whether a statement is true. Requests and answers follow the SystemOne format, so a client written for another SystemOne-compatible model works with Eevo.

You need the API key from [Ask Eevo via curl (Native API)](https://eevo.io/docs/tutorials/first-decision).

## 1. Describe the state and ask

A request has a `state` (text or JSON) and named `questions`. A `choice` picks one label, a `score` picks a level on an ordered scale, and a `noul` says how likely a statement is to be true.

```shell
curl https://eevo.io/api/v1/systemone \
  -H "Authorization: Bearer $EEVO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "eevo-1",
  "state": "Support ticket: a customer was charged twice for an €80 order because of an error in our billing system. Agents may refund up to €50 without approval.",
  "questions": {
    "action": {
      "type": "choice",
      "instructions": "What should the support agent do?",
      "criteria": {
        "refuse": "Refuse, and cite the €50 limit",
        "partial": "Refund €50 and ask the customer to contact billing for the rest",
        "refund": "Refund the €80 duplicate charge and record the exception"
      }
    },
    "urgency": {
      "type": "score",
      "instructions": "How urgent is the ticket?",
      "criteria": [
        "Not urgent",
        "Somewhat urgent",
        "Urgent",
        "Critical"
      ]
    },
    "fraud": {
      "type": "noul",
      "instructions": "The customer is attempting fraud."
    }
  }
}'
```

- For a `choice`, describe each label by what belongs there, not just its name.
- For a `score`, list the levels from lowest to highest, each written as what the level means. The answer's `score` is the level's index.
- For a `noul`, write the `instructions` as a statement: "The reply promises a refund the policy does not allow."
- Ask up to 32 questions about one state in one request, with your own ids as keys. They are answered independently, so split a compound question into simple ones.

## 2. Read the answers

```json
{
  "model": "eevo-1.2",
  "answers": {
    "action": {
      "type": "choice",
      "choice": "refund",
      "confidence": 0.71,
      "probabilities": {
        "refuse": 0.07,
        "partial": 0.22,
        "refund": 0.71
      }
    },
    "urgency": {
      "type": "score",
      "score": 2,
      "confidence": 0.58,
      "legend": {
        "0": "Not urgent",
        "1": "Somewhat urgent",
        "2": "Urgent",
        "3": "Critical"
      },
      "probabilities": {
        "0": 0.03,
        "1": 0.31,
        "2": 0.58,
        "3": 0.08
      }
    },
    "fraud": {
      "type": "noul",
      "noul": 0.04
    }
  },
  "usage": {
    "input_tokens": 412,
    "output_tokens": 0
  }
}
```

Each answer carries a probability. Act on it in code: refund automatically above a confidence you choose, and send the rest to a person.

## Next

- [Probability, confidence and expected value](https://eevo.io/docs/explanation/probability-and-ev)
- [SystemOne-compatible API](https://eevo.io/docs/reference/api-systemone): every field of the endpoint.
