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
- API key
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. 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>Create the Anthropic connection
In AgentKit > Connections, create an Anthropic connection. The name you give it is the
connection_nameyour code passes. See Configure connections.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.actionsconst connector = 'anthropic'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'anthropic_list_files',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "anthropic"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Anthropic:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="anthropic_list_files",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach 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 toexecute_toolanthropic_count_tokensCount the input tokens a message request would use, without running the model.Read-onlyCount 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-onlyGet 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-onlyGet 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-onlyGet 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-onlyGet 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-onlyList 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-onlyList 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-onlyList 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.
anthropic_cancel_message_batchCancel a message batch that is still processing.WriteCancel Message Batch
Cancel a message batch that is still processing. Returns the batch object with processing_status canceling; requests already running may still finish and the rest end as canceled. Use to stop a batch you no longer need. Use anthropic_delete_message_batch to remove a finished batch.
Inputs
message_batch_idstringrequired- Id of the message batch, starting with msgbatch_. Returned by anthropic_create_message_batch and anthropic_list_message_batches.
anthropic_create_messageSend a conversation to a Claude model and get the next assistant message, with optional system prompt, tools, thinking and structured output.WriteCreate Message
Send a conversation to a Claude model and get the next assistant message, with optional system prompt, tools, thinking and structured output. Returns the message id, model, content blocks, stop_reason and token usage; non-streaming only. Use this for a single synchronous completion. Use anthropic_create_message_batch to run many requests asynchronously, and anthropic_count_tokens to size a prompt first. Charges apply to the API key's account for the tokens used.
Inputs
max_tokensintegerrequired- Maximum number of tokens to generate before stopping. The model may stop earlier. Example: 1024.
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.
metadata_user_idstring- Opaque external id for the end user, such as a UUID or hash, used to help detect abuse. Do not use names or emails. Maximum 512 characters.
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"}.
service_tierstring- Use auto to take priority capacity when your account has it, or standard_only to stay on standard capacity.one of
autostandard_only stop_sequencesarray- Custom strings that make the model stop generating when produced. Example: ["END"].
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."}].
temperaturenumber- Randomness from 0.0 to 1.0. Models released after Claude Opus 4.6 only accept 1.0 and reject other values with a 400 error, so leave this empty for them.
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"]}}].
top_kinteger- Only sample from the top K token options. Models released after Claude Opus 4.6 reject this parameter, so leave it empty for them.
top_pnumber- Nucleus sampling cutoff from 0.0 to 1.0. Models released after Claude Opus 4.6 reject values below 0.99, so leave this empty for them.
anthropic_create_message_batchSubmit up to 100,000 message requests to run asynchronously as one batch at reduced cost.WriteCreate Message Batch
Submit up to 100,000 message requests to run asynchronously as one batch at reduced cost. Returns the batch object with id, processing_status, request_counts, created_at and expires_at; results arrive within 24 hours. Use for large offline workloads. Poll with anthropic_get_message_batch, then read output with anthropic_get_message_batch_results. Use anthropic_create_message for a single immediate reply.
Inputs
requestsarrayrequired- List of batch requests, 1 to 100,000. Each has a unique custom_id and params holding the same fields as a create-message call. Example: [{"custom_id": "req-1", "params": {"model": "claude-haiku-5-5", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello, world"}]}}].
anthropic_delete_filePermanently delete an uploaded file.DestructiveDelete File
Permanently delete an uploaded file. Returns the deleted file id and type file_deleted. Use to remove a file you no longer need; messages that reference it will fail afterwards.
- Idempotent
Inputs
file_idstringrequired- Id of the file, starting with file_. Returned by anthropic_list_files.
anthropic_delete_message_batchPermanently delete a finished message batch and its results.DestructiveDelete Message Batch
Permanently delete a finished message batch and its results. Returns the deleted batch id and type message_batch_deleted. Use only after the batch has ended; cancel an in-progress batch first with anthropic_cancel_message_batch.
- Idempotent
Inputs
message_batch_idstringrequired- Id of the message batch, starting with msgbatch_. Returned by anthropic_create_message_batch and anthropic_list_message_batches.
No tools match.