Runtime HTTP API (v0)
Human-oriented runtime API guide.
Machine contract authority:
- OpenAPI:
schemas/http/runtime-http.openapi.v0.yaml - Contract examples:
tests/contracts/runtime-http/examples/ - Baseline:
docs/contracts/runtime-http-baseline.md
Use this file for operational semantics and practical examples.
Transport
- Base URL default:
http://127.0.0.1:8080 - JSON content type:
application/json - API prefix:
/v0 - No auth model in v0
CORS behavior comes from runtime config (http.cors_*).
Common Response Envelope
All JSON responses include status:
json
{
"status": {
"code": "OK",
"message": "ok"
}
}Common status-code mapping:
| Code | HTTP |
|---|---|
OK | 200 |
INVALID_ARGUMENT | 400 |
NOT_FOUND | 404 |
FAILED_PRECONDITION | 409 |
UNAVAILABLE | 503 |
DEADLINE_EXCEEDED | 504 |
INTERNAL | 500 |
Endpoint Map
Runtime and provider status
GET /v0/runtime/status- high-level runtime/provider summary.GET /v0/providers/health- per-provider lifecycle/supervision and device health.
Discovery and capabilities
GET /v0/devicesGET /v0/devices/{provider_id}/{device_id}/capabilities
State reads
GET /v0/stateGET /v0/state/{provider_id}/{device_id}(supports repeatedsignal_idfilters)
Control
POST /v0/call
Notes:
- Request currently requires
function_id. - Args use typed ADPP value encoding.
Automation and parameters
GET /v0/modePOST /v0/modeGET /v0/parametersPOST /v0/parametersGET /v0/automation/treeGET /v0/automation/status
Streaming
GET /v0/events(SSE)
Optional query filters:
provider_iddevice_idsignal_id
Current event names:
state_updatequality_changedevice_availabilitymode_changeparameter_changebt_errorprovider_health_change
Typed Value Encoding
ADPP value payload format:
| Type | Example |
|---|---|
double | {"type":"double","double":1.23} |
int64 | {"type":"int64","int64":-42} |
uint64 | {"type":"uint64","uint64":42} |
bool | {"type":"bool","bool":true} |
string | {"type":"string","string":"AUTO"} |
bytes | {"type":"bytes","base64":"AAECAw=="} |
Quality Semantics
Signal quality values:
OKSTALEUNAVAILABLEFAULT
Device-level quality is computed as worst signal quality.
Practical Examples
Runtime status
bash
curl -s http://127.0.0.1:8080/v0/runtime/status | jqProviders health
bash
curl -s http://127.0.0.1:8080/v0/providers/health | jqDevices + capabilities
bash
curl -s http://127.0.0.1:8080/v0/devices | jq
curl -s http://127.0.0.1:8080/v0/devices/sim0/motorctl0/capabilities | jqState
bash
curl -s http://127.0.0.1:8080/v0/state | jq
curl -s "http://127.0.0.1:8080/v0/state/sim0/motorctl0?signal_id=motor1_duty" | jqCall device function
bash
curl -s -X POST http://127.0.0.1:8080/v0/call \
-H "Content-Type: application/json" \
-d '{
"provider_id": "sim0",
"device_id": "motorctl0",
"function_id": 10,
"args": {
"motor_index": {"type": "int64", "int64": 1},
"duty": {"type": "double", "double": 0.75}
}
}' | jqMode and parameters
bash
curl -s http://127.0.0.1:8080/v0/mode | jq
curl -s -X POST http://127.0.0.1:8080/v0/mode \
-H "Content-Type: application/json" \
-d '{"mode":"MANUAL"}' | jq
curl -s http://127.0.0.1:8080/v0/parameters | jq
curl -s -X POST http://127.0.0.1:8080/v0/parameters \
-H "Content-Type: application/json" \
-d '{"name":"temp_setpoint","value":30.0}' | jqSSE stream
bash
curl -N http://127.0.0.1:8080/v0/eventsError Payload
Example:
json
{
"status": {
"code": "NOT_FOUND",
"message": "Device not found: sim0/nonexistent"
}
}Related
docs/http/README.md- HTTP contract validation workflow.tests/contracts/runtime-http/examples/manifest.yaml- fixture inventory.
