---
title: "Reduce Action"
method: POST
path: "/v1/actions/reduce"
tags: ["agent-cost"]
---

# Reduce Action

`POST /v1/actions/reduce`

Reduce one eligible tool result without retaining its content.

## Request body

- ActionEnvelope
  - `id` string, required
  - `session_id` string
  - `harness` string
  - `provider` string
  - `model` string
  - `kind` 'unknown' | 'log' | 'test_build_lint' | 'search' | 'file_list' | 'document_read' | 'agent_handoff' | 'query' | 'verbatim', required
  - `tool` ToolCall, required
    - `id` string
    - `name` string, required
    - `arguments` unknown
  - `result` string, required
  - `task` string
  - `intent` string
  - `retrieval_handle` string
  - `client_version` string

## Response `200`

Successful Response

- ActionResponse
  - `action_id` string, required
  - `kind` 'unknown' | 'log' | 'test_build_lint' | 'search' | 'file_list' | 'document_read' | 'agent_handoff' | 'query' | 'verbatim', required
  - `decision` 'passthrough' | 'reduced', required
  - `content` string
  - `reason` string
  - `selectors` Selector[]
    - `id` string, required
    - `label` string
    - `type` 'lines' | 'json_path' | 'group', required
    - `start` integer
    - `end` integer
    - `json_path` string
    - `group` string
  - `usage` ActionUsage, required
    - `bytes_in` integer, required
    - `bytes_out` integer, required
    - `reducer_input_tokens` integer
    - `reducer_output_tokens` integer
    - `reducer_cost_microusd` integer
    - `elapsed_ms` integer

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/codag/apis/infra-logs-templater.md) · [All operations](https://skmtc.net/codag/apis/infra-logs-templater/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/codag/infra-logs-templater/revisions/d80008a9efc6/schema)
