iSolvoltar ao site

ENGINEERING

Google Sheets: AI as a spreadsheet formula, on your own gateway

August 2026 · 5 min read

Just activated iSol API? Your key lives in the customer portal, isollm.ai/account → API keys. The endpoint used in every step below is https://tokens.4clouders.com/v1, and per-key spend updates on the same page. That is all you need to follow along.

Why this is the highest-leverage integration on this blog

Every other guide here serves a developer. This one serves finance, sales and operations, the people who live in a spreadsheet all day. After ten lines of script, AI becomes a formula they already know how to use: drag it down a column and 400 rows get classified.

Step 1: Open Apps Script

In the sheet: Extensions → Apps Script. Delete the placeholder function and paste this:

const ISOL_KEY = "sk-your-gateway-key";        // better: PropertiesService
const ISOL_URL = "https://tokens.4clouders.com/v1/chat/completions";

/**
 * Asks the sovereign gateway and returns the answer in the cell.
 * @customfunction
 */
function ISOL(prompt, system) {
  const res = UrlFetchApp.fetch(ISOL_URL, {
    method: "post",
    contentType: "application/json",
    headers: { Authorization: "Bearer " + ISOL_KEY },
    payload: JSON.stringify({
      model: "isol-4.9",
      messages: [
        { role: "system", content: system || "Answer in one short line." },
        { role: "user", content: String(prompt) }
      ]
    })
  });
  return JSON.parse(res.getContentText()).choices[0].message.content.trim();
}

Save. The @customfunction comment is what registers =ISOL() as a formula inside the sheet.

Step 2: Use it like any other formula

=ISOL("classifique: "&A2; "Classifique a despesa em UMA palavra: viagem, software, marketing, pessoal, infraestrutura, outros.")

Below, three real expense lines going through that exact prompt, answered by the gateway one row at a time:

Three expense rows classified through the iSol gateway
Real rows, captured 2026-08-22: 'UBER *TRIP' returned viagem, 'ADOBE CREATIVE CLOUD' returned software, 'FOLHA PRESTADOR PJ' returned pessoal. One word each, exactly what a column needs.

Step 3: Make it survive a real sheet

Why the sovereign part matters here

A spreadsheet of expenses, salaries, customers or contracts is exactly the kind of file nobody wants pasted into a public chatbot. With this integration the data goes to an endpoint your company answers for, and the row never leaves that boundary.

Vídeo real: a fórmula =ISOL() rodando célula a célula com o vocabulário fixo no prompt. Três linhas de despesa, três categorias, uma palavra cada.

Step 4: Verify at the gateway, not at the client

Whatever the tool's screen says, the source of truth is the key's ledger. Every request lands there with model and token counts, so if nothing shows up, the change did not take:

curl -s https://tokens.4clouders.com/key/info \
  -H "Authorization: Bearer sk-your-gateway-key" | jq .info.spend

Every command and screenshot on this page comes from a session run against the live iSol gateway on 2026-08-22.

Try it on ours

Our gateway (iSol API) runs exactly this setup on sovereign infrastructure, US$ 99/month, 14-day trial.

See plans →

Same gateway, rest of your stack: every guide with real sessions

The pattern: one gateway, every tool WhatsApp Telegram GitHub Actions Teams Claude Code Cursor VS Code aider OpenCode n8n Zapier Power Automate Power BI Website chatbot Hermes Agent