Skip to main content

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.

MethodPathSummary
POST/v1/rust_control_plane/logsReplay 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.

Docs

Request body (application/json, schema CallbackLogsRequest):

FieldTypeRequiredDescription
recordsarray of CallbackLogRecordYesRecords

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:

StatusDescriptionBody
200Every record was handed to the callbacks, failures listed by positionapplication/json CallbackLogsResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy admin keyapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError

Response fields (200):

FieldTypeRequiredDescription
processedintegerYesProcessed
failedintegerYesFailed
failuresarray of CallbackLogFailureNoFailures