> ## Documentation Index
> Fetch the complete documentation index at: https://freelance-4888ed08.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Accuracy

> Push a new accuracy metric to Prometheus for Grafana dashboard visualization

Push a new accuracy metric (0.0–1.0) to the system's Prometheus gauge. This endpoint is typically called by the **Automated Evaluation Pipeline** after a retraining job completes.

### Parameters

**accuracy** `float` *required*

New accuracy score (0.0 to 1.0) to be reported to Prometheus.

**model\_id** `string`

Identifier for the model being evaluated. Defaults to `"production"`.

### Usage

This does **not** retrain the model. It updates the Grafana (A monitoring dashboard for real-time visualization of MLOps metrics.) metrics gauge (`model_accuracy`), which triggers alerts if accuracy drops below configured thresholds.

```bash cURL theme={null}
curl -X POST http://localhost:8000/model/accuracy \
  -H "Content-Type: application/json" \
  -d '{"accuracy": 0.92}'
```

```python Python theme={null}
import requests
response = requests.post(
    "http://localhost:8000/model/accuracy",
    json={"accuracy": 0.92}
)
print(response.json())
```

```json 200 theme={null}
{
  "status": "ok",
  "accuracy": 0.92,
  "model_id": "production"
}
```


## OpenAPI

````yaml POST /model/accuracy
openapi: 3.0.0
info:
  title: Demand Forecasting API
  version: 1.0.0
  description: API for retrieving demand forecasts and monitoring system health.
servers:
  - url: http://localhost:8000
    description: Local Model Server
security: []
paths:
  /model/accuracy:
    post:
      summary: Update Model Accuracy
      description: Push a new accuracy metric (0.0-1.0) to the prometheus gauge.
      operationId: updateModelAccuracy
      parameters:
        - name: accuracy
          in: query
          required: true
          schema:
            type: number
            format: float
        - name: model_id
          in: query
          required: false
          schema:
            type: string
            default: production
      responses:
        '200':
          description: Metric updated
        '400':
          description: Invalid accuracy value

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.