Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Ollama

Scalekit connector
Open markdown

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

Tools
10
What they doRead · write · destructive
4 · 6 · 04 read6 write0 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 Ollama connection

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

    Each user opens the link once and enters their Ollama 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
  • ollama_balance_getGet the remaining usage credits of the Ollama account.Read-only

    Get Credit Balance

    Get the remaining usage credits of the Ollama account. Returns included and purchased credit balances. Use usage_get for what was spent.

    Inputs

    This tool takes no inputs.

  • ollama_model_showGet details about one model.Read-only

    Show Model Details

    Get details about one model. Returns its parameters, template, capabilities (such as tools, vision, thinking), model info and license. Use it to check what a model supports before calling it.

    Inputs

    modelstringrequired
    Model name to show. Example: gpt-oss:120b.
    verboseboolean
    If true, includes large verbose fields in the response. Example: true.
  • ollama_models_listList the models available to your API key on Ollama's cloud.Read-only

    List Models

    List the models available to your API key on Ollama's cloud. Returns each model's name, size, digest, family, parameter size and modified time. Use a name as model in chat, generate or embed.

    Inputs

    This tool takes no inputs.

  • ollama_usage_getGet usage statistics for cloud inference, web search and web fetch over the last 24 hours, 7 days or 30 days.Read-only

    Get Cloud Usage

    Get usage statistics for cloud inference, web search and web fetch over the last 24 hours, 7 days or 30 days. Returns totals (requests, cost in USD, tokens) and hourly or daily buckets, optionally grouped by model. Use balance_get for remaining credits.

    Inputs

    group_bystring
    How to group usage within totals and buckets. Supported values: model. Example: model.one of model
    rangestring
    Completed UTC hours or days to include, plus the current partial hour or day. Defaults to 7d. Example: 7d.one of 24h7d30d
    scopestring
    Your requests, or your team's requests. Team scope requires being a team admin. Defaults to self. Example: self.one of selfteam
  • ollama_chatGenerate the next assistant message for a conversation with a cloud model, with optional tools, structured output and thinking.Write

    Chat

    Generate the next assistant message for a conversation with a cloud model, with optional tools, structured output and thinking. Returns the message (role, content, thinking, tool_calls), the done reason and token counts. Streaming is off. Use generate for a single prompt without chat history.

    Inputs

    messagesarrayrequired
    Chat history as an array of message objects (each with a role and content). Example: [{"role": "user", "content": "Summarize the benefits of solar power in two sentences."}]
    modelstringrequired
    Cloud model name, such as gpt-oss:120b, qwen3-coder:480b or deepseek-v3.1:671b. Use models_list to see the models your key can use. Example: gpt-oss:120b.
    formatobject
    JSON schema the reply must follow (structured output). Example: {"type": "object", "properties": {"summary": {"type": "string"}}}.
    keep_alivestring
    Model keep-alive duration (for example 5m or 0 to unload immediately). Example: 5m.
    logprobsboolean
    Whether to return log probabilities of the output tokens. Example: true.
    optionsobject
    Runtime options that control text generation. Example: {"temperature": 0.2, "num_predict": 256}
    thinkboolean
    Set true to have a thinking model return its reasoning separately, or false to turn thinking off. Leave empty for the model's default. Example: false.
    toolsarray
    Optional list of function tools the model may call during the chat. Example: [{"type": "function", "function": {"name": "get_weather", "description": "Get the weather for a city", "parameters": {"type": "object", "properties": {"city"...
    top_logprobsinteger
    Number of most likely tokens to return at each token position when logprobs are enabled. Example: 3.
  • ollama_embedCreate vector embeddings for one or more texts with an embedding model.Write

    Generate Embeddings

    Create vector embeddings for one or more texts with an embedding model. Returns the model name and one embedding vector per input. Use it for semantic search and retrieval.

    Inputs

    input_valuearrayrequired
    Texts to embed, as an array of strings (one embedding per text). Example: ["The quick brown fox"].
    modelstringrequired
    Embedding model name, such as embeddinggemma or qwen3-embedding. Use models_list to see available models. Example: embeddinggemma.
    dimensionsinteger
    Number of dimensions to generate embeddings for. Example: 768.
    keep_alivestring
    Model keep-alive duration. Example: 5m.
    optionsobject
    Runtime options that control text generation. Example: {"temperature": 0.2, "num_predict": 256}
    truncateboolean
    If true, truncate inputs that exceed the context window. If false, returns an error. Defaults to true. Example: true.
  • ollama_generateGenerate a completion for one prompt with a cloud model, with an optional system prompt, images and structured output.Write

    Generate Completion

    Generate a completion for one prompt with a cloud model, with an optional system prompt, images and structured output. Returns the response text, thinking, done reason and token counts. Streaming is off. Use chat for multi-turn conversations or tool calling.

    Inputs

    modelstringrequired
    Cloud model name, such as gpt-oss:120b, qwen3-coder:480b or deepseek-v3.1:671b. Use models_list to see the models your key can use. Example: gpt-oss:120b.
    formatobject
    JSON schema the reply must follow (structured output). Example: {"type": "object", "properties": {"summary": {"type": "string"}}}.
    imagesarray
    Images. Example: ["iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="]
    keep_alivestring
    Model keep-alive duration (for example 5m or 0 to unload immediately). Example: 5m.
    logprobsboolean
    Whether to return log probabilities of the output tokens. Example: true.
    optionsobject
    Runtime options that control text generation. Example: {"temperature": 0.2, "num_predict": 256}
    promptstring
    Text for the model to generate a response from. Example: Write a haiku about autumn.
    rawboolean
    When true, returns the raw response from the model without any prompt templating. Example: true.
    suffixstring
    Used for fill-in-the-middle models, text that appears after the user prompt and before the model response. Example: return result.
    systemstring
    System prompt for the model to generate a response from. Example: You are a concise assistant.
    thinkboolean
    Set true to have a thinking model return its reasoning separately, or false to turn thinking off. Leave empty for the model's default. Example: false.
    top_logprobsinteger
    Number of most likely tokens to return at each token position when logprobs are enabled. Example: 3.
  • ollama_systemone_answerAnswer choice, yes/no (noul) and scoring questions about a piece of text with a System One model, in one call.Write

    Answer Typed Questions

    Answer choice, yes/no (noul) and scoring questions about a piece of text with a System One model, in one call. Returns an answer per named question, with probabilities or scores. Use it for classification and scoring instead of free-form chat.

    Inputs

    modelstringrequired
    Model trained for System One, such as nimble, or clef:cloud for Ollama's cloud. Example: clef:cloud.
    questionsobjectrequired
    Named questions about the state, keyed by name. Each has a type and instructions (the question): noul is a yes/no question, choice needs criteria mapping each option key to a description, and score needs criteria as a list of level descriptions from lowest to highest. Example: {"is_complaint": {"type": "noul", "instructions": "Is this a complaint?"}}.
    statestringrequired
    A nonempty string, or an object or array serialized as JSON text. Not interpreted as chat messages or multimodal input. Example: Customer email: My order arrived broken and I want a refund.
    imagesarray
    Base64-encoded images shared by all questions, in request order. Requires a model with vision, such as Clef. Models with audio input also accept WAV clips here. URLs and data URLs are not supported. Example: ["iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="]
    keep_alivestring
    How long to keep the model loaded after the request, as a duration string (such as 5m) or seconds. Zero unloads after the request; a negative value keeps it loaded. Defaults to the server's keep-alive setting (5m unless configured otherwise). Example: 5m.