Claude¶
Claude AI content generation via Anthropic Messages API. Installing and configuring this extension registers Claude as a selectable AI provider platform-wide: admin content generation and prompt templates, AI-assisted SEO (meta and image alt text), the cart's AI order-list parser, and J'AI Chat replies all resolve their provider from the same registry. Claude supports both text and vision (image) requests.
At a glance
| Extension id | claude |
| Category | ai |
| Version | 0.1.0 |
| Provides | AI completion strategy (claude), text + vision |
| External account | Anthropic account with API key |
What It Provides¶
- AI completion strategy — an
AICompletionStrategyimplementation registered under the nameclaude, callinghttps://api.anthropic.com/v1/messageswithx-api-keyauthentication and a pinnedanthropic-version: 2023-06-01header. - Vision support —
supports_visionisTrue; multimodal requests send the image as a base64imagecontent block ahead of the text prompt. - Connection testing — a
build_test_strategyhook consumed by thetestAiProviderConnectionGraphQL mutation, so the admin can verify a key without persisting it. - Hot reload — a
hot_reload(config)hook: saving new config in the admin re-registers the strategy immediately, without an API restart. - Settings deep link — the manifest points the Extensions list's Configure action at
/settings/ai(AI Providers).
Once registered, the provider appears in the aiProviders GraphQL query (with a live health check) and is eligible for generateAiContent, SEO meta/alt-text generation, cartAiParseToLookupItems, and J'AI Chat — see Building Extensions for the strategy registry.
Setup¶
- Enable the extension for a channel under Settings > Extensions.
- Provide credentials — the install hint reads: "Set ANTHROPIC_API_KEY env var or configure via the extension settings." The config-form
api_keytakes precedence; theANTHROPIC_API_KEYenvironment variable is the fallback when no key is saved. - Optionally choose a Model and Max Tokens default in the config form.
- Save. The strategy hot-reloads from the decrypted config immediately.
- Verify on the AI Providers page (Settings > AI) — the connection test makes a minimal one-token call against the configured model.
Configuration Reference¶
| Key | Type | Required | Secret | Description |
|---|---|---|---|---|
api_key |
password | Yes | Yes | Anthropic API key. Falls back to the ANTHROPIC_API_KEY env var when unset. |
model |
select | No | No | Default claude-sonnet-4-20250514. Options: Claude Sonnet 4 (Recommended), Claude Opus 4, Claude 3.5 Haiku (Fast). |
max_tokens |
number | No | No | Default 1024. Default max-tokens budget for completions. |
password-type fields are Fernet-encrypted at rest and masked (***) when read back through the admin API.
Permissions¶
The manifest declares no permissions.
Operational Notes¶
- No key, no provider — if neither the config
api_keynorANTHROPIC_API_KEYis set, the strategy is not registered at all (a warning is logged); Claude then does not appear inaiProvidersand is skipped by auto provider selection. Saving a key later registers it without a restart. - Image formats are whitelisted — vision requests accept only
image/jpeg,image/png,image/gif, andimage/webp(withimage/jpgnormalized toimage/jpeg). Anything else — notably iPhone HEIC uploads — is rejected by the extension with a descriptive error before the Anthropic API is called; such images must be converted client-side before upload. - Upstream errors are surfaced — on a 4xx/5xx vision response, the extension raises the Anthropic error body (e.g. "Could not process image") instead of a generic HTTP error, so admin-facing error details carry the real reason.
- Health check is a real call —
health_checkposts a one-token "ping" message to the configured model with a 10-second timeout, so a failing check can mean a bad key or an invalid model name. - Timeouts — 60 s for text generation, 120 s for vision requests, 10 s for health checks.
- Masked-key test fallback — if the admin posts the masked
***value to the connection test, core falls back to the stored, decrypted key for that provider. - Multi-channel config — the strategy is registered once per process; at boot the extension loads the first enabled channel row whose config contains an
api_key.