Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/manusapis/Agix/llms.txt

Use this file to discover all available pages before exploring further.

Agix’s Claude integration talks directly to the Anthropic Messages API at https://api.anthropic.com/v1/messages. Unlike the OpenAI-compatible providers, Claude uses a distinct HTTP contract: authentication is passed in an x-api-key header rather than a Bearer token, a versioning header is required, and system messages are promoted out of the conversation array into a dedicated top-level field. Agix handles all of this transparently inside ClaudeProvider, so the rest of the application works with the same ChatRequest / ChatResponse types regardless of which provider is active.

Default configuration

The default configuration registered in providers.config.ts is:
{
  id: "claude",
  name: "Claude (Anthropic)",
  apiKey: "",                                 // Supplied at runtime in the sidebar
  baseUrl: "https://api.anthropic.com/v1",
  defaultModel: "claude-3-5-sonnet-latest",
  enabled: true,
}

Setting up Claude in the sidebar

1

Open the Agix sidebar

In Excel, click Home → Agix. In Google Sheets, open the Agix add-on from the Extensions menu.
2

Select the Claude provider

In the Provider dropdown, choose Claude (Anthropic).
3

Enter your API key

Paste your Anthropic API key into the API Key field. You can generate one at console.anthropic.com.
4

Choose a model (optional)

The default model is claude-3-5-sonnet-latest. You can change this to any model name listed in your Anthropic console.
5

Save

Click Save. Agix persists the configuration via settingsStore.save() into the Office document settings.

AIProviderConfig shape for Claude

{
  id: "claude",
  name: "Claude (Anthropic)",
  apiKey: "sk-ant-...",
  baseUrl: "https://api.anthropic.com/v1",
  defaultModel: "claude-3-5-sonnet-latest",
  enabled: true
}

Authentication headers

Every request sent by ClaudeProvider includes the following headers:
{
  "Content-Type": "application/json",
  "x-api-key": this.config.apiKey,
  "anthropic-version": "2023-06-01",
}
The anthropic-version header is required by the Anthropic API and is pinned to 2023-06-01 in the current implementation.

System message handling

The Anthropic Messages API does not accept system role entries inside the messages array. ClaudeProvider automatically adapts the incoming ChatRequest by extracting any message with role: "system" and placing its content in the top-level system field of the request body. The remaining user and assistant messages are passed in the messages array as normal.
// Inside ClaudeProvider.chat():
const system = request.messages.find((m) => m.role === "system")?.content;
const messages = request.messages
  .filter((m) => m.role !== "system")
  .map((m) => ({ role: m.role, content: m.content }));

// Sent to the API:
{
  model: request.model,
  system,          // Top-level system prompt
  messages,        // user / assistant turns only
  max_tokens: request.maxTokens ?? 1024,
  temperature: request.temperature ?? 0.7,
}

Request parameters

model
string
required
The Claude model to use, e.g. claude-3-5-sonnet-latest. Taken from the ChatRequest.
system
string
Extracted from any system-role message in the request. Omitted from the body if no system message is present.
messages
object[]
required
The user and assistant turns of the conversation after the system message has been removed.
max_tokens
number
default:"1024"
Maximum tokens in the response. Defaults to 1024 when not specified in the ChatRequest.
temperature
number
default:"0.7"
Controls response randomness. Defaults to 0.7 when not provided by the caller.

Response shape

ClaudeProvider maps the Anthropic response into the shared ChatResponse type:
interface ChatResponse {
  provider: "claude";
  model: string;
  content: string;        // Concatenated text blocks from data.content
  finishReason?: string;  // Mapped from data.stop_reason
}
The Anthropic API returns content as an array of typed blocks. ClaudeProvider joins all text blocks into a single string. Token usage is not currently mapped from the Claude response.
Generate your Anthropic API key at console.anthropic.com. New accounts receive a small free credit allowance. API key usage and spend are visible in the Anthropic console dashboard.

Build docs developers (and LLMs) love