Anthropic Claude API Integration

DigiFusion Pro includes an AI-powered writing assistant that supports Anthropic’s Claude API for content generation. This feature allows you to generate high-quality content directly within your WordPress editor using Claude’s advanced language model.

Setting Up Claude API Integration

Navigate to your WordPress admin dashboard and go to DigiFusion > Write with AI.

Enable AI Writing Assistant

Toggle the Enable Write with AI option to activate the feature. This will add an AI writing button to your post editor.

Select Anthropic as Provider

In the AI Provider dropdown, select Anthropic (Claude) from the available options.

Configure Post Types

Choose which post types should have the AI writing button by selecting them in the Choose Post Types section. By default, the feature is enabled for posts, but you can extend it to pages and custom post types.

Add Your Anthropic API Key

Enter your Anthropic API key in the Anthropic API Key field. You can obtain your API key from the Anthropic Console.

The API key format should start with sk-ant- followed by your unique key string.

Set Token Limits

Configure the Max Tokens setting to control the length of generated content. Higher values allow longer content but consume more API credits. The recommended range is 500-2000 tokens.

  • 500-600 tokens: Short content (1-2 paragraphs)
  • 1000-1500 tokens: Medium content (3-5 paragraphs)
  • 2000+ tokens: Long content (articles, detailed posts)

Click Save AI Settings to store your configuration.

Using Claude in the Editor

Block Editor (Gutenberg)

When editing a post in the block editor, you’ll see a Write with AI button in the editor toolbar. Click this button to open the AI content generation panel.

Classic Editor

In the classic editor, the Write with AI button appears above the content editor. Click it to access the AI writing interface.

Content Generation Process

The AI panel includes several fields to customize your content:

Content Title: Enter a descriptive title for the content you want to generate.

Keywords: Add relevant keywords separated by commas to focus the content generation.

Prompt: Describe specifically what content you want Claude to create.

Content Tone: Select the desired tone for your content (professional, casual, friendly, etc.).

Content Length: Choose from predefined length options or specify custom requirements.

Overwrite Content: Check this option if you want to replace existing content in the editor.

Click Generate Content to send your request to Claude’s API. The generated content will appear in your editor once processing is complete.

API Configuration Details

Claude integration uses thesonnet 4model by default, which provides high-quality content generation with good performance.

The system automatically adjusts token limits based on the requested content length:

  • Very long content (1500-2000 words): 2500 tokens
  • Long content (600-1000 words): 1500 tokens
  • Medium content (400-600 words): 1000 tokens
  • Short content: 600 tokens

All API requests include proper error handling and will display specific error messages if the API key is invalid or if there are connectivity issues.

The integration respects Anthropic’s API rate limits and includes proper request formatting according to their API specifications.