---
title: "Act Inference"
method: POST
path: "/api/v1/workspaces/{workspace_id}/act/inference"
---

# Act Inference

`POST /api/v1/workspaces/{workspace_id}/act/inference`

## Path parameters

- `workspace_id` string, uuid4, required

## Headers

- `x-real-ip` string, nullable
- `askui-user-agent` string, nullable
- `askui-installed-at` string, nullable
- `askui-user-id` string, nullable

## Request body

- ActInferenceRequestBody
  - `max_tokens` integer, required
  - `messages` BetaMessageParam[], required
    - `content` union, required
      - string
      - union[]
        - union
          - BetaTextBlockParam
            - `text` string, required
            - `type` 'text', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
            - `citations` union[], nullable
              - …
          - BetaImageBlockParam
            - `source` union, required
              - …
            - `type` 'image', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaRequestDocumentBlockParam
            - `source` union, required
              - …
            - `type` 'document', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
            - `citations` BetaCitationsConfigParam
              - …
            - `context` string, nullable
            - `title` string, nullable
          - BetaSearchResultBlockParam
            - `content` BetaTextBlockParam[], required
              - …
            - `source` string, required
            - `title` string, required
            - `type` 'search_result', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
            - `citations` BetaCitationsConfigParam
              - …
          - BetaThinkingBlockParam
            - `signature` string, required
            - `thinking` string, required
            - `type` 'thinking', required
          - BetaRedactedThinkingBlockParam
            - `data` string, required
            - `type` 'redacted_thinking', required
          - BetaToolUseBlockParam
            - `id` string, required
            - `input` unknown, required
            - `name` string, required
            - `type` 'tool_use', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaToolResultBlockParam
            - `tool_use_id` string, required
            - `type` 'tool_result', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
            - `content` union
              - …
            - `is_error` boolean
          - BetaServerToolUseBlockParam
            - `id` string, required
            - `input` unknown, required
            - `name` 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution', required
            - `type` 'server_tool_use', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaWebSearchToolResultBlockParam
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'web_search_tool_result', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaWebFetchToolResultBlockParam
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'web_fetch_tool_result', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaCodeExecutionToolResultBlockParam
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'code_execution_tool_result', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaBashCodeExecutionToolResultBlockParam
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'bash_code_execution_tool_result', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaTextEditorCodeExecutionToolResultBlockParam
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'text_editor_code_execution_tool_result', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaMCPToolUseBlockParam
            - `id` string, required
            - `input` unknown, required
            - `name` string, required
            - `server_name` string, required
            - `type` 'mcp_tool_use', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaRequestMCPToolResultBlockParam
            - `tool_use_id` string, required
            - `type` 'mcp_tool_result', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
            - `content` union
              - …
            - `is_error` boolean
          - BetaContainerUploadBlockParam
            - `file_id` string, required
            - `type` 'container_upload', required
            - `cache_control` BetaCacheControlEphemeralParam
              - …
          - BetaTextBlock
            - `citations` union[], nullable
              - …
            - `text` string, required
            - `type` 'text', required
          - BetaThinkingBlock
            - `signature` string, required
            - `thinking` string, required
            - `type` 'thinking', required
          - BetaRedactedThinkingBlock
            - `data` string, required
            - `type` 'redacted_thinking', required
          - BetaToolUseBlock
            - `id` string, required
            - `input` unknown, required
            - `name` string, required
            - `type` 'tool_use', required
          - BetaServerToolUseBlock
            - `id` string, required
            - `input` unknown, required
            - `name` 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution', required
            - `type` 'server_tool_use', required
          - BetaWebSearchToolResultBlock
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'web_search_tool_result', required
          - BetaWebFetchToolResultBlockInput
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'web_fetch_tool_result', required
          - BetaCodeExecutionToolResultBlockInput
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'code_execution_tool_result', required
          - BetaBashCodeExecutionToolResultBlockInput
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'bash_code_execution_tool_result', required
          - BetaTextEditorCodeExecutionToolResultBlock
            - `content` union, required
              - …
            - `tool_use_id` string, required
            - `type` 'text_editor_code_execution_tool_result', required
          - BetaMCPToolUseBlock
            - `id` string, required
            - `input` unknown, required
            - `name` string, required
            - `server_name` string, required
            - `type` 'mcp_tool_use', required
          - BetaMCPToolResultBlockInput
            - `content` union, required
              - …
            - `is_error` boolean, required
            - `tool_use_id` string, required
            - `type` 'mcp_tool_result', required
          - BetaContainerUploadBlock
            - `file_id` string, required
            - `type` 'container_upload', required
    - `role` 'user' | 'assistant', required
  - `model` union, required
    - 'anthropic-claude-3-5-sonnet-20241022' | 'claude-sonnet-4-20250514'
    - 'claude-opus-4@20250514' | 'claude-sonnet-4@20250514' | 'claude-3-7-sonnet@20250219' | 'claude-3-5-haiku@20241022' | 'claude-3-5-sonnet-v2@20241022' | 'claude-3-opus@20240229' | 'claude-3-sonnet@20240229' | 'claude-3-haiku@20240307'
    - string
  - `betas` union[]
    - union
      - string
      - 'message-batches-2024-09-24' | 'prompt-caching-2024-07-31' | 'computer-use-2024-10-22' | 'computer-use-2025-01-24' | 'pdfs-2024-09-25' | 'token-counting-2024-11-01' | 'token-efficient-tools-2025-02-19' | 'output-128k-2025-02-19' | 'files-api-2025-04-14' | 'mcp-client-2025-04-04' | 'dev-full-thinking-2025-05-14' | 'interleaved-thinking-2025-05-14' | 'code-execution-2025-05-22' | 'extended-cache-ttl-2025-04-11' | 'context-1m-2025-08-07'
  - `system` union
    - string
    - BetaTextBlockParam[]
      - `text` string, required
      - `type` 'text', required
      - `cache_control` BetaCacheControlEphemeralParam
        - `type` 'ephemeral', required
        - `ttl` '5m' | '1h'
      - `citations` union[], nullable
        - union
          - BetaCitationCharLocationParam
            - `cited_text` string, required
            - `document_index` integer, required
            - `document_title` string, nullable, required
            - `end_char_index` integer, required
            - `start_char_index` integer, required
            - `type` 'char_location', required
          - BetaCitationPageLocationParam
            - `cited_text` string, required
            - `document_index` integer, required
            - `document_title` string, nullable, required
            - `end_page_number` integer, required
            - `start_page_number` integer, required
            - `type` 'page_location', required
          - BetaCitationContentBlockLocationParam
            - `cited_text` string, required
            - `document_index` integer, required
            - `document_title` string, nullable, required
            - `end_block_index` integer, required
            - `start_block_index` integer, required
            - `type` 'content_block_location', required
          - BetaCitationWebSearchResultLocationParam
            - `cited_text` string, required
            - `encrypted_index` string, required
            - `title` string, nullable, required
            - `type` 'web_search_result_location', required
            - `url` string, required
          - BetaCitationSearchResultLocationParam
            - `cited_text` string, required
            - `end_block_index` integer, required
            - `search_result_index` integer, required
            - `source` string, required
            - `start_block_index` integer, required
            - `title` string, nullable, required
            - `type` 'search_result_location', required
    - NotGiven
  - `thinking` union
    - BetaThinkingConfigEnabledParam
      - `budget_tokens` integer, required
      - `type` 'enabled', required
    - BetaThinkingConfigDisabledParam
      - `type` 'disabled', required
    - NotGiven
  - `tools` union
    - union[]
      - union
        - BetaToolParam
          - `input_schema` union, required
            - InputSchemaTyped
              - …
            - object
          - `name` string, required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
          - `description` string
          - `type` 'custom', nullable
        - BetaToolBash20241022Param
          - `name` 'bash', required
          - `type` 'bash_20241022', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
        - BetaToolBash20250124Param
          - `name` 'bash', required
          - `type` 'bash_20250124', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
        - BetaCodeExecutionTool20250522Param
          - `name` 'code_execution', required
          - `type` 'code_execution_20250522', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
        - BetaCodeExecutionTool20250825Param
          - `name` 'code_execution', required
          - `type` 'code_execution_20250825', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
        - BetaToolComputerUse20241022Param
          - `display_height_px` integer, required
          - `display_width_px` integer, required
          - `name` 'computer', required
          - `type` 'computer_20241022', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
          - `display_number` integer, nullable
        - BetaToolComputerUse20250124Param
          - `display_height_px` integer, required
          - `display_width_px` integer, required
          - `name` 'computer', required
          - `type` 'computer_20250124', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
          - `display_number` integer, nullable
        - BetaToolTextEditor20241022Param
          - `name` 'str_replace_editor', required
          - `type` 'text_editor_20241022', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
        - BetaToolTextEditor20250124Param
          - `name` 'str_replace_editor', required
          - `type` 'text_editor_20250124', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
        - BetaToolTextEditor20250429Param
          - `name` 'str_replace_based_edit_tool', required
          - `type` 'text_editor_20250429', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
        - BetaToolTextEditor20250728Param
          - `name` 'str_replace_based_edit_tool', required
          - `type` 'text_editor_20250728', required
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
          - `max_characters` integer, nullable
        - BetaWebSearchTool20250305Param
          - `name` 'web_search', required
          - `type` 'web_search_20250305', required
          - `allowed_domains` string[], nullable
          - `blocked_domains` string[], nullable
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
          - `max_uses` integer, nullable
          - `user_location` UserLocation
            - `type` 'approximate', required
            - `city` string, nullable
            - `country` string, nullable
            - `region` string, nullable
            - `timezone` string, nullable
        - BetaWebFetchTool20250910Param
          - `name` 'web_fetch', required
          - `type` 'web_fetch_20250910', required
          - `allowed_domains` string[], nullable
          - `blocked_domains` string[], nullable
          - `cache_control` BetaCacheControlEphemeralParam
            - `type` 'ephemeral', required
            - `ttl` '5m' | '1h'
          - `citations` BetaCitationsConfigParam
            - `enabled` boolean
          - `max_content_tokens` integer, nullable
          - `max_uses` integer, nullable
    - NotGiven
  - `tool_choice` union
    - BetaToolChoiceAutoParam
      - `type` 'auto', required
      - `disable_parallel_tool_use` boolean
    - BetaToolChoiceAnyParam
      - `type` 'any', required
      - `disable_parallel_tool_use` boolean
    - BetaToolChoiceToolParam
      - `name` string, required
      - `type` 'tool', required
      - `disable_parallel_tool_use` boolean
    - BetaToolChoiceNoneParam
      - `type` 'none', required
    - NotGiven

## Response `200`

Successful Response

- BetaMessage
  - `id` string, required
  - `container` BetaContainer
    - `id` string, required
    - `expires_at` string, date-time, required
  - `content` union[], required
    - union
      - BetaTextBlock
        - `citations` union[], nullable
          - union
            - BetaCitationCharLocation
              - …
            - BetaCitationPageLocation
              - …
            - BetaCitationContentBlockLocation
              - …
            - BetaCitationsWebSearchResultLocation
              - …
            - BetaCitationSearchResultLocation
              - …
        - `text` string, required
        - `type` 'text', required
      - BetaThinkingBlock
        - `signature` string, required
        - `thinking` string, required
        - `type` 'thinking', required
      - BetaRedactedThinkingBlock
        - `data` string, required
        - `type` 'redacted_thinking', required
      - BetaToolUseBlock
        - `id` string, required
        - `input` unknown, required
        - `name` string, required
        - `type` 'tool_use', required
      - BetaServerToolUseBlock
        - `id` string, required
        - `input` unknown, required
        - `name` 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution', required
        - `type` 'server_tool_use', required
      - BetaWebSearchToolResultBlock
        - `content` union, required
          - BetaWebSearchToolResultError
            - `error_code` 'invalid_tool_input' | 'unavailable' | 'max_uses_exceeded' | 'too_many_requests' | 'query_too_long', required
            - `type` 'web_search_tool_result_error', required
          - BetaWebSearchResultBlock[]
            - `encrypted_content` string, required
            - `page_age` string, nullable
            - `title` string, required
            - `type` 'web_search_result', required
            - `url` string, required
        - `tool_use_id` string, required
        - `type` 'web_search_tool_result', required
      - BetaWebFetchToolResultBlockOutput
        - `content` union, required
          - BetaWebFetchToolResultErrorBlock
            - `error_code` 'invalid_tool_input' | 'url_too_long' | 'url_not_allowed' | 'url_not_accessible' | 'unsupported_content_type' | 'too_many_requests' | 'max_uses_exceeded' | 'unavailable', required
            - `type` 'web_fetch_tool_result_error', required
          - BetaWebFetchBlockOutput
            - `content` BetaDocumentBlock, required
              - …
            - `retrieved_at` string, nullable
            - `type` 'web_fetch_result', required
            - `url` string, required
        - `tool_use_id` string, required
        - `type` 'web_fetch_tool_result', required
      - BetaCodeExecutionToolResultBlockOutput
        - `content` union, required
          - BetaCodeExecutionToolResultError
            - `error_code` 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded', required
            - `type` 'code_execution_tool_result_error', required
          - BetaCodeExecutionResultBlock
            - `content` BetaCodeExecutionOutputBlock[], required
              - …
            - `return_code` integer, required
            - `stderr` string, required
            - `stdout` string, required
            - `type` 'code_execution_result', required
        - `tool_use_id` string, required
        - `type` 'code_execution_tool_result', required
      - BetaBashCodeExecutionToolResultBlockOutput
        - `content` union, required
          - BetaBashCodeExecutionToolResultError
            - `error_code` 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded' | 'output_file_too_large', required
            - `type` 'bash_code_execution_tool_result_error', required
          - BetaBashCodeExecutionResultBlock
            - `content` BetaBashCodeExecutionOutputBlock[], required
              - …
            - `return_code` integer, required
            - `stderr` string, required
            - `stdout` string, required
            - `type` 'bash_code_execution_result', required
        - `tool_use_id` string, required
        - `type` 'bash_code_execution_tool_result', required
      - BetaTextEditorCodeExecutionToolResultBlock
        - `content` union, required
          - BetaTextEditorCodeExecutionToolResultError
            - `error_code` 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded' | 'file_not_found', required
            - `error_message` string, nullable
            - `type` 'text_editor_code_execution_tool_result_error', required
          - BetaTextEditorCodeExecutionViewResultBlock
            - `content` string, required
            - `file_type` 'text' | 'image' | 'pdf', required
            - `num_lines` integer, nullable
            - `start_line` integer, nullable
            - `total_lines` integer, nullable
            - `type` 'text_editor_code_execution_view_result', required
          - BetaTextEditorCodeExecutionCreateResultBlock
            - `is_file_update` boolean, required
            - `type` 'text_editor_code_execution_create_result', required
          - BetaTextEditorCodeExecutionStrReplaceResultBlock
            - `lines` string[], nullable
            - `new_lines` integer, nullable
            - `new_start` integer, nullable
            - `old_lines` integer, nullable
            - `old_start` integer, nullable
            - `type` 'text_editor_code_execution_str_replace_result', required
        - `tool_use_id` string, required
        - `type` 'text_editor_code_execution_tool_result', required
      - BetaMCPToolUseBlock
        - `id` string, required
        - `input` unknown, required
        - `name` string, required
        - `server_name` string, required
        - `type` 'mcp_tool_use', required
      - BetaMCPToolResultBlockOutput
        - `content` union, required
          - string
          - BetaTextBlock[]
            - `citations` union[], nullable
              - …
            - `text` string, required
            - `type` 'text', required
        - `is_error` boolean, required
        - `tool_use_id` string, required
        - `type` 'mcp_tool_result', required
      - BetaContainerUploadBlock
        - `file_id` string, required
        - `type` 'container_upload', required
  - `model` union, required
    - 'claude-3-7-sonnet-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-0' | 'claude-4-sonnet-20250514' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-4-opus-20250514' | 'claude-opus-4-1-20250805' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-haiku-20240307'
    - string
  - `role` 'assistant', required
  - `stop_reason` 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | 'pause_turn' | 'refusal', nullable
  - `stop_sequence` string, nullable
  - `type` 'message', required
  - `usage` BetaUsage, required
    - `cache_creation` BetaCacheCreation
      - `ephemeral_1h_input_tokens` integer, required
      - `ephemeral_5m_input_tokens` integer, required
    - `cache_creation_input_tokens` integer, nullable
    - `cache_read_input_tokens` integer, nullable
    - `input_tokens` integer, required
    - `output_tokens` integer, required
    - `server_tool_use` BetaServerToolUsage
      - `web_fetch_requests` integer, required
      - `web_search_requests` integer, required
    - `service_tier` 'standard' | 'priority' | 'batch', nullable

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Validation Error
- `503` — Service Unavailable

---

[API](https://skmtc.dev/askui/apis/askui-inference-api.md) · [All operations](https://skmtc.dev/askui/apis/askui-inference-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/askui/askui-inference-api/revisions/0f3efe985ebb/schema)
