← All tool references

Health · not_available

BAC Calculator

BAC with subject-specific controls, reviewable intermediate detail, and private browser processing.

Open public tool

Overview

Category
Health
API mode
not_available
Processing
client-side
Privacy
no-data-stored

Public descriptor

The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.

GET /api/v1/tools/bac-calculator

View this descriptor as JSON

Execute availability

This tool is documented as a browser capability. Its execute route does not produce a server-side result; when execution is enabled, it responds with browser_interaction_required and points callers to the public tool page.

POST /api/v1/tools/bac-calculator/execute

Authentication is not issued during the preview. A bearer API key is planned for execution after launch.

Input schema

object object; additional properties are not accepted.

drinks · number · required
Enter standard drinks.
hours · number · required
Enter hours elapsed.
weight · number · required
Enter body weight.
sex_constant · string · required
Enter distribution constant. Accepted values: male, female.
{
    "type": "object",
    "properties": {
        "drinks": {
            "type": "number",
            "description": "Enter standard drinks."
        },
        "hours": {
            "type": "number",
            "description": "Enter hours elapsed."
        },
        "weight": {
            "type": "number",
            "description": "Enter body weight."
        },
        "sex_constant": {
            "type": "string",
            "description": "Enter distribution constant.",
            "enum": [
                "male",
                "female"
            ]
        }
    },
    "required": [
        "drinks",
        "hours",
        "weight",
        "sex_constant"
    ],
    "additionalProperties": false
}

Output schema

On a successful execution, schema values appear in data.result.values.

estimated_bac · number
Estimated BAC produced by the tool.
eliminated · number
Estimated eliminated produced by the tool.
warning · string
Safety warning produced by the tool.
{
    "type": "object",
    "properties": {
        "estimated_bac": {
            "type": "number",
            "description": "Estimated BAC produced by the tool."
        },
        "eliminated": {
            "type": "number",
            "description": "Estimated eliminated produced by the tool."
        },
        "warning": {
            "type": "string",
            "description": "Safety warning produced by the tool."
        }
    },
    "additionalProperties": false
}

BAC Calculator worked example

The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.

curl -X POST "https://utilitypages.org/api/v1/tools/bac-calculator/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "drinks": 3,
    "hours": 2,
    "weight": 75,
    "sex_constant": "male"
}'
{
    "ok": true,
    "data": {
        "slug": "bac-calculator",
        "result": {
            "values": {
                "estimated_bac": 0.051999999999999997613020497055913438089191913604736328125,
                "eliminated": 0.0299999999999999988897769753748434595763683319091796875,
                "warning": "Do not use this estimate to decide whether to drive or perform a safety-sensitive activity."
            },
            "display": {
                "display": "0.052"
            },
            "warnings": [],
            "assumptions": [],
            "steps": []
        }
    },
    "meta": [],
    "request_id": "req_example_123"
}

Errors

api_not_launched · 503
Returned by the current launch gate for every execute request.
invalid_json · 400
Returned when an enabled execute request does not contain valid JSON.
validation_failed · 422
Returned when a request does not satisfy the input schema.
browser_interaction_required · 422
Returned for browser capability tools instead of inventing a server-side result.
tool_not_found · 404
Returned when a requested descriptor slug does not exist.
execution_failed · 503
Returned when an enabled server-side execution cannot complete.