# Get an API key: Modular

> Modular Cloud serves open models on NVIDIA and AMD GPUs behind one prepaid key, and the same Big-AGI service connects a free MAX server you run yourself.

- Canonical: https://big-agi.com/docs/connect-modular
- Minimum tier: open  [Open ⊂ Free ⊂ Pro - a tier only ever ADDS to the Open baseline]
- Kind: provider · Last content update generation: 2026-08-13 · Review by: 2026-11-15
- Answers: Where do I create a Modular API key? · Why does my Modular key return a 401 when it worked yesterday? · How do I connect a self-hosted MAX server to Big-AGI? · What does Modular Cloud charge, and how fast is it? · Why is there no Direct Connection toggle for Modular?

Modular is two connections in one Big-AGI vendor: managed pay-per-token **Modular Cloud** endpoints from the MAX and Mojo company (now part of Qualcomm), or a free **MAX self-hosted** server on your own machine. An **Endpoint** chip picks the mode, and two Modular services can sit side by side.

## Prepaid, before the first answer

A Modular Cloud account is created with a work email, and it bills from prepaid credit: money loaded at the console that each request draws down. No trial allowance is included, so an empty balance means no answers - fund the account before expecting the model list to do anything. Current rates per model live on [Modular's pricing page](https://www.modular.com/pricing).

## Minting a key that can reach models

1. Open [console.modular.com/api_tokens](https://console.modular.com/api_tokens) - the empty key field links there as **API tokens**.
2. Create a **Personal** key with **Model access** enabled; a key scoped without it authenticates and still reaches no models.
3. Copy the value at creation - it is shown once, and a key is never regenerated later, only deleted and recreated.

Every key carries a hard expiration date, so a connection that dies months from now may simply have outlived its key.

## The paste, and the Endpoint chip

Open **Models** (`Ctrl + Shift + M`) and press **More Services** if the **Setup AI Models** wizard appears. Then **Add** -> **Modular**, paste into **Modular API Key**, and press **Models** - the list filling in below is your confirmation ([add and manage your keys](/docs/connect-models)).

The field's placeholder shows the `sk-mod-` prefix every key carries. Above it sits the **Endpoint** chip: **Modular Cloud** wants only the key, while **MAX self-hosted** adds a **MAX Server URL** field (such as `http://localhost:8000`) and makes the key optional. The MAX container itself is free, runs on NVIDIA, AMD and Apple Silicon, and speaks the same protocol - whatever models it serves appear in the list automatically.

## Success is the list, filling itself

Modular's catalog is read live, so the list below the panel is also how new arrivals reach you. A model Modular adds later shows up on the next refresh, without an app update.

## Where spending actually stops

The enforceable ceiling is the prepaid balance and the account's rate tier at the Modular console. No budget page is recorded here; the console's billing area is where the ceiling lives. Anything Big-AGI shows about cost is an estimate, never enforcement.

## Direct Connection

Not available: Modular's API does not answer browser-direct (CORS) requests, so every request travels through the Big-AGI fast edge servers. The vendor declares no browser path at all, so the Direct Connection toggle never renders in Modular's setup panel.

> **Direct Connection works only with your API key stored in the browser**, and with an AI service that permits direct browser calls (CORS). Where it cannot be used, requests route through the Big-AGI fast edge servers instead - everything still works, within the standard upload size and time limits.

## What we measured, August 2026

Everything in this section is a snapshot of 2026-08-13, taken from a US connection as single-day spot checks - best of two streaming runs of about 200 tokens each, not benchmarks. Prices move; [the pricing page](https://www.modular.com/pricing) is the source of record.

| Model | Context | $/1M in | $/1M out | Input |
|---|---|---|---|---|
| MiniMax M3 | 1M | $0.30 (cache hits $0.06) | $1.20 | text + images |
| Gemma 4 31B | 256K | $0.25 | $0.65 | text + images |
| Gemma 4 26B A4B | 256K | $0.15 | $0.60 | text + images |
| Kimi K2.7 Code | 256K | $0.60 (cache hits $0.12) | $3.00 | text + images |

| Model | On Modular | Same model elsewhere, same day |
|---|---|---|
| MiniMax M3 | ~238 tok/s, first token 257 ms | 64 tok/s (MiniMax API), 138 tok/s (OpenRouter) |
| Gemma 4 31B | ~199 tok/s, first token 231 ms | 37-132 tok/s across three other hosts |
| Kimi K2.7 Code | ~170 tok/s | 57 tok/s (Moonshot API) |

On every model we compared that day, Modular was the fastest host we measured; for Kimi K2.7 Code it was also the cheapest, at $0.60/$3.00 against $0.95/$4.00 at Moonshot. The trade to know about: Modular serves these as NVIDIA NVFP4 4-bit quantized builds, disclosed in the response's model field. Our task checks found no quality difference against full-precision hosts, and checks this small cannot rule out subtle differences. Two of the four models think before answering; Big-AGI renders the reasoning stream as it arrives. Signup accounts start at 60 requests and 600K tokens per minute across the whole account, rising to 180 requests and 1.8M tokens per minute once a payment method is on file.

## A key held by your own server

Self-hosters can set `MODULAR_API_KEY` in the server environment: no green check appears and the field stays empty, but the server supplies the key on every request. Add the service by hand, leave **Modular API Key** empty and press **Models** - the list fills from the server's key ([keys held by a server you operate](/docs/self-host-configuration)).

## When this doesn't work

| What you see | What it means | What to do |
|---|---|---|
| A 401 after the key worked before | The prepaid balance hit zero, or the key passed its expiration date. | Top up or recreate the key at the console: [key and access errors](/docs/issue-key-and-access) |
| The key is accepted and no models arrive | The key was created without **Model access**, so it authenticates and reaches nothing. | Recreate the key with the scope enabled: [key and access errors](/docs/issue-key-and-access) |
| Requests stall or fail in bursts | The rate tier is shared by every key in the account, so parallel use trips it together. | Add a payment method for the higher tier, or pace requests: [key and access errors](/docs/issue-key-and-access) |

## Related

- [Connect an AI service](/docs/connect-models)
- [Direct Connection](/docs/feature-direct-connection)
- [What your provider does with your text](/docs/privacy-data-flow)
- [Keys held by a server you operate](/docs/self-host-configuration)
