Guide

Use free AI models in Zed

Zed is an open-source code editor with an agent panel. It can use an OpenAI-compatible provider or an Ollama server. This guide connects Zed to free models through FreeLLMAPI with either method. A short section at the end covers JetBrains AI Assistant.

Two ways to connect Zed

MethodZed settingFreeLLMAPI endpointKey
OpenAI-compatible provider (recommended)language_models.openai_compatiblehttp://localhost:3001/v1Unified key, in Zed's settings UI or an environment variable
Ollama providerlanguage_models.ollamahttp://localhost:3001 (Ollama emulation)None on loopback, or the unified key

Both methods use the same router and the same free model pool. The OpenAI-compatible method needs no change on the FreeLLMAPI side. The Ollama method needs Ollama emulation, which is off by default.

First install FreeLLMAPI. Open http://localhost:3001, add at least two free provider keys on the Keys page and copy your unified key.

Install on macOS or Linux

curl -fsSL https://freellmapi.co/install.sh | bash

Method 1: OpenAI-compatible provider

Open your Zed settings.json and add this block. The provider id is freellmapi. max_tokens is the context window of the model.

Zed settings.json

{
  "language_models": {
    "openai_compatible": {
      "freellmapi": {
        "api_url": "http://localhost:3001/v1",
        "available_models": [
          {
            "name": "auto",
            "display_name": "FreeLLMAPI Auto",
            "max_tokens": 128000,
            "max_output_tokens": 8192,
            "capabilities": {
              "tools": true,
              "images": false,
              "parallel_tool_calls": false,
              "prompt_cache_key": false,
              "chat_completions": true
            }
          }
        ]
      }
    }
  }
}

Do not put the key in settings.json. Use one of these two methods:

  • Run agent: open settings from the command palette. Go to the LLM providers, find the provider and enter the key. Zed keeps it in the system keychain.
  • Set an environment variable. Zed makes the name from the provider id in upper snake case plus _API_KEY. For the id freellmapi, the name is FREELLMAPI_API_KEY. The variable has priority over the keychain.

Key as an environment variable

export FREELLMAPI_API_KEY=<unified-key>
zed

Add one entry in available_models for each model that you want in the model menu. auto:smart and auto:fast are also valid names.

Method 2: Ollama emulation

FreeLLMAPI can act as an Ollama server. It serves /api/tags, /api/chat, /api/generate, /api/show, /api/version and /api/embed. Streaming uses newline-delimited JSON, as Ollama does.

  1. On the FreeLLMAPI dashboard, open Keys, Agents.
  2. Set Ollama emulation to open-loopback or key-required.
  3. Add the block below to Zed's settings.json.
  4. Open the agent panel and select a model.

Zed settings.json

{
  "language_models": {
    "ollama": {
      "api_url": "http://localhost:3001",
      "context_window": 128000
    }
  }
}
  • open-loopback needs no key, but only for requests from this computer.
  • If FreeLLMAPI runs in Docker, open-loopback refuses requests through a published port. Use key-required and set OLLAMA_API_KEY to your unified key, or enter it in the provider UI.
  • Zed sends the context size as num_ctx. The default is 4096 tokens, which is too small for agent work. Set context_window.

Choose models for the agent panel

The Zed docs say that each model and provider must support tool calling. A model without tool support shows a "No tools" label in the agent panel. Use models with tool calling and a large context window.

Free models for the Zed agent panel: tool calling and 128K+ context
ModelFree onContextFree limits (best offer)ToolsVision
GLM 5.3UnoRouter1M1 req/min
1 req/min per model
YesNo
GLM 5.3 FlashNVIDIA NIM, UnoRouter1M40 req/min
40 RPM
YesYes
Gemini 3.8 FlashGoogle AI Studio1MRecurring provider quotaYesYes
Qwen3.8 Flash NextAMD Radeon Cloud262KRecurring daily account allowanceYesNo
Qwen3.8 FlashElectronHub1M$0.25/week shared recurring creditYesYes
Gemini 3.7 FlashGoogle AI Studio1M10 req/min
20 req/day
250,000 tokens/min
~3M
YesYes
GPT-5.6 LunaElectronHub1M$0.25/week shared recurring creditYesYes
Dots3 Note PreviewKilo Gateway, OpenRouter512K20 req/min
50 req/day
50 req/day account-wide (1,000 after a $10 purchase)
YesYes
DeepSeek V4 FlashAMD Radeon Cloud, BazaarLink, ElectronHub1M10 req/min
50 req/day
Shared rate limit
YesNo
Qwen3.8 27BElectronHub, Groq, OVH AI Endpoints262K30 req/min
250 req/day
70,000 tokens/min
~6M
YesYes

Showing 10 of 109 matching free models. See all models.

Live data from the FreeLLMAPI catalog (version 2026.11.19, checked 19 November 2026). Free limits change often. The catalog is checked every day.

Free tiers have limits per minute and per day. When a provider sends a 429 error, FreeLLMAPI tries the next model in your chain. Add keys from four or more providers for long agent sessions.

Edit predictions: Zed can send edit predictions to an Ollama server or to an OpenAI-compatible /v1/completions endpoint. FreeLLMAPI serves both. The Zed edit prediction docs show no API key field for these two providers. We have not confirmed this combination with FreeLLMAPI, so test it before you depend on it.

JetBrains AI Assistant

JetBrains AI Assistant can use an OpenAI-compatible provider or a local Ollama server. Open Settings, Tools, AI Assistant, Providers & API keys. There are two options:

  • Bring your own key, OpenAI-compatible: enter the base URL http://localhost:3001/v1, your unified key and a model id such as auto. The JetBrains docs say that BYOK works with agents without a JetBrains AI subscription.
  • Ollama: in Third-party AI providers, select Ollama. Enter http://localhost:3001 in the URL field and click Test Connection. Then assign models in Models Assignment. Turn on Ollama emulation in FreeLLMAPI first.

The JetBrains docs give limits for local models: agents cannot use them, and AI Assistant cannot call MCP tools with them. Inline completion and next edit suggestions use JetBrains models by default. For agent work, use the BYOK option.

Troubleshooting

ProblemCauseFix
401 "Invalid API key"Zed has no key for the provider, or the wrong keySet FREELLMAPI_API_KEY, or enter the key in the agent settings
"No tools" label on the modelTools are off for the model, or the model has no tool callingSet "tools": true and use a model from the table
Ollama provider shows no modelsOllama emulation is off in FreeLLMAPITurn it on in Keys, Agents
Ollama requests refused from Dockeropen-loopback accepts only loopback peersUse key-required with your unified key
Long prompts lose contextnum_ctx is 4096 tokensSet context_window in the Ollama settings
"All models rate-limited after N attempts"All keys are at their limitAdd keys from more providers, or wait for the cooldowns
Use every one of these through one key. FreeLLMAPI is an open-source, self-hosted router that puts all these free tiers behind a single OpenAI-compatible endpoint and fails over when one is rate-limited. Browse the catalog or go live.

Frequently asked questions

Can I use a custom LLM in Zed?

Yes. Add an openai_compatible provider with api_url and available_models to language_models in settings.json. Zed also supports an Ollama provider with a custom api_url.

How do I use free AI models in Zed?

Point an OpenAI-compatible provider at FreeLLMAPI on http://localhost:3001/v1. The gateway sends each request to free provider tiers, so inference costs $0.

Where does Zed store the API key for a custom provider?

Zed keeps a key that you enter in the agent settings in the system keychain. You can also set an environment variable named after the provider id, for example FREELLMAPI_API_KEY.

Does JetBrains AI Assistant work with free models?

Yes. Use Bring your own key with an OpenAI-compatible base URL, or the Ollama provider. The JetBrains docs say that agents cannot use local models, so use BYOK for agent work.

Sources

All guides · Browse all free models

Keep reading

All posts →
Guide

Best free LLM APIs 2026

Ten genuinely free LLM APIs worth using — ranked, with real limits.

Guide

Unlimited free AI tokens?

No free AI API is unlimited. The closest real thing: 10.1 billion free tokens a month behind one key.

Guide

How to get a free LLM API key

Get a working key in minutes — no credit card required.