Claude

Overview

The Claude connector enables your Leena AI Agents to integrate with Anthropic's Claude AI platform, facilitating automated text generation, multimodal capabilities, and advanced language model workflows.

Claude is Anthropic's family of large language models designed for safe, accurate, and helpful AI interactions. The Claude connector allows Leena AI to leverage powerful AI capabilities for text generation, document analysis, image processing, and complex conversational tasks seamlessly.

API Details

Leena AI integrates with Claude via REST APIs.

Documentation link: https://docs.anthropic.com/en/api/getting-started

Setup

The Claude connector uses API Key authentication.

Prerequisites

Before setting up the Claude connector, ensure you have:

  • An Anthropic account (or use Leena AI's built-in authentication)
  • Access to Anthropic Console for API key generation (optional)
  • Understanding of token usage and rate limits
  • Access to your Leena AI workspace with connector management permissions

Get credentials

Here is how to create an API key in Anthropic Console:

  1. Sign up for an Anthropic account at Anthropic Console
  2. Navigate to API Keys section:
    1. Locate the "API Keys" section in the left sidebar or under Settings menu
  3. Create New API Key:
    1. Click the "+ Create Key" or "Generate New Key" button
    2. Name your key: Use a descriptive name like "Leena AI Integration" or "Production Backend"
    3. Set permissions (if available): Configure whether the key has full access or restricted capabilities
    4. Assign to workspace: If you're part of multiple workspaces, select the appropriate one
    5. Configure model access: Specify which Claude models this key can access
  4. Save and Note Credentials:
    1. Copy your API key immediately (it will only be displayed once)
    2. Store the key securely

Critical Security Notice: Your API key will only be displayed once during creation. If you lose it, you'll need to create a new one.

Add connection

Here is how to add a connection on Leena AI:

  1. Log in to your Leena AI workspace
  2. Navigate to Settings > Integrations
  3. Search for "Claude" and select it from the list to add its new connector
  4. Start configuring the connector:
    1. Authentication Method: Choose between:
      • API Key: Use your own Anthropic API key
      • Leena AI Auth Key: Use Leena AI's managed authentication (no additional configuration required)
    2. API Key: If using your own key, paste your Anthropic API key in the configuration field
    3. Model Selection: Choose from available Claude models:
      • claude-sonnet-4-5-20250929: Latest Sonnet 4.5 version (September 2025)
      • claude-sonnet-4-20250514: Sonnet 4 version (May 2025)
      • claude-3-5-sonnet-20241022: Previous Sonnet 3.5 version (October 2024)
      • claude-3-5-sonnet-20240620: Earlier Sonnet 3.5 version (June 2024)
  5. Save Configurations:
    1. Ensure the key has appropriate permissions
    2. Click Save to complete the connector setup
    3. The connector will be saved and ready to use

Actions

The following actions are supported for the Claude connector:

Generate Text

Generates text responses using Claude AI models with support for both text-only and multimodal inputs. The Agent can leverage the skill (workflow), which has been designed to create AI-generated content, analyze documents and images, and handle complex conversational tasks.


Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
MessagesArray of conversation messages with roles and content
Max TokensMaximum number of tokens to generate in the response

Optional

NameDescription
SystemSystem instructions to guide Claude's behavior and response style
TemperatureControls randomness in generation (0.0 to 1.0). Lower values for deterministic output, higher for creative responses
Return As JSONFormat response as structured JSON output (true/false)
Sample JSONExample JSON structure to guide the format of the response

Message Structure:

Each message in the conversation array must follow this structure:

Basic Text Message:

  • role: Message sender role (values: "user" or "assistant")
  • content: Text content of the message

Multimodal Message (with files):

  • role: Message sender role (values: "user" or "assistant")
  • content: Array of content blocks containing text and/or files
  • mimeType: MIME type of the file (for images: "image/jpeg", "image/png"; for documents: "application/pdf")
  • fileData: File data as URL or base64-encoded string

Supported File Types:

Images:

  • JPEG (.jpeg, .jpg)
  • PNG (.png)
  • GIF (.gif)
  • WebP (.webp)

Documents:

  • PDF (.pdf)
  • DOC (.doc)

Temperature Settings:

ValueDescriptionUse Case
0Deterministic, consistent outputFactual queries, code generation
0.3Low variabilityTechnical writing, summaries
0.7Balanced creativity and consistencyGeneral conversation, creative tasks
1.0Maximum creativityBrainstorming, artistic content

Here is a sample JSON input:

//Basic Text Generation
{
  "messages": [
    {
      "role": "user",
      "content": "Write a brief summary of renewable energy benefits"
    }
  ],
  "max_tokens": 1024,
  "temperature": 0.7
}

//Text Generation with System Prompt
{
  "messages": [
    {
      "role": "user",
      "content": "Explain quantum computing to a beginner"
    }
  ],
  "max_tokens": 1024,
  "system": "You are a helpful technical educator who explains complex topics in simple terms",
  "temperature": 0.5
}

//Multimodal - Image Analysis
{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "image",
          "source": {
            "type": "base64",
            "media_type": "image/jpeg",
            "data": "base64_encoded_image_data_here"
          }
        },
        {
          "type": "text",
          "text": "What objects are visible in this image?"
        }
      ]
    }
  ],
  "max_tokens": 1024,
  "temperature": 0.3
}

//Document Analysis
{
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "document",
          "source": {
            "type": "base64",
            "media_type": "application/pdf",
            "data": "base64_encoded_pdf_data_here"
          }
        },
        {
          "type": "text",
          "text": "Summarize the key points from this document"
        }
      ]
    }
  ],
  "max_tokens": 2048,
  "system": "You are an expert document analyst",
  "temperature": 0.3
}

//Structured JSON Output
{
  "messages": [
    {
      "role": "user",
      "content": "Extract key information about the product: iPhone 15 Pro, 256GB, Titanium Blue, $1,199"
    }
  ],
  "max_tokens": 500,
  "returnAsJson": true,
  "sampleJson": {
    "product_name": "string",
    "storage": "string",
    "color": "string",
    "price": "number"
  },
  "temperature": 0
}

//Multi-turn Conversation
{
  "messages": [
    {
      "role": "user",
      "content": "What is machine learning?"
    },
    {
      "role": "assistant",
      "content": "Machine learning is a subset of artificial intelligence that enables computers to learn from data and improve their performance without being explicitly programmed."
    },
    {
      "role": "user",
      "content": "Can you give me a practical example?"
    }
  ],
  "max_tokens": 1024,
  "temperature": 0.7
}

Response

Upon successful generation, the action returns:

  • Generated text content or structured JSON
  • Token usage information (input tokens and output tokens)
  • Model used for generation
  • Stop reason (end_turn, max_tokens, or stop_sequence)
  • Message ID and timestamp