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
- Access token
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 DeepSeek connection
In AgentKit > Connections, create a DeepSeek 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 = 'deepseek'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'deepseek_get_user_balance',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 = "deepseek"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize DeepSeek:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="deepseek_get_user_balance",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach 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 toexecute_tooldeepseek_fetch_urlFetch one web page through DeepSeek and convert it to Markdown.Read-onlyFetch 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-onlyGet 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-onlyGet 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-onlyList 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-onlyList 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-onlySearch 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.WriteCreate 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.WriteCreate 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
deepseek_create_fim_completionFill in the middle: generate the text (usually code) that belongs between a prompt and an optional suffix, using DeepSeek's beta completions endpoint (non-streaming, non-thinking).WriteCreate FIM Completion
Fill in the middle: generate the text (usually code) that belongs between a prompt and an optional suffix, using DeepSeek's beta completions endpoint (non-streaming, non-thinking). Returns choices with the generated text and finish_reason, plus token usage. Use this for code or text infill and autocomplete. Use deepseek_create_chat_completion for conversations and instructions.
Inputs
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). FIM always runs in non-thinking mode.one of
deepseek-flashdeepseek-v4-pro promptstringrequired- The text before the gap: the model writes what comes next. Example: def fib(a):
echoboolean- When true, return the prompt together with the completion. Cannot be combined with suffix or logprobs.
logprobsinteger- Return log probabilities for this many most likely tokens at each position (0 to 20), plus the chosen token. Example: 5
max_tokensinteger- Maximum number of tokens to generate, 1 to 4096 (FIM output is capped at 4K). Example: 128
stoparray- Up to 16 stop sequences as a JSON array of strings; the returned text does not include them. Example: ["\n\n"]
suffixstring- The text after the gap. When set, the model writes the middle part that joins prompt and suffix. Example: return fib(a-1) + fib(a-2)
temperaturenumber- Sampling temperature from 0 to 2; lower is more deterministic. Example: 0.2
top_pnumber- Nucleus sampling cutoff, greater than 0 and at most 1. Example: 0.9
deepseek_create_responseGenerate a model response in the OpenAI Responses API format (stateless, non-streaming), with optional thinking, JSON or JSON Schema output, function tools and server-side web search (deepseek-v4-pro).WriteCreate Response
Generate a model response in the OpenAI Responses API format (stateless, non-streaming), with optional thinking, JSON or JSON Schema output, function tools and server-side web search (deepseek-v4-pro). Returns a response object with status, an output array of reasoning, message, function_call and web_search_call items, and token usage. Use this when your agent already speaks the Responses format or needs json_schema output or built-in web search. Use deepseek_create_chat_completion for the Chat Completions format. Nothing is stored, so send the full history in input_items each turn.
Inputs
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 inputstring- Plain-text input, treated as one user message. Use input_items instead for a multi-turn history, images or tool results. Provide input, input_items or instructions. Example: Explain what a vector database is.
input_itemsarray- The full conversation as a JSON array of input items. The API is stateless, so send the whole history each time. Item types are message ({"role":"user","content":"..."}, roles user, assistant, system or developer), function_call, function_call_output (with the matching call_id), reasoning and web_search_call. User messages can include input_image parts (deepseek-flash only). Overrides input when both are set. Example: [{"role":"user","content":"What is 2+2?"}]
instructionsstring- System-level instruction inserted as the first system message. Example: Answer in one short paragraph.
json_schemaobject- JSON Schema object the output must match. Required when text_format is json_schema. Example: {"type":"object","properties":{"city":{"type":"string"},"population":{"type":"integer"}},"required":["city","population"]}
json_schema_namestring- Name of the output schema. Required when text_format is json_schema. Example: city_facts
max_output_tokensinteger- Upper bound on generated tokens, counting both visible output and reasoning tokens. Example: 4096
reasoning_effortstring- Thinking mode and effort: none turns thinking off; low, high or max turn it on at that effort. If unset, the model's default applies (thinking on, effort high).one of
nonelowhighmax temperaturenumber- Sampling temperature from 0 to 2. Only applies in non-thinking mode. Example: 0.2
text_formatstring- Output format: text (default), json_object for JSON mode, or json_schema for output that matches json_schema (also set json_schema_name).one of
textjson_objectjson_schema tool_choicestring- Which tool the model may call: none, auto (default), required, or the name of one function to force that call. Example: get_weather
toolsarray- Tools the model may call, as a JSON array. Function tools look like {"type":"function","name":"get_weather","description":"...","parameters":{JSON Schema}}. {"type":"web_search"} lets deepseek-v4-pro search the web on the server; it is ignored with deepseek-flash.
top_logprobsinteger- Number of most likely tokens (0 to 20) to return with log probabilities at each position. Example: 5
top_pnumber- Nucleus sampling cutoff, greater than 0 and at most 1. Only applies in thinking mode, where values below 0.95 are raised to 0.95. Example: 0.95
userstring- Your own identifier for the end user (letters, digits, - and _, up to 512 characters), used for content safety review, KV cache isolation and scheduling. No personal data. Example: customer_8421
deepseek_delete_filePermanently delete an uploaded file by its id.DestructiveDelete File
Permanently delete an uploaded file by its id. Returns the file id and deleted: true. Use this to remove images that are no longer needed. Chat requests that still reference the id will fail.
- Idempotent
Inputs
file_idstringrequired- ID of the file to delete, of the form file-api-.... Get it from deepseek_list_files. Example: file-api-0a1b2c3d4e5f60718293a4b5c6d7e8f9
No tools match.