Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to DeepSeek

Scalekit connector
Open markdown

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

Tools
11
What they doRead · write · destructive
6 · 4 · 16 read4 write1 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 DeepSeek connection

    In AgentKit > Connections, create a DeepSeek 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 = 'deepseek'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize DeepSeek:', 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: 'deepseek_get_user_balance',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their DeepSeek 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
  • deepseek_fetch_urlFetch one web page through DeepSeek and convert it to Markdown.Read-only

    Fetch URL

    Fetch one web page through DeepSeek and convert it to Markdown. Returns the page title and its content as Markdown text. Use this to read a specific URL, for example one returned by deepseek_search_web. A 404 means the page had no usable content or was blocked by the site. Billed per successful fetch.

    Inputs

    urlstringrequired
    HTTP or HTTPS URL to fetch, at most 8192 characters, without a username or password. Example: https://api-docs.deepseek.com/guides/thinking_mode
  • deepseek_get_fileGet the metadata of one uploaded file by its id.Read-only

    Get File

    Get the metadata of one uploaded file by its id. Returns id, filename, bytes, purpose, created_at and, if set at upload, expires_at. The file contents are not returned. Use this to check that a file_id still exists before referencing it. Use deepseek_list_files to browse.

    Inputs

    file_idstringrequired
    ID of the file to look up, of the form file-api-.... Get it from deepseek_list_files. Example: file-api-0a1b2c3d4e5f60718293a4b5c6d7e8f9
  • deepseek_get_user_balanceGet the DeepSeek account's current balance.Read-only

    Get User Balance

    Get the DeepSeek account's current balance. Returns is_available (whether the balance covers API calls) and balance_infos per currency (CNY or USD) with total, granted and topped-up amounts. Use this to check funds before large jobs or to explain 402 Insufficient Balance errors.

    Inputs

    This tool takes no inputs.

  • deepseek_list_filesList the image files uploaded to the DeepSeek account, with cursor pagination.Read-only

    List Files

    List the image files uploaded to the DeepSeek account, with cursor pagination. Returns a data array of file objects (id, filename, bytes, purpose, created_at, expires_at), plus first_id, last_id and has_more. Use this to find a file_id for an image part in deepseek_create_chat_completion. Use deepseek_get_file when you already have the id.

    Inputs

    afterstring
    Pagination cursor: return files after this file id, usually the last_id of the previous page. Example: file-api-0a1b2c3d4e5f60718293a4b5c6d7e8f9
    limitinteger
    Number of files to return, 1 to 1000 (default 1000). Example: 100
    orderstring
    Sort by creation time: asc (oldest first, default) or desc (newest first).one of ascdesc
    purposestring
    Only return files with this purpose. user_data is the only value.one of user_data
  • deepseek_list_modelsList the DeepSeek models the API key can use.Read-only

    List Models

    List the DeepSeek models the API key can use. Returns a data array of models with id, display name, context window, max output tokens, input modalities and supported reasoning effort levels. Use this to pick a valid model id and its limits before calling deepseek_create_chat_completion or the other generation tools.

    Inputs

    This tool takes no inputs.

  • deepseek_search_webSearch the web with DeepSeek's search engine and return ranked results.Read-only

    Search the Web

    Search the web with DeepSeek's search engine and return ranked results. Returns results with title, url, snippet, a longer model-ready summary, rerank_score (0 to 3; 1.5 or more is high quality), authority tier, site name, publish date and, when need_content is true, page content. Use this to find pages for a query. Use deepseek_fetch_url to read one known URL in full. Billed per successful non-empty search.

    Inputs

    querystringrequired
    Search query, 1 to 128 characters. Supports operators: site:, -site:, -term, "exact phrase", -"phrase", lang:zh,en, after:2025-01-01 and before:2026. Example: DeepSeek V4 site:github.com
    countinteger
    Number of results to return, 1 to 50. Defaults to 10. Example: 5
    localizationstring
    An IP address used to localize results. Example: 203.0.113.7
    need_contentboolean
    When true, each result's content field carries the page text. When false (default), content is empty.
    ori_questionstring
    The user's original question that led to this search (1 to 128 characters); improves query understanding. Example: When did DeepSeek release V4?
  • deepseek_create_beta_chat_completionGenerate an assistant message through DeepSeek's beta chat endpoint (non-streaming), which adds chat prefix completion and strict-mode function calling to the regular chat API.Write

    Create Beta Chat Completion

    Generate an assistant message through DeepSeek's beta chat endpoint (non-streaming), which adds chat prefix completion and strict-mode function calling to the regular chat API. Returns the same chat completion object: choices with content, reasoning_content, tool_calls and finish_reason, plus token usage. Use this when the reply must continue from an assistant prefix (last message has "prefix": true) or when tool arguments must match their JSON Schema exactly ("strict": true on each function). Otherwise use deepseek_create_chat_completion.

    Inputs

    messagesarrayrequired
    Conversation so far as a JSON array of message objects. Each has a role (system, user, assistant, or tool) and content. User content can also be an array of content parts, for example text plus an image_url part (images work with deepseek-flash only). Assistant messages that requested tools carry tool_calls, and each tool result is a tool message with the matching tool_call_id. When tools are used in thinking mode, pass every earlier assistant message back unchanged, including its reasoning_content, or the API returns 400. For chat prefix completion, make the last message an assistant message with "prefix": true; the model continues from its content. Example: [{"role":"user","content":"Write quick sort in Python"},{"role":"assistant","content":"```python\n","prefix":true}]
    modelstringrequired
    DeepSeek model to use: deepseek-flash (DeepSeek-V4.1-Flash, fast and cheap, accepts image input) or deepseek-v4-pro (DeepSeek-V4-Pro, stronger, text only).one of deepseek-flashdeepseek-v4-pro
    logprobsboolean
    When true, return the log probability of each output token.
    max_tokensinteger
    Maximum number of tokens to generate, from 1 to 393216 (384K). Defaults to 8K in non-thinking mode and 64K in thinking mode (128K with reasoning_effort max). Example: 4096
    reasoning_effortstring
    How hard the model thinks in thinking mode: low, high (the default), or max. none turns thinking mode off. Example: maxone of nonelowhighmax
    response_formatstring
    Output format: text (default) or json_object for JSON Output, which guarantees the reply is valid JSON. With json_object, also ask for JSON in a system or user message (ideally with an example of the shape) and set max_tokens high enough, or the reply can be empty or cut off.one of textjson_object
    stoparray
    Up to 16 stop sequences as a JSON array of strings; generation stops before any of them. Example: ["```"]
    temperaturenumber
    Sampling temperature from 0 to 2; lower is more deterministic. Only applies in non-thinking mode. Example: 0.2
    thinkingstring
    Turns thinking (reasoning) mode on or off. Thinking mode is on by default: the model writes its chain of thought to reasoning_content before the final answer. disabled gives faster, cheaper replies and is required for tool_choice required or a named function.one of enableddisabled
    tool_choicestring
    Which tool the model may call: none (no tool), auto (model decides; the default when tools are given), required (must call at least one tool), or the name of one function to force that call. required and a function name only work with thinking disabled. Example: get_weather
    toolsarray
    Functions the model may call, as a JSON array (up to 128 entries is typical). Each entry is {"type":"function","function":{...}} where the function has a name (letters, digits, underscores and dashes, up to 128 characters), a description, and parameters as a JSON Schema object. This tool supports strict mode: set "strict": true on every function to force arguments that match its schema. Example: [{"type":"function","function":{"name":"get_weather","description":"Get the weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]
    top_logprobsinteger
    Number of most likely alternative tokens (0 to 20) to return at each position. Needs logprobs true. Example: 5
    top_pnumber
    Nucleus sampling cutoff, greater than 0 and at most 1. How it applies depends on the model and thinking mode (for deepseek-flash it only applies in thinking mode, with values below 0.95 raised to 0.95). Example: 0.95
    user_idstring
    Your own identifier for the end user (letters, digits, - and _, up to 512 characters). DeepSeek uses it for content safety review, KV cache isolation and per-user scheduling. Do not put personal data in it. Example: customer_8421
  • deepseek_create_chat_completionGenerate the next assistant message for a conversation with a DeepSeek model (non-streaming), with optional thinking mode, JSON output and function calling.Write

    Create Chat Completion

    Generate the next assistant message for a conversation with a DeepSeek model (non-streaming), with optional thinking mode, JSON output and function calling. Returns choices with the message content, reasoning_content (thinking mode), any tool_calls and finish_reason, plus token usage including cache hits and reasoning tokens. Use this for chat, reasoning, structured JSON and tool-calling agents. Use deepseek_create_beta_chat_completion to force the reply to start with a prefix or for strict-mode tool schemas, deepseek_create_fim_completion to fill in code between a prefix and a suffix, and deepseek_create_response for the OpenAI Responses API format.

    Inputs

    messagesarrayrequired
    Conversation so far as a JSON array of message objects. Each has a role (system, user, assistant, or tool) and content. User content can also be an array of content parts, for example text plus an image_url part (images work with deepseek-flash only). Assistant messages that requested tools carry tool_calls, and each tool result is a tool message with the matching tool_call_id. When tools are used in thinking mode, pass every earlier assistant message back unchanged, including its reasoning_content, or the API returns 400. Example: [{"role":"system","content":"You are concise."},{"role":"user","content":"Hello"}]
    modelstringrequired
    DeepSeek model to use: deepseek-flash (DeepSeek-V4.1-Flash, fast and cheap, accepts image input) or deepseek-v4-pro (DeepSeek-V4-Pro, stronger, text only).one of deepseek-flashdeepseek-v4-pro
    logprobsboolean
    When true, return the log probability of each output token.
    max_tokensinteger
    Maximum number of tokens to generate, from 1 to 393216 (384K). Defaults to 8K in non-thinking mode and 64K in thinking mode (128K with reasoning_effort max). Example: 4096
    reasoning_effortstring
    How hard the model thinks in thinking mode: low, high (the default), or max. none turns thinking mode off. Example: maxone of nonelowhighmax
    response_formatstring
    Output format: text (default) or json_object for JSON Output, which guarantees the reply is valid JSON. With json_object, also ask for JSON in a system or user message (ideally with an example of the shape) and set max_tokens high enough, or the reply can be empty or cut off.one of textjson_object
    stoparray
    Up to 16 stop sequences as a JSON array of strings; generation stops before any of them. Example: ["```"]
    temperaturenumber
    Sampling temperature from 0 to 2; lower is more deterministic. Only applies in non-thinking mode. Example: 0.2
    thinkingstring
    Turns thinking (reasoning) mode on or off. Thinking mode is on by default: the model writes its chain of thought to reasoning_content before the final answer. disabled gives faster, cheaper replies and is required for tool_choice required or a named function.one of enableddisabled
    tool_choicestring
    Which tool the model may call: none (no tool), auto (model decides; the default when tools are given), required (must call at least one tool), or the name of one function to force that call. required and a function name only work with thinking disabled. Example: get_weather
    toolsarray
    Functions the model may call, as a JSON array (up to 128 entries is typical). Each entry is {"type":"function","function":{...}} where the function has a name (letters, digits, underscores and dashes, up to 128 characters), a description, and parameters as a JSON Schema object. Example: [{"type":"function","function":{"name":"get_weather","description":"Get the weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]
    top_logprobsinteger
    Number of most likely alternative tokens (0 to 20) to return at each position. Needs logprobs true. Example: 5
    top_pnumber
    Nucleus sampling cutoff, greater than 0 and at most 1. How it applies depends on the model and thinking mode (for deepseek-flash it only applies in thinking mode, with values below 0.95 raised to 0.95). Example: 0.95
    user_idstring
    Your own identifier for the end user (letters, digits, - and _, up to 512 characters). DeepSeek uses it for content safety review, KV cache isolation and per-user scheduling. Do not put personal data in it. Example: customer_8421