Expand description
openkind-api: HTTP and gRPC transport protocols, middleware, and SDK compatibility surface.
§Architecture & Responsibilities
openkind-api provides dual transport interfaces for openkind:
- HTTP/REST Transport (
http): Axum 0.8 router servingPOST /v1/systemone(canonical),POST /v1/system_one(SDK alias),GET /v1/models,GET /health, andGET /metrics.GET /playground(playground) serves an embedded web UI when the daemon opts in. - gRPC Transport (
grpc): Tonic 0.14 service implementingopenkind.SystemOne/Evaluate.
Both transports route evaluation requests through openkind_engine::dispatch, decoupling transport
encoding from inference backend execution.
§Middleware & Wire Compatibility
As specified in docs/ARCHITECTURE.md:
- Outermost Request ID layer stamps
x-typesafe-request-idon every response, including errors and 401s. - Constant-time Bearer token gate on
/v1/*routes whenOPENKIND_API_KEY(orTYPESAFE_API_KEY) is configured. - Error mapping with
Retry-Afterandretry-after-msheaders on rate limits (429) and overload (529).
Re-exports§
pub use arrow::arrow_batch;pub use arrow::ArrowBatchRequest;pub use arrow::ARROW_CONTENT_TYPE;pub use error::ApiError;pub use http::router;pub use http::router_daemon;pub use http::router_daemon_with_arrow;pub use http::router_with_auth;pub use http::router_with_state;pub use middleware::AuthConfig;pub use middleware::RateLimitConfig;pub use middleware::RateLimiter;pub use middleware::REQUEST_ID_HEADER;pub use proxy::ProxyOutcome;pub use proxy::ProxySource;pub use proxy::SystemProxy;
Modules§
- arrow
- Unofficial bulk Arrow IPC endpoint (
POST /v1/arrow, opt-in). Unofficial Arrow bulk endpoint:POST /v1/arrow. - error
- HTTP error mapping and Axum response conversion. API errors. Mapped to HTTP status codes per the Jev spec and the Python SDK exception taxonomy:
- grpc
- Tonic gRPC service implementation for
openkind.SystemOne. gRPC layer — tonic 0.14. - http
- Axum HTTP router and endpoint handlers. HTTP layer — axum 0.8.
- middleware
- Request ID, authentication, and rate limiting middleware. Cross-cutting middleware for the HTTP layer:
- models
- Model metadata structures and descriptors.
Re-export of the wire-shape model types so the API layer and the
rest of the workspace share one definition (in
openkind-core). - playground
- Embedded web playground served at
GET /playground(opt-in). Embedded web playground served atGET /playgroundwhen the daemon runs with--playground on. - proxy
- Optional proxy-cache hook consulted by the evaluation handlers. Optional proxy-cache hook for the evaluation handlers.
Structs§
- AppState
- Shared application state passed to every axum handler and tonic method.
- Model
Info - One entry in the
modelsarray. Fields are required and order-stable. - Models
Response - Top-level
GET /v1/modelsresponse.