Rust control plane API
This page documents the 1 gateway endpoint tagged rust control plane in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.
| Method | Path | Summary |
|---|---|---|
| POST | /v1/rust_control_plane/logs | Replay finished request logs from the data plane |
Endpoints
POST /v1/rust_control_plane/logs
Replay finished request logs from the data plane
Take a batch of finished request logs produced outside the Python process, for example by the compiled data plane, and run each through the gateway's success or failure callbacks as if the request had been served here, so spend logs, alerts and logging integrations see it. Records are replayed one by one and a failing record is reported by its position without stopping the batch. Proxy admin only, because the payloads write spend.
Request body (application/json, schema CallbackLogsRequest):
| Field | Type | Required | Description |
|---|---|---|---|
records | array of CallbackLogRecord | Yes | Records |
Example request:
curl -X POST "http://localhost:4000/v1/rust_control_plane/logs" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"records": [
{
"status": "success",
"standard_logging_payload": {
"id": "chatcmpl-8f2c1a7e",
"call_type": "acompletion",
"model": "gpt-5.5",
"startTime": 1763712000,
"endTime": 1763712001.2,
"response_cost": 0.00042,
"prompt_tokens": 120,
"completion_tokens": 40
}
}
]
}'
Responses:
| Status | Description | Body |
|---|---|---|
| 200 | Every record was handed to the callbacks, failures listed by position | application/json CallbackLogsResponse |
| 401 | No valid key or Admin UI session was presented | application/json ProxyError |
| 403 | The key is not a proxy admin key | application/json ErrorDetail |
| 422 | Validation Error | application/json HTTPValidationError |
Response fields (200):
| Field | Type | Required | Description |
|---|---|---|---|
processed | integer | Yes | Processed |
failed | integer | Yes | Failed |
failures | array of CallbackLogFailure | No | Failures |