> For the complete documentation index, see [llms.txt](https://docs.planetcrust.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.planetcrust.com/human-connections/claude-ai/claude-ai.md).

# Claude AI

<p align="center"><a class="button primary" data-icon="circle-caret-right">Try @Human</a><a class="button primary" data-icon="check">Buy @Human Subscription</a><a class="button primary" data-icon="comments">Join @Human Community</a></p>

<figure><img src="/files/sQzwwa4W9NWTWOhdafeH" alt=""><figcaption></figcaption></figure>

<h3 align="center">Put Claude AI to Work with @Human Automations and @Human Agents</h3>

<p align="center">The Claude AI Connection documents all Triggers, Actions and Query Operations available for creating automations via the Claude AI API.</p>

{% embed url="<https://www.youtube.com/watch?v=CyuUuaBSZzA>" %}

#### What can you do with the Asana Connection?

* Connect to the Claude AI API in a few clicks
* Use the related Claude AI Operations (see below) in @Human Automations or @Human Agents

### Related Operations

#### Trigger Operations

**Message Created**

Triggers on: messages/created

Triggered when a new message is successfully generated and created in Claude AI.

**Message Batch Ended**

Triggers on: message\_batches/ended

Triggered when an asynchronous message batch has finished processing.

**Message Batch Expired**

Triggers on: message\_batches/expired

Triggered when a message batch has reached its expiration time before completion.

**Model Created**

Triggers on: models/created

Triggered when a new AI model is added and becomes available in the system.

**File Created**

Triggers on: files/created

Triggered when a new file is successfully uploaded and processed.

**File Deleted**

Triggers on: files/deleted

Triggered when an existing file is removed from the system.

**Skill Created**

Triggers on: skills/created

Triggered when a new custom agent skill is successfully defined.

**Skill Deleted**

Triggers on: skills/deleted

Triggered when a custom agent skill is removed.

#### Action Operations

[Action: Send Message](/human-connections/claude-ai/claude-ai/action-send-message.md)

[Action: Send Message Batch](/human-connections/claude-ai/claude-ai/action-send-message-batch.md)

[Action: Estimate Token Usage](/human-connections/claude-ai/claude-ai/action-estimate-token-usage.md)

[Action: Upload File](/human-connections/claude-ai/claude-ai/action-upload-file.md)

[Action: Create Skill](/human-connections/claude-ai/claude-ai/action-create-skill.md)

#### Query Operations

[Query: List Models](/human-connections/claude-ai/claude-ai/query-list-models.md)

[Query: List Files](/human-connections/claude-ai/claude-ai/query-list-files.md)

[Query: List Skills](/human-connections/claude-ai/claude-ai/query-list-skills.md)

### Related Automations

Example link

### Obtaining Access Credentials

To obtain a **system-to-system Personal Access Token (PAT)** for **Anthropic**, follow these steps:

#### **Prerequisites**

* An **Anthropic account** (sign up at [Anthropic Console](https://console.anthropic.com/) if needed).
* **Admin or Developer access** to generate API keys.

#### **Steps to Generate a PAT**

1. **Log in** to the [Anthropic Console](https://console.anthropic.com/).
2. Navigate to **"API Keys"** (under **Manage**).
3. Click **"Create Key"**.
4. Provide a **name/description** (e.g., "System-to-System Access").
5. Click **"Add"**.
6. **Copy the generated key** (this is your PAT—store it securely).

### Configuring Webhooks

1. **Set up a webhook trigger** on your chosen automation platform to receive external data.
2. **Configure an action** that uses the Claude AI API (passing your PAT generated above).
3. **Implement a polling mechanism** if you need to monitor asynchronous operations, such as the **Message Batches API**.
4. **Check the status** of your batch requests periodically via the `GET /v1/messages/batches/{batch_id}` endpoint.
5. **Trigger downstream actions** once the `processing_status` returns as `ended`.

### Code (Apache v2.0): Service Connectivity and Metadata

```
{
  "handle": "claude-api",
  "status": "active",
  "meta": {
    "short": "Claude API",
    "description": "Connects to Anthropic's Claude API for natural language processing and AI-driven text generation.",
    "icon": "claude",
    "tags": ["AI", "NLP", "API", "Anthropic"]
  },
  "service": {
    "baseURL": {
      "value": "https://api.anthropic.com/v1"
    },
    "protocol": "https",
    "contentType": "application/json",
    "headers": {
      "anthropic-version": {
        "value": "2023-06-01"
      },
      "x-api-key": {
        "value": "{{apiKey}}"
      }
    },
    "auth": {
      "method": "api_token",
      "params": {
        "apiToken": {
          "token": {
            "value": "{{apiKey}}"
          },
          "headerName": {
            "value": "x-api-key"
          }
        }
      }
    }
  }
}

```

### Code (Apache v2.0): List of External Resources and Internal Mapping

````
Available resources: messages, message_batches, models, files, skills.

| Handle | Endpoint | Operations |
|---|---|---|
| `messages` | `/messages` | create |
| `message_batches` | `/messages/batches` | list, read, create, delete |
| `models` | `/models` | list, read |
| `files` | `/files` | list, read, delete |
| `skills` | `/skills` | list, read, delete |

```json
[
  {
    "handle": "messages",
    "meta": { "short": "Messages", "description": "Send messages to Claude and count tokens." },
    "endpoint": { "value": "/messages" },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the message." } },
      { "name": "content", "type": "String", "selector": ["content", 0, "text"], "meta": { "description": "Generated content text." } },
      { "name": "role", "type": "String", "selector": ["role"], "meta": { "description": "Role of the sender." } },
      { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "Model used." } },
      { "name": "stop_reason", "type": "String", "selector": ["stop_reason"], "meta": { "description": "Reason for stopping generation." } },
      { "name": "stop_sequence", "type": "String", "selector": ["stop_sequence"], "meta": { "description": "Sequence that caused generation to stop." } },
      { "name": "usage_input_tokens", "type": "Integer", "selector": ["usage", "input_tokens"], "meta": { "description": "Number of input tokens." } },
      { "name": "usage_output_tokens", "type": "Integer", "selector": ["usage", "output_tokens"], "meta": { "description": "Number of output tokens." } }
    ],
    "operations": {
      "create": {
        "method": "POST", "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"model\": \"{{model}}\", \"max_tokens\": {{max_tokens}}, \"messages\": [{\"role\": \"user\", \"content\": \"{{content}}\"}]}",
          "placeholders": [
            { "name": "model", "type": "String", "description": "Model to use.", "required": true },
            { "name": "max_tokens", "type": "Integer", "description": "Maximum tokens to generate.", "required": true },
            { "name": "content", "type": "String", "description": "User message content.", "required": true }
          ]
        }
      }
    },
    "webhooks": [
      {
        "event": "messages.created", "path": "/webhooks/claude-api/messages.created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the message." } },
          { "name": "content", "type": "String", "selector": ["content", 0, "text"], "meta": { "description": "Generated content text." } },
          { "name": "role", "type": "String", "selector": ["role"], "meta": { "description": "Role of the sender." } },
          { "name": "model", "type": "String", "selector": ["model"], "meta": { "description": "Model used." } },
          { "name": "usage_input_tokens", "type": "Integer", "selector": ["usage", "input_tokens"], "meta": { "description": "Number of input tokens." } },
          { "name": "usage_output_tokens", "type": "Integer", "selector": ["usage", "output_tokens"], "meta": { "description": "Number of output tokens." } }
        ]
      }
    ]
  },
  {
    "handle": "message_batches",
    "meta": { "short": "Message Batches", "description": "Process large volumes of Messages requests asynchronously with a cost reduction." },
    "endpoint": { "value": "/messages/batches" },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the batch." } },
      { "name": "processing_status", "type": "String", "selector": ["processing_status"], "meta": { "description": "Status of the batch processing." } },
      { "name": "ended_at", "type": "DateTime", "selector": ["ended_at"], "meta": { "description": "Timestamp when the batch ended." } },
      { "name": "created_at", "type": "DateTime", "selector": ["created_at"], "meta": { "description": "Timestamp when the batch was created." } },
      { "name": "expires_at", "type": "DateTime", "selector": ["expires_at"], "meta": { "description": "Timestamp when the batch expires." } },
      { "name": "results_url", "type": "String", "selector": ["results_url"], "meta": { "description": "URL to download the batch results." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" } },
      "read": {
        "method": "GET", "path": { "value": "/{{batch_id}}", "placeholders": [{ "name": "batch_id", "type": "String", "description": "ID of the batch.", "required": true }] }
      },
      "create": {
        "method": "POST", "path": { "value": "" },
        "bodyTemplate": {
          "value": "{\"requests\": [{\"custom_id\": \"{{custom_id}}\", \"params\": {\"model\": \"{{model}}\", \"max_tokens\": {{max_tokens}}, \"messages\": [{\"role\": \"user\", \"content\": \"{{content}}\"}]}}]}",
          "placeholders": [
            { "name": "custom_id", "type": "String", "description": "Your internal ID for the request.", "required": true },
            { "name": "model", "type": "String", "description": "Model to use.", "required": true },
            { "name": "max_tokens", "type": "Integer", "description": "Maximum tokens to generate.", "required": true },
            { "name": "content", "type": "String", "description": "User message content.", "required": true }
          ]
        }
      },
      "delete": {
        "method": "POST", "path": { "value": "/{{batch_id}}/cancel", "placeholders": [{ "name": "batch_id", "type": "String", "description": "ID of the batch to cancel.", "required": true }] }
      }
    },
    "webhooks": [
      {
        "event": "message_batches.ended", "path": "/webhooks/claude-api/message_batches.ended",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the batch." } },
          { "name": "processing_status", "type": "String", "selector": ["processing_status"], "meta": { "description": "Status of the batch processing." } },
          { "name": "ended_at", "type": "DateTime", "selector": ["ended_at"], "meta": { "description": "Timestamp when the batch ended." } },
          { "name": "results_url", "type": "String", "selector": ["results_url"], "meta": { "description": "URL to download the batch results." } }
        ]
      },
      {
        "event": "message_batches.expired", "path": "/webhooks/claude-api/message_batches.expired",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the batch." } },
          { "name": "expires_at", "type": "DateTime", "selector": ["expires_at"], "meta": { "description": "Timestamp when the batch expires." } }
        ]
      }
    ]
  },
  {
    "handle": "models",
    "meta": { "short": "Models", "description": "List available Claude models and their details." },
    "endpoint": { "value": "/models" },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Model identifier." } },
      { "name": "display_name", "type": "String", "selector": ["display_name"], "meta": { "description": "Human-readable name of the model." } },
      { "name": "created_at", "type": "DateTime", "selector": ["created_at"], "meta": { "description": "When the model was created." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" } },
      "read": {
        "method": "GET", "path": { "value": "/{{model_id}}", "placeholders": [{ "name": "model_id", "type": "String", "description": "Specific model identifier (e.g., claude-3-opus-20240229).", "required": true }] }
      }
    },
    "webhooks": [
      {
        "event": "models.created", "path": "/webhooks/claude-api/models.created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Model identifier." } },
          { "name": "display_name", "type": "String", "selector": ["display_name"], "meta": { "description": "Human-readable name of the model." } },
          { "name": "created_at", "type": "DateTime", "selector": ["created_at"], "meta": { "description": "When the model was created." } }
        ]
      }
    ]
  },
  {
    "handle": "files",
    "meta": { "short": "Files", "description": "Upload and manage files for use across multiple API calls." },
    "endpoint": { "value": "/files" },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the file." } },
      { "name": "file_name", "type": "String", "selector": ["file_name"], "meta": { "description": "Name of the file." } },
      { "name": "purpose", "type": "String", "selector": ["purpose"], "meta": { "description": "Purpose of the file." } },
      { "name": "bytes", "type": "Integer", "selector": ["bytes"], "meta": { "description": "Size of the file in bytes." } },
      { "name": "created_at", "type": "DateTime", "selector": ["created_at"], "meta": { "description": "Timestamp when the file was uploaded." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" } },
      "read": {
        "method": "GET", "path": { "value": "/{{file_id}}", "placeholders": [{ "name": "file_id", "type": "String", "description": "ID of the file to retrieve.", "required": true }] }
      },
      "delete": {
        "method": "DELETE", "path": { "value": "/{{file_id}}", "placeholders": [{ "name": "file_id", "type": "String", "description": "ID of the file to delete.", "required": true }] }
      }
    },
    "webhooks": [
      {
        "event": "files.created", "path": "/webhooks/claude-api/files.created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the file." } },
          { "name": "file_name", "type": "String", "selector": ["file_name"], "meta": { "description": "Name of the file." } },
          { "name": "purpose", "type": "String", "selector": ["purpose"], "meta": { "description": "Purpose of the file." } },
          { "name": "created_at", "type": "DateTime", "selector": ["created_at"], "meta": { "description": "Timestamp when the file was uploaded." } }
        ]
      },
      {
        "event": "files.deleted", "path": "/webhooks/claude-api/files.deleted",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the file." } }
        ]
      }
    ]
  },
  {
    "handle": "skills",
    "meta": { "short": "Skills", "description": "Create and manage custom agent skills." },
    "endpoint": { "value": "/skills" },
    "fields": [
      { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the skill." } },
      { "name": "name", "type": "String", "selector": ["name"], "meta": { "description": "Name of the skill." } },
      { "name": "description", "type": "String", "selector": ["description"], "meta": { "description": "Description of the skill." } },
      { "name": "created_at", "type": "DateTime", "selector": ["created_at"], "meta": { "description": "Timestamp when the skill was created." } }
    ],
    "operations": {
      "list": { "method": "GET", "path": { "value": "" } },
      "read": {
        "method": "GET", "path": { "value": "/{{skill_id}}", "placeholders": [{ "name": "skill_id", "type": "String", "description": "ID of the skill to retrieve.", "required": true }] }
      },
      "delete": {
        "method": "DELETE", "path": { "value": "/{{skill_id}}", "placeholders": [{ "name": "skill_id", "type": "String", "description": "ID of the skill to delete.", "required": true }] }
      }
    },
    "webhooks": [
      {
        "event": "skills.created", "path": "/webhooks/claude-api/skills.created",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the skill." } },
          { "name": "name", "type": "String", "selector": ["name"], "meta": { "description": "Name of the skill." } },
          { "name": "created_at", "type": "DateTime", "selector": ["created_at"], "meta": { "description": "Timestamp when the skill was created." } }
        ]
      },
      {
        "event": "skills.deleted", "path": "/webhooks/claude-api/skills.deleted",
        "payload": [
          { "name": "id", "type": "String", "selector": ["id"], "meta": { "description": "Unique identifier for the skill." } }
        ]
      }
    ]
  }
]

````

<p align="center"><a class="button primary" data-icon="square-caret-right">Try @Human</a><a class="button primary" data-icon="check">Buy @Human Subscription</a><a class="button primary" data-icon="comments">Join @Human Community</a></p>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.planetcrust.com/human-connections/claude-ai/claude-ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
