Skip to content

· 10 min read

How to get an AI API key for Graphite

What an AI API key is, which provider to choose, and how to make one at Anthropic, OpenAI, Google Gemini, xAI, Mistral, DeepSeek, Groq, OpenRouter or the Vercel AI Gateway, with what light use costs, free tiers, spending limits and how to revoke a key.

By Graphite

An API key lets an app use an AI provider's models on your account, and the provider bills you for what you use. Graphite can use one for the Guide: filing your Inbox, reading receipts, explaining, answering about a note, finding what's missing, arranging an outline or a draft from your sentences, connecting, teaching and asking your notebook. Your notes don't need one. Writing, search, links, the Map, your topics and projects, tags and publishing a page all work without a key.

This guide says what a key is, what it costs, which provider to pick, and how to make one at each provider Graphite recognises. It was checked against each provider's own pages on 14 October 2026. Consoles change often: if a button has moved, look for the same words nearby, or for "API keys" in the menu.

What an API key is

An API key is a long secret string, like a password for programs. You make it in a provider's developer console, not in its chat app, and the provider bills the account behind the key for each request an app sends with it.

A ChatGPT, Claude or Gemini subscription isn't an API key, and other apps can't use one:

  • Anthropic doesn't let other apps sign in with a Claude account, or send requests on a Free, Pro or Max plan. (Anthropic)
  • Google's AI plan benefits for developers apply only inside Google AI Studio. (Google)
  • For an app like Graphite, signing in with ChatGPT needs OpenAI's approval. Graphite has asked. (OpenAI)

There are two exceptions, where a subscription pays for API use:

  • Claude Max and Team include monthly API credits: $100 on Max 5x, $200 on Max 20x, and up to $500 pooled on Team. Claim them in claude.ai → Settings → Billing → API credits by linking a Console organization, then make a key there as below. It's an ordinary sk-ant- key, and Graphite takes it. (Anthropic)
  • Mistral plans count across Vibe, Studio and the API, and Pro lists $15 a month in API credits, so a Pro subscriber's key should draw on them. We haven't tried it. (Mistral)

What it costs

A few cents to about $5 a month for light use. That's an estimate for a light month — about 300 quick requests (filing, quizzes), 100 explanations or answers, 10 Teach markings and 20 receipts — at each provider's list prices on 14 October 2026:

  • Groq: about $0.20, or nothing within its free limits
  • DeepSeek: about $0.35 to $0.65
  • Google Gemini: nothing on the free tier, or about $1.50 paid
  • Mistral: about $2
  • xAI: about $2.50
  • OpenAI: about $2.60
  • Claude, through Anthropic, OpenRouter or the Vercel AI Gateway: about $3.60 to $5

Most providers are prepaid: you buy credit first, and requests stop when it runs out. Set a spending limit anyway; each provider's section below says how. Graphite never charges for the AI on your key: your provider bills you directly, at its prices.

Which provider to pick

  • Free to start: Google Gemini. Its free tier needs no card and covers the Flash models, which Graphite uses for most of what it does. The Pro models aren't free, and Graphite uses one to mark what you teach back and for Check my understanding, so those need billing. On the free tier Google uses what you send to improve its products, and people may read it, so don't send anything private.
  • Receipts: a provider that can read photos and PDFs. Anthropic, OpenAI, Google, Mistral, OpenRouter and the Vercel AI Gateway read both in Graphite. xAI reads photos but not PDFs. DeepSeek and Groq read neither, so with their keys receipts wait in your Inbox.
  • One account, no separate keys: OpenRouter. One key, at the models' makers' prices; through OpenRouter, Graphite uses Claude. Or skip the key: Connect OpenRouter in Graphite's Settings → AI signs you in and makes the key in your own OpenRouter account.
  • Writing: Claude or GPT. If you want Graphite's explanations from Claude or GPT, get a key from Anthropic or OpenAI. Through OpenRouter or the Vercel AI Gateway, Graphite uses Claude.

Anthropic (Claude)

An Anthropic API key, the key for Claude, starts sk-ant-.

  1. Sign in at platform.claude.com. The old console.anthropic.com address goes to the same place.
  2. Go to Settings → Billing and choose Buy credits. Credits are prepaid, and expire a year after you buy them.
  3. Go to Settings → API keys and choose Create key. Give it a name, an expiry — Never, or something long, because an expired key stops working — and a workspace. The Default workspace is fine.
  4. Copy the key. The Console shows the full key only once.
  • Key page: platform.claude.com/settings/keys
  • Free tier: none to count on. New accounts may get a small amount of free credit.
  • Cost: per million tokens in and out, Haiku 4.5 $1 / $5, Sonnet 5.5 $2 / $10, Opus 5.5 $4 / $20. (Pricing)
  • Spending limit: Settings → Billing → Spend limits. A workspace other than Default can have a limit of its own, under Settings → Workspaces.
  • Revoke: on the API keys page, Disable the key, which you can undo, or Delete it.
  • Receipts: reads photos and PDFs.

A key that isn't tied to one workspace has to say which workspace to bill, and Anthropic turns its requests away until it does. Choose a workspace when you make the key, or add the workspace's ID, which starts wrkspc_, in Graphite's Settings → AI. (Authentication)

OpenAI (GPT)

An OpenAI API key starts sk-proj-.

  1. Log in at platform.openai.com. Your ChatGPT account works.
  2. In Billing, add a payment method and buy some credits. If you want a hard stop, make sure auto-recharge is off.
  3. Go to API keys and choose Create new secret key. Give it a name and a project; Default is fine.
  4. Copy the key now and keep it somewhere safe: you may not see it in full again.
  • Key page: platform.openai.com/api-keys
  • Free tier: none for new accounts. Without credit, requests fail, and Graphite says the account is out of credit.
  • Cost: per million tokens in and out, gpt-6-luna $0.10 / $0.50, gpt-6.1-sol $2 / $10. (Pricing)
  • Spending limit: Settings → Organization → Limits, or a project's Limits → Spend. Turn on Enforce a hard limit, or it only sends alerts. (Spend limits)
  • Revoke: delete the key on the API keys page.
  • Receipts: reads photos and PDFs.

Google Gemini

A Gemini API key from Google AI Studio starts AIza; keys made since late May 2026 are reported to start AQ.. Graphite recognises both.

  1. Go to Google AI Studio and sign in with a Google account. You need to be 18 or older, and to accept the terms.
  2. Choose Create API key.
  3. Copy the key. An older AIza key should be restricted to the Gemini API. (API keys)
  • Key page: aistudio.google.com/apikey
  • Free tier: yes, with no card, on the Flash and Flash-Lite models. The Pro models aren't free. Free-tier content is used to improve Google's products and may be read by reviewers, so don't send anything private. In the EEA, Switzerland and the UK, the paid data terms apply. (Pricing, terms)
  • Paying: set up billing in AI Studio, prepaying at least $5. (Billing)
  • Spending limit: AI Studio → Spend → Monthly spend cap. It's marked experimental, and can lag by about ten minutes.
  • Revoke: make a new key first, then disable the old one in the Google Cloud console and delete it.
  • Receipts: reads photos and PDFs.

xAI (Grok)

An xAI API key starts xai-.

  1. Sign up at console.x.ai.
  2. In Billing, buy prepaid credits.
  3. Go to API Keys and choose Create API Key. Allow the chat endpoint and the Grok models.
  4. Copy the key. xAI doesn't show the full key again. (Quickstart)
  • Key page: console.x.ai/team/default/api-keys
  • Free tier: none in xAI's docs.
  • Cost: grok-4.7, $2 / $6 per million tokens in and out. (Pricing)
  • Spending limit: prepaid credit stops when it runs out, and auto top-up has a monthly maximum. (Billing)
  • Revoke: delete the key on the API Keys page.
  • Receipts: reads photos, not PDFs.

Mistral

A Mistral API key is 32 letters and digits with no prefix.

  1. Make an account in Mistral's console. In Free mode, API access is on with no credit card.
  2. Go to API Keys and choose Create new key.
  3. Copy the key: the full key appears only once. (Activate and make a key)
  • Free tier: yes. Free mode includes some use each month — Mistral doesn't publish how much — and some models may not take a free key. What you send in Free mode may be used for training unless you opt out, in admin.mistral.ai → Privacy. For more, turn on pay-as-you-go and add credits.
  • Cost: Mistral Small 4, $0.15 / $0.60 per million tokens in and out. (Pricing)
  • Spending limit: Admin → Billing → Monthly spending limit.
  • Revoke: delete the key on the API Keys page.
  • Receipts: reads photos and PDFs.

DeepSeek

A DeepSeek API key starts sk-.

  1. Sign up at platform.deepseek.com.
  2. Top up a prepaid balance.
  3. Go to API keys and create a key.
  4. Copy the key.
  • Key page: platform.deepseek.com/api_keys
  • Free tier: none documented.
  • Cost: deepseek-flash, $0.15 / $0.60 per million tokens in and out, off-peak. (Pricing)
  • Spending limit: none documented, so keep top-ups small.
  • Your data: DeepSeek stores what you send in the People's Republic of China, and lists training among its uses of it. (Privacy policy)
  • Receipts: doesn't read them in Graphite.

Groq

A Groq API key starts gsk_.

  1. Sign up at console.groq.com. The Free plan needs no card.
  2. Go to Keys and choose Create API Key.
  3. Copy the key.
  • Key page: console.groq.com/keys
  • Free tier: yes, with tight limits — for example, 8,000 tokens a minute on the free models, so a long request can be refused. (Rate limits)
  • Cost: gpt-oss-120b, $0.15 / $0.60 per million tokens in and out.
  • Spending limit: on paid plans only. (Spend limits)
  • Receipts: doesn't read them in Graphite.

OpenRouter

An OpenRouter key starts sk-or-v1-, and reaches many providers' models from one account.

The easy way: in Graphite, open Settings → AI and choose Connect OpenRouter. You sign in to OpenRouter, and it makes a key in your own account, billed to it. To make one yourself:

  1. Sign up at openrouter.ai.
  2. Buy credits. There's a 5.5% card fee, at least $0.80.
  3. Go to Keys and choose Create key, with a credit limit.
  4. Copy the key.
  • Key page: openrouter.ai/settings/keys
  • Free tier: only models marked :free, at 50 requests a day. Graphite's models need credit, and a negative balance blocks every request. (Limits)
  • Cost: each provider's own price, with no markup, plus the fee when you buy credits.
  • Spending limit: in OpenRouter's words, "We recommend setting a credit limit on every key." (Authentication)
  • Revoke: delete the key on the Keys page.
  • Receipts: reads photos and PDFs. Graphite sends receipts only to providers on OpenRouter that keep nothing.

Vercel AI Gateway

A Vercel AI Gateway key starts vck_.

  1. In your Vercel account, open your team's AI Gateway API keys.
  2. Choose Create key.
  3. Copy the key: you can't see it again. (API keys)
  4. Buy credits.
  • Free tier: a monthly credit for a set of free models, which doesn't cover the Claude models Graphite uses through the Gateway. Buy credits.
  • Spending limit: budgets per team, project or key. (Budgets)
  • Revoke: delete the key under AI Gateway → API Keys.
  • Receipts: reads photos and PDFs.

Add it to Graphite

  1. Open Settings → AI. In the Mac app, ⌘, opens Settings.
  2. If it asks which AI the Guide uses, choose Your own key.
  3. Paste the key. Graphite recognises the provider from the key's shape, and says whose key it is.
  4. If the key could come from two providers — a bare sk- key, or 32 letters and digits with no prefix — choose which.
  5. For an Anthropic key that isn't tied to one workspace, add the workspace's ID, from Settings → Workspaces in the Anthropic Console.

In the Mac app, the key is kept in your Mac's Keychain — or, if you turn that off in Settings → AI, in Graphite's own file on your Mac, unencrypted — and each request on it goes from the app, on your Mac, straight to your provider. In a browser, the key is kept in that browser and sent with each request on it, with the notes the request is about, through Graphite's server to your provider; the server passes them on and stores neither.

In the web notebook, Settings → AI also has How to get a key: these steps, in short.

Keep it safe

  • Treat a key like a password. Don't paste it into a note, a chat or a shared document.
  • Set a spending limit, or keep a prepaid balance small.
  • If a key may have leaked, revoke it on the page where you made it, and make a new one. A revoked key stops working, and Graphite says it wasn't accepted.
  • To take a key out of Graphite, use Remove in Settings → AI in the Mac app, or clear the key in a browser. Reset settings, in Settings → About, removes it too.

With a key in place, open the notebook and ask it something you've always meant to understand.