> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Ollama

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.

**Authentication:** Bearer Token
**Categories:** AI
**Tools:** 10: 4 read, 6 write, 0 destructive
**Users sign in with:** Access token
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=OLLAMA)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".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](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   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)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_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.actions

   connection_name = "ollama"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Ollama:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="ollama_balance_get",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Ollama credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'ollama_balance_get',
  toolInput: {},
  connector: 'ollama',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="ollama_balance_get",
    tool_input={},
    connection_name="ollama",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `ollama_balance_get`

Get Credit Balance · Read-only

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

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `ollama_model_show`

Show Model Details · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `model` (`string`, required): Model name to show. Example: gpt-oss:120b.
- `verbose` (`boolean`, optional): If true, includes large verbose fields in the response. Example: true.

Example input: `{"model":"<model>"}`

### `ollama_models_list`

List Models · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `ollama_usage_get`

Get Cloud Usage · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `group_by` (`string`, optional): How to group usage within totals and buckets. Supported values: model. Example: model. One of: `model`.
- `range` (`string`, optional): Completed UTC hours or days to include, plus the current partial hour or day. Defaults to 7d. Example: 7d. One of: `24h`, `7d`, `30d`.
- `scope` (`string`, optional): Your requests, or your team's requests. Team scope requires being a team admin. Defaults to self. Example: self. One of: `self`, `team`.

Example input: `{}`

### `ollama_chat`

Chat · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `messages` (`array`, required): 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."}]
- `model` (`string`, required): 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.
- `format` (`object`, optional): JSON schema the reply must follow (structured output). Example: {"type": "object", "properties": {"summary": {"type": "string"}}}.
- `keep_alive` (`string`, optional): Model keep-alive duration (for example 5m or 0 to unload immediately). Example: 5m.
- `logprobs` (`boolean`, optional): Whether to return log probabilities of the output tokens. Example: true.
- `options` (`object`, optional): Runtime options that control text generation. Example: {"temperature": 0.2, "num_predict": 256}
- `think` (`boolean`, optional): 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.
- `tools` (`array`, optional): 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_logprobs` (`integer`, optional): Number of most likely tokens to return at each token position when logprobs are enabled. Example: 3.

Example input: `{"messages":[{"role":"user","content":"Summarize the benefits of solar power in two sentences."}],"model":"<model>"}`

### `ollama_embed`

Generate Embeddings · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `input_value` (`array`, required): Texts to embed, as an array of strings (one embedding per text). Example: ["The quick brown fox"].
- `model` (`string`, required): Embedding model name, such as embeddinggemma or qwen3-embedding. Use models_list to see available models. Example: embeddinggemma.
- `dimensions` (`integer`, optional): Number of dimensions to generate embeddings for. Example: 768.
- `keep_alive` (`string`, optional): Model keep-alive duration. Example: 5m.
- `options` (`object`, optional): Runtime options that control text generation. Example: {"temperature": 0.2, "num_predict": 256}
- `truncate` (`boolean`, optional): If true, truncate inputs that exceed the context window. If false, returns an error. Defaults to true. Example: true.

Example input: `{"input_value":["The quick brown fox"],"model":"<model>"}`

### `ollama_generate`

Generate Completion · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): 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.
- `format` (`object`, optional): JSON schema the reply must follow (structured output). Example: {"type": "object", "properties": {"summary": {"type": "string"}}}.
- `images` (`array`, optional): Images. Example: ["iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="]
- `keep_alive` (`string`, optional): Model keep-alive duration (for example 5m or 0 to unload immediately). Example: 5m.
- `logprobs` (`boolean`, optional): Whether to return log probabilities of the output tokens. Example: true.
- `options` (`object`, optional): Runtime options that control text generation. Example: {"temperature": 0.2, "num_predict": 256}
- `prompt` (`string`, optional): Text for the model to generate a response from. Example: Write a haiku about autumn.
- `raw` (`boolean`, optional): When true, returns the raw response from the model without any prompt templating. Example: true.
- `suffix` (`string`, optional): Used for fill-in-the-middle models, text that appears after the user prompt and before the model response. Example: return result.
- `system` (`string`, optional): System prompt for the model to generate a response from. Example: You are a concise assistant.
- `think` (`boolean`, optional): 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_logprobs` (`integer`, optional): Number of most likely tokens to return at each token position when logprobs are enabled. Example: 3.

Example input: `{"model":"<model>"}`

### `ollama_systemone_answer`

Answer Typed Questions · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): Model trained for System One, such as nimble, or clef:cloud for Ollama's cloud. Example: clef:cloud.
- `questions` (`object`, required): 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?"}}.
- `state` (`string`, required): 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.
- `images` (`array`, optional): 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_alive` (`string`, optional): 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.

Example input: `{"model":"<model>","questions":{},"state":"<state>"}`

### `ollama_web_fetch`

Web Fetch · Write

Fetch one web page by URL with Ollama's web fetch API.
Returns the page title, its content as text and the links on it.
Use web_search to find pages first.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `url` (`string`, required): the URL to fetch. Example: https://ollama.com/blog.

Example input: `{"url":"<url>"}`

### `ollama_web_search`

Web Search · Write

Search the web with Ollama's web search API.
Returns up to max_results results, each with title, url and a content snippet.
Use web_fetch to read a full page.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `query` (`string`, required): the search query string. Example: latest Ollama release notes.
- `max_results` (`integer`, optional): maximum results to return (default 5, max 10). Example: 5.

Example input: `{"query":"<query>"}`

## Related

Other AI connectors ([all 216](/agentkit/connectors/?category=ai)):

- [Chorus](/agentkit/connectors/chorus/): Scalekit connector, Username and password, 9 tools
- [Gong](/agentkit/connectors/gong/): Scalekit connector, OAuth, 69 tools
- [Jiminny](/agentkit/connectors/jiminny/): Scalekit connector, Access token, 27 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
