May 27, 2026

Gemini Slack integration: connect Google AI to Slack

Reading time :  
8
 min
Aymeric Zhuo
Aymeric Zhuo

Gemini Slack integration: bring Google AI into your workspace

A gemini slack integration connects Google's Gemini models directly to your team's Slack channels — so questions, summaries, and content generation happen where your team already works. No tab switching. No copy-pasting prompts into a browser window.

The direct answer: Google does not offer a native Gemini app for Slack. You need to build a custom Slack bot that calls the Gemini API, or use an automation platform to bridge the two. The setup takes 20–40 minutes depending on your approach.

Google's Gemini 2.5 Pro processes up to 1 million tokens of context, according to Google DeepMind's 2025 model documentation. Slack reported 65 million daily active users in its 2025 annual report. Connecting these two systems puts long-context AI reasoning inside the communication layer where decisions happen.

Unlike generic AI automation posts, this guide shows real CodeWords workflows — not just theory. You will build a working gemini slack integration by the end of this page.

Related reading: Discord Slack integration, AI automation tools, workflow automation examples, build your own AI agent, CodeWords integrations, CodeWords pricing, CodeWords templates.

TL;DR

  • Google Gemini has no native Slack app — you build the bridge with the Gemini API and Slack's Bolt framework (or an automation workflow).
  • The Gemini API's generous free tier (60 requests per minute on Gemini 2.5 Flash) makes it viable for team-wide Slack bots without immediate cost pressure.
  • CodeWords handles the entire pipeline: Cody creates the Slack listener, Gemini API call, and response formatting as a single serverless workflow.

What are the main approaches to a gemini slack integration?

Three paths exist. Each trades simplicity for control.

Approach 1: Slack Bolt app + Gemini API

Build a Slack bot using Slack's Bolt framework (Python or JavaScript). The bot listens for app mentions or slash commands, sends the message text to the Gemini API, and posts the response back to the thread.

Core components:

  • A Slack app with Bot Token Scopes: app_mentions:read, chat:write, channels:history
  • A Google Cloud project with the Gemini API enabled
  • A server or serverless function to host the Bolt app
  • The google-generativeai Python SDK or @google/generative-ai npm package

This approach gives you full control over prompt engineering, response formatting, and context window management. The tradeoff: you maintain the infrastructure.

Approach 2: Automation platform connector

Zapier and Make both support Slack triggers and HTTP request modules. You create a flow that triggers on a Slack message, calls the Gemini API via HTTP, and posts the result back. Setup is faster, but you hit per-task limits and lose fine-grained control over threading and error handling.

Approach 3: CodeWords serverless workflow

Tell Cody to build a Slack bot that uses Gemini. CodeWords handles the Slack event listener (via native Slack integration), the Gemini API call (with built-in LLM access — no API key setup), and the response posting. The workflow runs as a serverless microservice, so there is no infrastructure to manage.

How do you set up a Gemini-powered Slack bot step by step?

Step 1: Create a Slack app.

Go to api.slack.com/apps and create a new app from scratch. Under OAuth & Permissions, add these Bot Token Scopes: app_mentions:read, chat:write, channels:history, groups:history, im:history. Install the app to your workspace and copy the Bot User OAuth Token.

Step 2: Get Gemini API access.

In the Google AI Studio, generate an API key. The free tier provides 60 requests per minute on Gemini 2.5 Flash and 2 requests per minute on Gemini 2.5 Pro. For a team Slack bot, Flash is usually sufficient — it responds in under 2 seconds for most queries.

Step 3: Build the message handler.

Your handler receives Slack events, extracts the user's message, constructs a prompt (optionally with channel context from recent messages), calls the Gemini API, and posts the response back as a threaded reply. Thread-level replies prevent the bot from cluttering the main channel.

In CodeWords, this entire handler is a single workflow. Cody writes the FastAPI endpoint, the Gemini call with system instructions, and the Slack response — all deployed to a serverless runtime. State persistence via Redis lets the bot remember conversation context within a thread.

Step 4: Configure event subscriptions.

Back in your Slack app settings, enable Event Subscriptions and point the Request URL to your handler. Subscribe to app_mention events. Verify the challenge handshake. Once verified, every @mention of your bot triggers the handler.

Step 5: Add system instructions.

The difference between a useful AI bot and a noisy one is the system prompt. Define the bot's role, tone, domain boundaries, and output format. For example:

  • Role: "You are a technical assistant for the engineering team."
  • Constraints: "Answer in under 300 words. Use code blocks for code. If you don't know, say so."
  • Context: "You have access to the last 10 messages in the thread for conversation continuity."

How do you handle context and threading in a gemini slack integration?

Gemini's 1 million token context window is an advantage here. Most Slack bots lose context between messages. With Gemini, you can pass the full conversation thread — sometimes the entire channel history for a day — into the prompt.

The practical pattern:

  1. On each @mention, fetch the parent thread's messages using the Slack API (conversations.replies)
  2. Format them as a conversation transcript
  3. Append the new user message
  4. Send the full transcript as the Gemini prompt
  5. Post the response as a threaded reply

This gives the bot genuine conversational memory without maintaining a separate database. For longer conversations, summarize older messages to stay within token limits.

CodeWords makes this simple: the native Slack integration fetches thread context automatically, and the built-in LLM access handles the Gemini call with configurable context windows.

What are common failure points and how do you fix them?

Timeout errors. Slack requires a response within 3 seconds of receiving an event. Gemini calls can take longer, especially with Gemini 2.5 Pro. Solution: respond immediately with a 200 status, process the Gemini call asynchronously, and post the result when ready.

Rate limiting. The free Gemini tier caps at 60 RPM for Flash. A busy Slack workspace can exceed this during peak hours. Solution: implement request queuing, or upgrade to a paid tier. According to Google's pricing page (2025), Gemini 2.5 Flash costs $0.15 per million input tokens — negligible for most teams.

Formatting mismatches. Gemini outputs standard markdown. Slack uses mrkdwn, a proprietary format. Bold is *text* in Slack but **text** in markdown. Code blocks differ. Solution: add a formatting transformation step between the Gemini response and the Slack post.

Sensitive data. Slack messages may contain proprietary information. Before sending messages to the Gemini API, consider data sensitivity policies. Google's data governance documentation specifies that API inputs are not used for model training on paid tiers.

Can you extend the bot beyond simple Q&A?

Once the basic gemini slack integration works, you can layer in additional capabilities:

  • Document summarization. Users upload a file to Slack, the bot retrieves it, sends it to Gemini with a "summarize this" instruction, and posts the summary. Gemini's multimodal input handles PDFs, images, and spreadsheets.
  • Scheduled digests. A CodeWords scheduled workflow fetches the last 24 hours of messages from selected channels, sends them to Gemini for summarization, and posts a daily digest. Useful for executives who skim, not scroll.
  • Triage and routing. The bot classifies incoming support messages by category and urgency using Gemini, then routes them to the right channel or assigns them via Slack's workflow builder.
  • Web research. Combine Gemini with CodeWords web scraping (Firecrawl or AI Web Agent) to answer questions that require live data — pricing lookups, documentation checks, or competitor monitoring.

FAQs

Is the Gemini API free for Slack bots? Yes, with limits. The free tier provides 60 requests per minute on Gemini 2.5 Flash. For most team bots, this is sufficient. Paid tiers start at $0.15 per million input tokens (2025 pricing).

Can Gemini handle images shared in Slack? Yes. Gemini is multimodal. Your bot can download the image from Slack, send it to the Gemini API as base64 or a file URI, and receive a text response describing, analyzing, or extracting information from the image.

How does this compare to using ChatGPT in Slack? OpenAI offers an official ChatGPT Slack app. Gemini does not have an official Slack app, so you build your own. The advantage of a custom gemini slack integration is full control over prompts, context, and integrations — plus Gemini's larger context window (1M tokens vs. 128K for GPT-4o).

Conclusion

A gemini slack integration turns your workspace into an AI-augmented environment where answers, summaries, and analysis happen in the flow of conversation. The technical barrier is low — a Slack bot, a Gemini API key, and a message handler. The organizational impact compounds: every question answered in-channel is a context switch avoided.

The implication is broader than a chatbot. Once Gemini lives in Slack, it becomes a layer — a persistent reasoning engine that can process documents, monitor channels, triage requests, and surface insights from data your team is already producing.

Start building your gemini slack integration on CodeWords — tell Cody what you want, and the workflow deploys in minutes.

Contents
Ready to try CodeWords?
Get started free
Sign in
Sign in