Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Anthropic

Scalekit connector
Open markdown

The Anthropic connector lets your AI agent act in each user's Anthropic account. Each user connects their own Anthropic API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 13 tools.

Tools
13
What they doRead · write · destructive
8 · 3 · 28 read3 write2 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Anthropic connection

    In AgentKit > Connections, create an Anthropic connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'anthropic'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Anthropic:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'anthropic_list_files',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Anthropic credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • anthropic_count_tokensCount the input tokens a message request would use, without running the model.Read-only

    Count Message Tokens

    Count the input tokens a message request would use, without running the model. Returns input_tokens, the total across messages, system prompt and tools. Use before anthropic_create_message to check a prompt against context limits or estimate cost. It does not generate text and is not billed as a completion.

    Inputs

    messagesarrayrequired
    Conversation turns, oldest first, alternating user and assistant roles. Each turn has a role (user or assistant) and content, which is either a plain string or an array of content blocks. Example: [{"role": "user", "content": "Hello, Claude"}]. A final assistant turn is treated as a prefill on models that allow it.
    modelstringrequired
    Model id to run, for example claude-sonnet-5-5, claude-opus-5-5 or claude-haiku-5-5. Use anthropic_list_models to see the ids your key can use.
    output_configobject
    Output settings. Set effort to low, medium, high, xhigh or max to trade thoroughness for speed, and format to {"type": "json_schema", "schema": {...}} to request structured JSON output. Example: {"effort": "medium"}.
    systemstring
    System prompt that sets context, role or instructions for the model. A plain string, or an array of text blocks such as [{"type": "text", "text": "You are a concise assistant."}].
    thinkingobject
    Extended thinking configuration. Use {"type": "adaptive"} to let Claude decide when to think, {"type": "enabled", "budget_tokens": 2048} for a fixed thinking budget (at least 1024 and below max_tokens), or {"type": "disabled"}. Which types a model accepts depends on the model.
    tool_choiceobject
    Controls how the model uses the supplied tools. Use {"type": "auto"} to let the model decide, {"type": "any"} to force some tool call, {"type": "tool", "name": "get_weather"} to force one tool, or {"type": "none"} to forbid tool calls.
    toolsarray
    Client tool definitions the model may call. Each tool has a name, a description, and an input_schema that is a JSON Schema object. Example: [{"name": "get_weather", "description": "Get the weather for a city", "input_schema": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}].
  • anthropic_get_file_metadataGet metadata for one uploaded file by id.Read-only

    Get File Metadata

    Get metadata for one uploaded file by id. Returns id, filename, mime_type, size_bytes, created_at, downloadable and expires_at; not the file content. Use after anthropic_list_files to inspect a file.

    Inputs

    file_idstringrequired
    Id of the file, starting with file_. Returned by anthropic_list_files.
  • anthropic_get_message_batchGet the status of one message batch by id.Read-only

    Get Message Batch

    Get the status of one message batch by id. Returns processing_status (in_progress, canceling or ended), request_counts, timestamps and results_url once ended. Use to poll a batch after anthropic_create_message_batch. Once ended, use anthropic_get_message_batch_results to read the outputs.

    Inputs

    message_batch_idstringrequired
    Id of the message batch, starting with msgbatch_. Returned by anthropic_create_message_batch and anthropic_list_message_batches.
  • anthropic_get_message_batch_resultsFetch the results of a finished message batch as JSON Lines, one result per request.Read-only

    Get Message Batch Results

    Fetch the results of a finished message batch as JSON Lines, one result per request. Returns lines with custom_id and a result of succeeded (with the message), errored, canceled or expired; order may differ from the request order. Use after anthropic_get_message_batch shows processing_status ended, and match lines to requests by custom_id.

    Inputs

    message_batch_idstringrequired
    Id of the message batch, starting with msgbatch_. Returned by anthropic_create_message_batch and anthropic_list_message_batches.
  • anthropic_get_modelGet details for one Claude model by id or alias.Read-only

    Get Model

    Get details for one Claude model by id or alias. Returns id, display_name, created_at, lifecycle, deprecation and retirement dates, max_input_tokens, max_tokens and capabilities. Use after anthropic_list_models to check limits or capabilities of a specific model.

    Inputs

    model_idstringrequired
    Model id or alias, for example claude-sonnet-5-5.
  • anthropic_list_filesList files uploaded to the workspace through the Files API.Read-only

    List Files

    List files uploaded to the workspace through the Files API. Returns file metadata (id, filename, mime_type, size_bytes, created_at, downloadable, expires_at) and next_page cursor. Use to find a file id. Use anthropic_get_file_metadata for one file.

    Inputs

    limitinteger
    Number of files per page, 1 to 1000. Defaults to 20.
    pagestring
    Opaque page cursor from the next_page field of a previous response, starting with page_.
  • anthropic_list_message_batchesList message batches in the workspace, newest first.Read-only

    List Message Batches

    List message batches in the workspace, newest first. Returns batch objects with id, processing_status and request_counts, plus pagination cursors (has_more, first_id, last_id). Use to find a batch id. Use anthropic_get_message_batch for one batch.

    Inputs

    after_idstring
    Batch id cursor. Returns the page after this batch. Use last_id from the previous response.
    before_idstring
    Batch id cursor. Returns the page before this batch. Use first_id from the previous response.
    limitinteger
    Number of batches per page, 1 to 1000. Defaults to 20.
  • anthropic_list_modelsList the Claude models available to the API key, newest first.Read-only

    List Models

    List the Claude models available to the API key, newest first. Returns model id, display_name, created_at, lifecycle, token limits, capabilities, and pagination cursors (has_more, first_id, last_id). Use to discover valid model ids. Use anthropic_get_model for one model.

    Inputs

    after_idstring
    Model id cursor. Returns the page after this model. Use last_id from the previous response.
    before_idstring
    Model id cursor. Returns the page before this model. Use first_id from the previous response.
    lifecyclestring
    Only list models in this lifecycle stage. Without it, active and deprecated models are listed and retired models are hidden.one of activedeprecatedretired
    limitinteger
    Number of models per page, 1 to 1000. Defaults to 20.