---
title: Anthropic API Integration on Truto
slug: anthropic
category: Conversational Intelligence
canonical: "https://truto.one/integrations/detail/anthropic/"
---

# Anthropic API Integration on Truto



**Category:** Conversational Intelligence  
**Status:** Generally available

## Unified APIs

### Unified User Directory API

- **Roles** — The Role object represents a role of a User.
- **Users** — The User object represents a User.
- **Workspaces** — Workspaces represent concepts like teams, workspaces, projects in apps that support them

## MCP-ready AI tools

Truto exposes 44 tools for Anthropic that AI agents can call directly.

- **list_all_anthropic_users** — List users in Anthropic. Returns id, name, email, role, type, and added_at for each user. Also includes first_id, last_id, and has_more for pagination.
- **get_single_anthropic_user_by_id** — Get details of a specific user in Anthropic. Requires id. Returns added_at (when user joined), email, id, name, role, and type (always 'user').
- **update_a_anthropic_user_by_id** — Update user role in Anthropic. Requires id. Returns added_at (when user joined), email (user email), id (user identifier), name (user name), role (organization role), and type (always 'user').
- **delete_a_anthropic_user_by_id** — Delete a user in Anthropic. Requires id. Returns id of the deleted user and type confirming deletion as user_deleted.
- **list_all_anthropic_me** — This endpoint retrieves a list of all users in the organization. It provides details such as user IDs, names, email addresses, roles, and types for every member of the organization
- **list_all_anthropic_workspaces** — List workspaces in Anthropic. Returns id, name, display_color, created_at, archived_at, and type for each workspace, along with pagination fields first_id, last_id, and has_more.
- **get_single_anthropic_workspace_by_id** — Get a workspace in Anthropic using id. Returns id, name, display_color, created_at, archived_at, and type fields in the response.
- **create_a_anthropic_workspace** — Create a workspace in Anthropic. Requires name. Returns id, name, created_at, archived_at, display_color, and type fields in the response.
- **update_a_anthropic_workspace_by_id** — Update a workspace in Anthropic using id. Returns archived_at (when workspace was archived), created_at (when workspace was created), display_color (workspace color in console), id (workspace identifier), name (workspace name), and type (always workspace).
- **anthropic_workspaces_archive** — Archive a workspace in Anthropic. Requires id. Returns archived_at (when the workspace was archived), created_at, display_color, id, name, and type.
- **list_all_anthropic_workspace_members** — List workspace_members in Anthropic. Requires workspace_id. Returns type, user_id, workspace_id, and workspace_role for each member along with pagination fields first_id, last_id, and has_more.
- **get_single_anthropic_workspace_member_by_id** — Get a workspace member in Anthropic. Requires workspace_id and id. Returns type (always workspace_member), user_id (the user identifier), workspace_id (the workspace identifier), and workspace_role (member role).
- **create_a_anthropic_workspace_member** — Create a workspace member in Anthropic. Requires workspace_id, user_id, and workspace_role. Returns type (always workspace_member), user_id, workspace_id, and workspace_role of the created member.
- **update_a_anthropic_workspace_member_by_id** — Update a workspace member in Anthropic. Requires workspace_id and id. Returns type (always workspace_member), user_id, workspace_id, and workspace_role indicating the updated role.
- **delete_a_anthropic_workspace_member_by_id** — Delete a specific workspace member in Anthropic. Requires workspace_id and id. Returns type confirming deletion as workspace_member_deleted, user_id of the member removed, and workspace_id where the deletion occurred.
- **list_all_anthropic_organization** — Get details about the authenticated organization in Anthropic. Returns id (organization identifier), name (organization name), and type (always 'organization').
- **list_all_anthropic_organizations_invites** — List invites in Anthropic. Returns id, email, invited_at, expires_at, role, status, and type for each invite. Also returns pagination fields first_id, last_id, and has_more.
- **get_single_anthropic_organizations_invite_by_id** — Get a specific invite in Anthropic. Requires id. Returns email of invited user, role assigned, status of the invite, when it was created (invited_at), when it expires (expires_at), and type (always 'invite').
- **create_a_anthropic_organizations_invite** — Create an invite in Anthropic. Requires email and role. Returns id, email, role, status, invited_at, expires_at, and type fields in the response.
- **delete_a_anthropic_organizations_invite_by_id** — Delete an invite in Anthropic. Requires id. Returns id of the deleted invite and type confirming invite_deleted.
- **list_all_anthropic_api_keys** — List API keys in Anthropic. Returns id, name, created_at, created_by, status, partial_key_hint, workspace_id, and type for each API key.
- **get_single_anthropic_api_key_by_id** — Get details of a specific API key in Anthropic using id. Returns id, name, status, created_at, created_by, partial_key_hint, type, and workspace_id.
- **update_a_anthropic_api_key_by_id** — Update an API key in Anthropic. Requires id. Returns created_at (creation time), created_by (actor details), id (API key identifier), name (API key name), partial_key_hint (redacted hint), status (active/inactive/archived), type (always api_key), and workspace_id (associated workspace).
- **list_all_anthropic_message_usage_report** — Get message usage report in Anthropic. Requires starting_at. Returns time bucketed data with fields: starting_at, ending_at, uncached_input_tokens, cache_creation, cache_read_input_tokens, output_tokens, server_tool_use, api_key_id, workspace_id, model, service_tier, and context_window.
- **list_all_anthropic_cost_report** — Get cost report in Anthropic. Requires starting_at. Returns time buckets with starting_at, ending_at, and results containing currency, amount, workspace_id, description, cost_type, context_window, model, service_tier, and token_type. Also returns has_more and next_page for pagination.
- **list_all_anthropic_claude_code_usage_report** — Get the Claude Code usage report in Anthropic for a specific date using starting_at. Returns usage metrics including actor, core_metrics (commits, lines_of_code, sessions, pull_requests), model_breakdown with tokens and estimated_cost, organization_id, subscription_type, terminal_type, and tool_actions.
- **create_a_anthropic_generate_prompt** — Generate a prompt in Anthropic by providing task. Returns messages containing generated prompt text for use with the Messages API, system placeholder, and usage details including input_tokens and output_tokens.
- **create_a_anthropic_improve_prompt** — Create an improved prompt in Anthropic using messages as input. Returns messages containing the improved prompt text and optionally an assistant prefill, system as an empty string, and usage with input_tokens and output_tokens.
- **create_a_anthropic_templatize_prompt** — Templatize a prompt in Anthropic by extracting variables from messages and system input. Returns messages with variables replaced, system prompt with placeholders, variable_values mapping original inputs, and usage with token counts.
- **create_a_anthropic_message** — Create a new message in Anthropic. Requires model, messages, and max_tokens. Returns id (unique identifier), role (assistant), content (generated text or tool use), model, stop_reason, stop_sequence, usage (token counts), and container details.
- **anthropic_messages_count_tokens** — Count tokens in messages in Anthropic. Requires messages and model. Returns input_tokens representing the total number of tokens across messages, system prompt, and tools.
- **list_all_anthropic_models** — List available models in Anthropic. Returns id (unique model identifier), display_name (human-readable name), created_at (release time), and type (always 'model').
- **get_single_anthropic_model_by_id** — Get a specific model in Anthropic using id. Returns created_at (release date), display_name (human-readable name), id (model identifier), and type (always 'model').
- **list_all_anthropic_message_batches** — List all message batches in Anthropic. Returns id, created_at, processing_status, request_counts, results_url, and timing fields for each batch. Batches are returned with the most recently created first.
- **get_single_anthropic_message_batch_by_id** — Get details of a specific message-batch in Anthropic using id. Returns timestamps (created_at, ended_at, expires_at, archived_at, cancel_initiated_at), processing_status, request_counts for requests, results_url to fetch processed results, and type.
- **create_a_anthropic_message_batch** — Create a Message Batch in Anthropic. Requires requests array with individual message request parameters. Returns id, created_at, processing_status, request_counts, results_url, and other timestamps for tracking batch processing.
- **delete_a_anthropic_message_batch_by_id** — Delete a specific message-batch in Anthropic. Requires id. Only finished batches can be deleted; in-progress batches must be canceled first. Returns id of the deleted batch and type confirming deletion.
- **anthropic_message_batches_cancel** — Cancel a message batch in Anthropic. Requires id. Returns id, processing_status, request_counts with tallies of canceled, succeeded, errored, expired, and processing requests, along with created_at, cancel_initiated_at, ended_at, expires_at, archived_at, results_url, and type. Cancellation is only effective before processing ends, and non-interruptible requests may still complete.
- **anthropic_message_batches_results** — Get results of a specific message-batch in Anthropic. Requires id. Response returns each request's custom_id and result, where result can include a succeeded message with fields such as content, model, usage, and stop_reason, or error/cancellation details.
- **list_all_anthropic_files** — List files in Anthropic. Returns created_at (creation time), id (file identifier), filename, mime_type, size_bytes, type (always 'file'), and downloadable status for each file.
- **get_single_anthropic_file_by_id** — Get metadata for a specific file in Anthropic using id. Returns created_at (file creation time), filename (original uploaded name), id (unique identifier), mime_type (file type), size_bytes (file size), downloadable (if file can be retrieved), and type (always 'file').
- **create_a_anthropic_file** — Create a file in Anthropic by uploading a binary file. Requires a multipart form-data request with file. Returns id, filename, mime_type, size_bytes, created_at, type, and whether the file is downloadable.
- **delete_a_anthropic_file_by_id** — Delete a file in Anthropic by id. Returns id of the deleted file and type confirming deletion (file_deleted).
- **anthropic_files_download** — Download the contents of a specific file in Anthropic. Requires id. Returns the raw file content as binary data.

## How it works

1. **Link your customer's Anthropic account.** Use Truto's frontend SDK; we handle every OAuth and API key flow so you don't need to create the OAuth app.
2. **Authentication is automatic.** Truto refreshes tokens, stores credentials securely, and injects them into every API request.
3. **Call Truto's API to reach Anthropic.** The Proxy API is a 1-to-1 mapping of the Anthropic API.
4. **Get a unified response format.** Every response uses a single shape, with cursor-based pagination and data in the `result` field.

## Use cases

- **Multi-Tenant AI Workspace Provisioning** — SaaS platforms can automatically create and manage isolated Anthropic workspaces per customer, syncing their internal RBAC with Anthropic's workspace members to ensure data isolation, separate rate limits, and per-tenant billing attribution.
- **Cost-Controlled AI Feature Embedding** — SaaS companies offering AI-powered features need to track and throttle token spend per customer to maintain unit economics. By pulling usage and cost reports segmented by workspace and API key, platforms can implement metered billing and spending guardrails for their end users.
- **Asynchronous Bulk Document Processing** — Platforms handling high-volume document workflows — contract review, data enrichment, content generation — can leverage Anthropic's message batch and file APIs to process thousands of items overnight at reduced cost, delivering results to end users by morning.
- **Embedded Prompt Engineering for Non-Technical Users** — SaaS products can surface Anthropic's prompt generation, improvement, and templatization capabilities directly in their UI, allowing end users to create production-quality prompts without AI expertise — reducing support burden and improving output consistency.
- **Unified User Directory Sync for AI Governance** — Enterprise SaaS platforms need to keep their user directories in sync with Anthropic's organization members and workspace assignments. Truto's Unified User Directory API enables automated provisioning and deprovisioning as team members join or leave.

## What you can build

- **Per-Customer AI Cost Dashboard** — Pull message usage reports and cost reports by workspace and API key to build a real-time dashboard showing token consumption and spend per tenant, enabling usage-based billing pass-through.
- **Automated Workspace & Member Lifecycle Management** — Automatically create Anthropic workspaces when new customers onboard, provision workspace members with appropriate roles, and archive workspaces or remove members on churn — all synced via Truto's Unified User Directory API.
- **Drag-and-Drop Document Intelligence Pipeline** — Let end users upload PDFs and datasets via your UI, use the files API to pass them to Claude, and return structured extracted data like invoice line items, contract clauses, or compliance findings.
- **Overnight Batch Processing Engine** — Queue thousands of message requests into Anthropic message batches, monitor batch status, and retrieve results asynchronously — ideal for bulk CRM enrichment, sentiment analysis, or content generation at discounted compute costs.
- **Self-Service Prompt Optimizer** — Embed prompt improvement and templatization directly into your product so end users can paste a rough instruction and receive an optimized, parameterized prompt ready for automated workflows.
- **API Key & Organization Invite Management Console** — Build an admin panel where customers can view their active API keys, manage organization invites, and audit workspace membership — all without leaving your application.

## FAQs

### What authentication method does the Anthropic integration use?

Anthropic uses API key-based authentication. End users connect their Anthropic account by providing their API key through Truto, which securely manages the credential for all subsequent API calls.

### Can I track AI costs per customer or workspace?

Yes. The integration supports listing message usage reports, cost reports, and Claude Code usage reports. These can be segmented by workspace ID and API key ID, enabling precise per-tenant cost attribution and billing pass-through.

### What Unified APIs does this integration support?

The Anthropic integration maps to Truto's Unified User Directory API, covering Users (list, get, update, delete), Workspaces (list, get, create, update, archive), and Workspace Members (full CRUD with role management).

### Does the integration support batch message processing?

Yes. You can create message batches, check their status, retrieve results, and cancel in-progress batches. This is ideal for high-volume async workloads like bulk document analysis or data enrichment at reduced cost.

### Can I manage files through this integration?

Yes. The integration supports listing, uploading, retrieving, deleting, and downloading files via Anthropic's Files API. This enables document-to-data pipelines where end users upload files that are then processed by Claude.

### What prompt engineering capabilities are available?

The integration exposes three prompt management endpoints: generate a prompt from a description, improve an existing prompt for better quality, and templatize a prompt with variables for reuse in automated workflows.

## Related reading

- [Connect Anthropic to ChatGPT: Optimize AI Content & Prompting via MCP](https://truto.one/blog/connect-anthropic-to-chatgpt-optimize-ai-content-prompting/) — Learn how to connect Anthropic to ChatGPT using a managed MCP server. Automate prompt engineering, manage workspaces, and execute batch tasks without custom code.
- [Connect Anthropic to Claude: Scale Batch Tasks & File Processing](https://truto.one/blog/connect-anthropic-to-claude-scale-batch-tasks-file-processing/) — Learn how to connect Anthropic's REST API to Claude using a managed MCP server. Automate workspace provisioning, message batches, and cost reporting.
- [Connect Anthropic to AI Agents: Manage AI Governance & Workspaces](https://truto.one/blog/connect-anthropic-to-ai-agents-manage-ai-governance-workspaces/) — Learn how to connect Anthropic to AI agents using dynamic tool calling. Automate workspace provisioning, manage API keys, and audit usage reports.
