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

# Introduction

> Ask precise questions about your data. Get probabilities and actions your application can use.

D1 turns a text or JSON context into decisions over outcomes you define. Use it to route a support request, select a tool, check an answer against its sources, or decide when a person should take over.

## Make a decision

With an API key from the [console](https://console.sqwish.ai), try a yes/no question:

```bash theme={null}
export D1_API_KEY='your-api-key'

curl --fail-with-body https://console.sqwish.ai/v1/decide \
  -H "Authorization: Bearer $D1_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "sqwish-d1-core",
    "context": "My parcel arrived with a cracked mug. Please help.",
    "decisions": [{
      "id": "needs_help",
      "kind": "binary",
      "question": "Does the customer ask for help with an order?"
    }]
  }'
```

Read `decisions.needs_help.p_yes` for the yes score and `decisions.needs_help.action` for the selected action. Check `model` and any `fallback` to see which model answered. The [quickstart](/quickstart) covers account access and handling the result.

## Three decision types

| Kind | Use it to | Read from the result |
| - | - | - |
| **Binary** | Answer a yes/no question | `p_yes`, `probabilities`, `action` |
| **Single** | Choose one of your named outcomes | `probabilities`, `top`, `action` |
| **Ordinal** | Rate against ordered levels | `expected_level`, `median_level`, `probabilities` |

Mix types in one request. Results are keyed by your decision IDs. Add an [abstention policy](/guides/interpreting-results) when uncertain cases should go to review.

<Note>
  Probabilities describe the declared alternatives. They are not a guarantee that an answer is correct. Test your wording, labels and action thresholds on representative cases before using them to automate work.
</Note>

## From a first request to a better decision

<CardGroup cols={2}>
  <Card title="Build an integration" icon="code" href="/quickstart">Send a request, read an action, and handle failures.</Card>
  <Card title="Try a real workflow" icon="flask" href="/examples/customer-support">Start with the same recipes used in the console playground.</Card>
  <Card title="Improve with your data" icon="database" href="/guides/datasets">Review labels, tune wording and train a version.</Card>
  <Card title="Connect an agent" icon="terminal" href="/agent-skills">Use the repository skill or the MCP tools.</Card>
</CardGroup>

The **API Reference** tab describes current customer endpoints. Its interactive calls target `console.sqwish.ai` and can perform real work using the key you supply.
