akribes-sdk
Async Rust client for the Akribes workflow server.
Akribes is a domain-specific language and execution platform for AI workflows — multi-agent, multi-step processes with type-checked inputs, structured outputs, and a real-time event stream. This crate is the typed client SDK; you author .akr workflows and the server runs them.
Install
[]
= "0.21"
= { = "1", = ["full"] }
Or with cargo add:
Quickstart
use AkribesClient;
async
Streaming events
Workflows emit a typed EngineEvent stream — task starts/ends, agent token chunks, validation failures, tool calls, MCP server lifecycle, suspensions, checkpoints. Subscribe with run_stream:
use ;
use StreamExt;
# async
Document ingest
# use AkribesClient;
# async
Error handling
The SDK surfaces typed errors via [AkribesError]:
Auth— 401 / 403NotFound— 404RateLimit— 429 (respectsRetry-After)Transient— 502 / 503 / 504 (retried by the SDK's default policy)Script— workflow failed; carrieserror_kind+execution_idTimeout— request deadline exceededOther— anything else (with the wire payload attached)
Authentication
Two token shapes are accepted:
- Service tokens — long-lived, configured server-side as
AKRIBES_SERVICE_TOKEN_<NAME>=<scope>:<secret>. Suitable for trusted backends. - Scoped tokens —
akribes_tk_...(legacyaura_tk_...still accepted) minted by a service token viaclient.tokens().mint(...). Suitable for browsers, CLIs, and read-only shares.
Prefer Authorization: Bearer over ?token=…
The Rust SDK always ships the bearer token in the Authorization
header on every HTTP call and on its WebSocket upgrade — the only
recommended path for non-browser callers. The server's ?token=…
query-string fallback exists exclusively for browser EventSource
/ WebSocket clients that cannot set arbitrary headers. Avoid the
query form from CLIs, agents, and backends: reverse-proxy access
logs, CI job traces, and Referer headers all routinely capture
query strings and would leak the token. The server stamps
X-Token-Source: query-param on responses to query-string requests
so operators can chart adoption away from the query fallback.
See https://akribes.ai/deployment/authentication/ for the full model.
Crate layout
| Crate | Role |
|---|---|
akribes-sdk |
The async HTTP client. Most users want this. |
akribes-types |
Wire-level types (events, values, errors). Re-exported by the SDK; use it directly if you're building an alternate transport or telemetry consumer. |
Links
- SDK guide: https://akribes.ai/sdks/rust/
- Language guide: https://akribes.ai/language/overview/
- Source mirror: https://github.com/PodestaAI/akribes-sdks
License
MIT. See LICENSE.