API Reference

Every Vorte application exposes a set of built-in endpoints for health monitoring, metrics collection, and administration. These endpoints are available immediately after application startup and can be individually enabled or disabled through configuration.

Built-in Endpoints

EndpointMethodDescriptionAuth Required
/healthGETReturns the application health status including module statesNo
/readyGETReadiness probe indicating the app can accept trafficNo
/liveGETLiveness probe indicating the process is aliveNo
/infoGETReturns framework version, loaded modules, and configurationNo
/metricsGETReturns Prometheus-compatible metrics in text formatNo
/dashboardGETServes the Vorte admin dashboard web interfaceYes

Health Check

terminal
bash
Copied!
1GET /health

Response:

data.json
json
Copied!
1{
2 "status": "healthy",
3 "timestamp": "2026-05-23T10:30:00Z",
4 "modules": {
5 "database": "ready",
6 "cache": "ready",
7 "ai": "ready",
8 "auth": "ready",
9 "queue": "ready"
10 },
11 "uptime_seconds": 86400,
12 "version": "1.2.0"
13}

Custom Health Checks

check_redis.py
python
Copied!
1from vorte import Vorte
2
3app = Vorte(auto_load=True)
4
5@app.health_check("redis")
6async def check_redis():
7 try:
8 await redis.ping()
9 return {"status": "healthy", "latency_ms": 2}
10 except Exception as e:
11 return {"status": "unhealthy", "error": str(e)}
12
13@app.health_check("external_api")
14async def check_external_api():
15 async with httpx.AsyncClient() as client:
16 response = await client.get("https://api.example.com/ping", timeout=5)
17 return {
18 "status": "healthy" if response.status_code == 200 else "unhealthy",
19 "status_code": response.status_code,
20 }

Readiness Probe

terminal
bash
Copied!
1GET /ready

Response (ready):

data.json
json
Copied!
1{
2 "ready": true,
3 "checks": {
4 "database": true,
5 "cache": true,
6 "migrations": true
7 }
8}

Response (not ready):

data.json
json
Copied!
1{
2 "ready": false,
3 "checks": {
4 "database": true,
5 "cache": false,
6 "migrations": true
7 }
8}

Liveness Probe

terminal
bash
Copied!
1GET /live

Response:

data.json
json
Copied!
1{
2 "alive": true,
3 "pid": 12345,
4 "timestamp": "2026-05-23T10:30:00Z"
5}

Info Endpoint

terminal
bash
Copied!
1GET /info

Response:

data.json
json
Copied!
1{
2 "framework": {
3 "name": "Vorte",
4 "version": "1.2.0",
5 "python_version": "3.12.4",
6 "rust_engine": true
7 },
8 "application": {
9 "name": "My App",
10 "version": "2.0.0",
11 "environment": "production"
12 },
13 "modules": [
14 {"name": "auth", "version": "1.0.0", "state": "ready"},
15 {"name": "database", "version": "1.0.0", "state": "ready"},
16 {"name": "ai", "version": "1.0.0", "state": "ready"}
17 ],
18 "endpoints": {
19 "health": true,
20 "ready": true,
21 "live": true,
22 "metrics": true,
23 "dashboard": false
24 }
25}

Metrics Endpoint

terminal
bash
Copied!
1GET /metrics

Returns metrics in Prometheus text exposition format. Includes request counts, latencies, error rates, module-specific metrics, and custom application metrics.

example.py
python
Copied!
1# HELP vorte_http_requests_total Total HTTP requests
2# TYPE vorte_http_requests_total counter
3vorte_http_requests_total{method="GET",path="/api/users",status="200"} 15234
4
5# HELP vorte_http_request_duration_seconds Request duration
6# TYPE vorte_http_request_duration_seconds histogram
7vorte_http_request_duration_seconds_bucket{method="GET",le="0.1"} 12000
8vorte_http_request_duration_seconds_bucket{method="GET",le="0.5"} 14500
9vorte_http_request_duration_seconds_bucket{method="GET",le="1.0"} 15000
10
11# HELP vorte_module_state Module state
12# TYPE vorte_module_state gauge
13vorte_module_state{module="database"} 1
14vorte_module_state{module="cache"} 1
15vorte_module_state{module="ai"} 1
16
17# HELP vorte_ai_tokens_total AI token usage
18# TYPE vorte_ai_tokens_total counter
19vorte_ai_tokens_total{provider="openai",type="prompt"} 50000
20vorte_ai_tokens_total{provider="openai",type="completion"} 30000

Custom Metrics

get_data.py
python
Copied!
1from vorte.metrics import counter, histogram, gauge
2
3request_counter = counter(
4 name="my_app_requests",
5 description="Custom request counter",
6 labels=["endpoint", "method"],
7)
8
9request_duration = histogram(
10 name="my_app_duration_seconds",
11 description="Custom request duration",
12 labels=["endpoint"],
13)
14
15active_connections = gauge(
16 name="my_app_active_connections",
17 description="Active connections",
18)
19
20@router.get("/api/data")
21async def get_data():
22 request_counter.inc(endpoint="/api/data", method="GET")
23 with request_duration.time(endpoint="/api/data"):
24 data = await db.fetch_all("SELECT * FROM data")
25 return success_response(data=data)

Dashboard

terminal
bash
Copied!
1GET /dashboard

The admin dashboard provides a web interface for monitoring application health, viewing module states, inspecting logs, and managing configuration. It requires authentication by default.

example.py
python
Copied!
1app = Vorte(
2 auto_load=True,
3 config={
4 "builtins": {
5 "dashboard": True,
6 "dashboard_auth": True,
7 },
8 },
9)

Disabling Endpoints

example.py
python
Copied!
1app = Vorte(
2 auto_load=True,
3 config={
4 "builtins": {
5 "health": True,
6 "ready": True,
7 "live": True,
8 "info": False,
9 "metrics": False,
10 "dashboard": False,
11 },
12 },
13)
Stay in the loop

Get Vorte release notes, module guides, and developer deep-dives. No spam — unsubscribe anytime.