> ## Documentation Index
> Fetch the complete documentation index at: https://docs.strait.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Agents

> Build and orchestrate AI agent workflows with cost tracking, tool call management, and multi-step pipelines.

Strait provides purpose-built primitives for orchestrating AI agents as background jobs. Track costs, manage tool calls, checkpoint agent state, and build multi-step agent pipelines with the same reliability guarantees as any other Strait workflow.

## Key Capabilities

<CardGroup cols={2}>
  <Card title="Cost Budgets" icon="dollar-sign" href="/concepts/cost-budgets">
    Set per-run spending limits. Strait tracks token usage and halts execution when budgets are exceeded.
  </Card>

  <Card title="Tool Call Tracking" icon="wrench">
    Log every tool call an agent makes with input/output capture and latency metrics.
  </Card>

  <Card title="Checkpoints" icon="bookmark">
    Save agent state at any point. Resume from the last checkpoint on failure instead of restarting.
  </Card>

  <Card title="Child Job Spawning" icon="code-branch">
    Agents can spawn sub-jobs dynamically, enabling recursive and parallel agent patterns.
  </Card>
</CardGroup>

## How It Works

1. Define an agent job with a cost budget and tool definitions
2. The agent runs as a standard Strait job with retries and timeout protection
3. Tool calls are logged via the SDK's `toolCall` endpoint
4. Token usage is tracked via the `usage` endpoint
5. If the cost budget is exceeded, the run is automatically failed with a clear error

## SDK Support

All five SDKs (TypeScript, Python, Go, Ruby, Rust) support agent-specific endpoints:

* `sdk/v1/runs/{runID}/tool-call` -- Log a tool call
* `sdk/v1/runs/{runID}/usage` -- Report token/cost usage
* `sdk/v1/runs/{runID}/checkpoint` -- Save agent state
* `sdk/v1/runs/{runID}/spawn` -- Spawn a child job
* `sdk/v1/runs/{runID}/continue` -- Continue from checkpoint
