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

# Shrink Result

> **WARNING: This endpoint is not officially supported, and is subject to be changed or removed at any time.**

Shrinks the given result payload to git into a specified token budget.

This tries its best to keep around more important values and truncate less important ones.

The intent of this endpoint is that after executing an AI Action, you can pass the result into this to get a smaller result that can be passed in to LLMs without hitting the token limit.



## OpenAPI

````yaml post /api/v2/shrink-result/
openapi: 3.1.0
info:
  title: Zapier AI Actions API V2
  version: 1.0.0
  description: ''
servers:
  - url: https://actions.zapier.com
security: []
paths:
  /api/v2/shrink-result/:
    post:
      tags:
        - utilities
      summary: Shrink Result
      description: >-
        **WARNING: This endpoint is not officially supported, and is subject to
        be changed or removed at any time.**


        Shrinks the given result payload to git into a specified token budget.


        This tries its best to keep around more important values and truncate
        less important ones.


        The intent of this endpoint is that after executing an AI Action, you
        can pass the result into this to get a smaller result that can be passed
        in to LLMs without hitting the token limit.
      operationId: api_meta_shrink_result
      parameters:
        - in: query
          name: app
          schema:
            description: >-
              App to use when shrinking values. Providing an app, action, and
              action type will help with improving the accuracy of the
              shrinking.
            title: App
            type: string
          required: false
          description: >-
            App to use when shrinking values. Providing an app, action, and
            action type will help with improving the accuracy of the shrinking.
        - in: query
          name: action
          schema:
            description: >-
              Action to use when shrinking values. Must be provided if `app` is
              provided.
            title: Action
            type: string
          required: false
          description: >-
            Action to use when shrinking values. Must be provided if `app` is
            provided.
        - in: query
          name: action_type
          schema:
            description: >-
              Type of action to use when shrinking values. Must be provided if
              `action` is provided.
            title: Action Type
            type: string
          required: false
          description: >-
            Type of action to use when shrinking values. Must be provided if
            `action` is provided.
        - in: query
          name: keep
          schema:
            description: >-
              A comma-separate list of field names to keep around. Fields in
              this list will never be shrunken and will remain as-is in the
              response.
            title: Keep
            type: string
          required: false
          description: >-
            A comma-separate list of field names to keep around. Fields in this
            list will never be shrunken and will remain as-is in the response.
        - in: query
          name: token_budget
          schema:
            default: 1000
            description: >-
              Maximum number of
              [tokens](https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them)
              to include in the response.
            title: Token Budget
            type: integer
          required: false
          description: >-
            Maximum number of
            [tokens](https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them)
            to include in the response.
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/ResultToShrink'
              default:
                result: {}
                result_field_labels: {}
        required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShrinkResultResult'
      security:
        - AccessPointApiKeyHeader: []
        - AccessPointOAuth: []
components:
  schemas:
    ResultToShrink:
      additionalProperties: true
      properties:
        result:
          description: '`{key: value}` that is returned from an underlying API call.'
          title: Result
          type: object
        result_field_labels:
          description: '`{key: field_label}` that is returned from an execution.'
          title: Result Field Labels
          type: object
      required:
        - result
        - result_field_labels
      title: ResultToShrink
      type: object
    ShrinkResultResult:
      properties:
        shrunken_result:
          title: Shrunken Result
          type: object
      required:
        - shrunken_result
      title: ShrinkResultResult
      type: object
  securitySchemes:
    AccessPointApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
    AccessPointOAuth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: /oauth/authorize/
          tokenUrl: /oauth/token/
          scopes:
            nla:exposed_actions:execute: Run AI Actions
            openid: OpenID Connect scope

````