Skip to content
On writing with AI

Using Your Own OpenAI, Claude or Gemini API Key to Write a Novel

Updated November 10, 2026 · 7 min read

Bringing your own API key means the model maker bills you directly and the writing tool becomes the workshop the model works in. For a novelist that can mean lower costs, a free hand in choosing the model, and a clearer answer to where your manuscript goes. It also hands you a few jobs the bundled route handled for you: setting a spend limit, picking the exact model, and keeping the key out of the wrong places. Here is what a key is, what a book really costs, and what to sort out before you paste one in.

Key takeaways

  • An API key identifies you to a model provider and tells it whose account to bill. It holds none of your writing. Treat it like a card number, not a password.
  • A ChatGPT or Claude chat subscription does not include API access. The API is a separate, metered account in the provider’s developer console.
  • Most of what a novel costs through an API is input, not output: every request resends the context the model needs about your story, so how a tool manages that context matters more than how long the book is.
  • Set a spend limit and a usage alert before the key goes anywhere, and give each tool its own key so you can revoke one without breaking the others.
  • Your key puts you under the provider’s API data terms, which often differ from its chat app. It does not change what the writing tool itself stores, so read both.

Every AI writing tool runs on a model made by someone else - Anthropic's Claude, OpenAI's GPT, Google's Gemini, xAI's Grok and a long tail of open models. Usually the tool pays the model maker and passes the cost on to you, bundled into a subscription or a pack of credits. Bringing your own API key turns that around: the model maker bills you directly, and the writing tool becomes the workshop the model works in. For a novelist that can mean lower costs, a free hand in choosing the model, and a clearer answer to where your manuscript goes. It also hands you a few responsibilities the bundled route quietly handled for you.

What an API key actually is

An API key is a long string of characters that identifies you to a model provider's servers. When software sends a request to the model - "write this scene", "summarize this chapter" - the key travels with it, and the provider uses it to decide two things: whether the request is allowed, and whose account to charge. Nothing else. The key does not hold your writing, your settings or your history. It is closer to a payment card number than a password, and it deserves the same care.

You get one from the provider's developer console, which is a separate place from the consumer chat app. A paid ChatGPT or Claude subscription does not come with API access; the API is billed on its own, per use, through its own account. That catches a lot of writers out. The chat subscription is a flat fee for a person typing; the API is metered access for software, and it is the API that a writing tool needs.

Why a writer would bring their own

The first reason is money, and it cuts both ways. API pricing is per token (a token is a piece of a word, roughly three-quarters of an English word on average), with the price set by the provider and published per model. A tool that bundles AI has to price for its average user plus its own margin. If you write a lot, or you favor a cheaper model, paying the provider directly can come out well ahead. If you write occasionally, a bundle may be simpler and no more expensive. The honest move is to run the numbers on your own habits rather than assume.

The second reason is choice. A bundled tool offers the models it has chosen to offer. Your own key reaches whatever your provider account can reach, which can include models the tool has not picked up yet, cheaper tiers for rough drafting, or one specific version you have learned to like. Some writers also use an aggregator account, a single key that reaches many providers' models through one bill, which widens the shelf further.

The third reason is control over the relationship. With your own key, the provider's terms apply to you directly. Usage, spend and limits show up in your own console, and if you stop using a tool, you revoke the key and the access is gone.

What a novel costs in tokens

Most first estimates come out far too low, because writers count only the words that come back. A 90,000-word novel is roughly 120,000 tokens of finished prose, and at that size the output alone is often cheap. The cost lives on the input side.

A model has no memory between requests. To write chapter twenty well, it has to be sent what it needs to know: who these people are, what has happened, the rules of the world, how the scene should land. That context goes with every request, and a serious drafting setup sends a great deal of it, often many times the length of the passage being written. Planning passes, revision passes, quality checks and rewrites each send their own. So the real bill for a book depends far more on how the tool works than on how long the book is. A tool that keeps a lean, well-organized picture of your story spends less per scene than one that pastes in everything every time.

That is why the most useful number a tool can show you is an estimate before a job runs, in terms you can check against your provider dashboard afterwards.

Set the spending limit first

Before a key goes anywhere, open the provider's billing settings. Most consoles let you set a monthly budget, a hard spend limit, usage alerts, or some combination, and some run on prepaid credit that simply stops when it is used up. Set a limit you would be comfortable losing in a bad month, plus an alert well below it. Then watch the usage page for the first few sessions to learn what a chapter actually costs you.

The limit protects you from more than overspending. If a key ever leaks, the limit caps the damage. If a tool misbehaves and retries something in a loop, the limit stops it. It is the one setting worth doing before anything else.

Many providers also let you create several keys, each named. Give each tool its own key. When you want to stop using one tool, or suspect a key has escaped, you revoke that key alone and nothing else breaks.

Which model the key actually reaches

A key opens the door to a provider, but you still choose which model walks through it, and the choice matters more for fiction than the brand name suggests. Models from the same provider differ sharply in cost and in how they write. The flagship tends to be the strongest at sentence-level craft and the most expensive per token; the small, fast models are cheap and serviceable for planning and summaries, and noticeably flatter on the page. New versions arrive every few months, sometimes behind an alias that silently moves to the newer model.

Two habits help. Pick models by how they write your kind of scene, which you can only learn by reading their output side by side on the same brief, ideally without knowing which wrote what. And note the exact version you settled on, so a quiet change behind an alias does not surprise you halfway through a book.

Privacy and data retention

Writers ask, reasonably, whether sending a manuscript through an API means it trains the next model. The answer sits in the provider's own terms, and the API terms are often different from the consumer chat app's. Read the provider's data-use policy for the API specifically: whether API inputs are used for training, how long requests are kept and for what (abuse monitoring is a common reason), and whether a free tier is treated differently from a paid one. Policies change, so check the current page rather than a forum post from last year.

Then ask the same question of the tool. Your key governs what the provider does with your text, but the tool you work in sees the manuscript first and stores your project. Its own terms decide what happens there. A key does not make a tool private; it only moves the billing relationship.

Keeping the key safe

Treat the key like a card number. Paste it only into software you trust, and only into the settings page meant for it - never into a chat window, a shared document, a screenshot or a support email. A well-built tool shows only the last few characters once a key is saved, and lets you replace or delete it in one step. If it shows you the full key again later, or asks you to paste it somewhere ordinary, that is a reason to stop.

If a key does leak, revoke it in the provider console at once and make a new one. Revoking is instant and free, and with a spend limit already set, the worst case is a small, bounded bill.

Your key, or AI included

Bringing your own key is a trade: you take on the billing, the limits and the model choice, and in return you get direct pricing, the full shelf of models and a provider relationship that is yours. For some writers that is exactly right. For others, a single plan with the AI built in, priced per job, is the better fit, and there is nothing lesser about choosing it.

Novelmint offers both. You can add your own Anthropic, OpenAI, Google, xAI or OpenRouter key and build chapters on any model it reaches, or skip the key and let the AI come included in your credits. Either way, the planning, the story bible and the decisions stay yours.

Questions

Frequently asked

Can I use my ChatGPT Plus or Claude Pro subscription as an API key?
No. Chat subscriptions cover the consumer app for a person typing. API access is a separate account in the provider’s developer console, billed per use, and that is where you create a key a writing tool can use.
How much does it cost to write a novel with my own API key?
It depends far more on the tool and the model than on the book’s length. The finished prose of a 90,000-word novel is only around 120,000 tokens, but every request also sends context about your story, plus planning, checking and revision passes. Look for a tool that estimates a job before it runs, then compare that estimate with your provider’s usage page.
Will my novel be used to train the AI if I use my own key?
That is governed by the provider’s data-use terms for its API, which often differ from its consumer chat app and can differ between free and paid tiers. Read the current API policy on the provider’s own site. Separately, check what the writing tool stores, because your key does not change that.
Is it safe to paste my API key into a writing app?
Only into one you trust, and only into the settings page meant for keys. A well-built tool shows just the last few characters once saved and lets you delete or replace it. Set a spend limit first and give each tool its own key, so a leak is bounded and you can revoke that key alone.
Which model should I use my key with for fiction?
Choose by how a model writes your kind of scene, not by its brand. Flagship models are usually strongest at prose and cost more; small models are cheap and fine for planning but flatter on the page. Reading several models side by side on the same brief, ideally blind, tells you more than any spec sheet.

What this page does not claim

  • It does not quote provider prices or name a cheapest provider; prices change often, so the guide teaches how to estimate cost rather than stating it.
  • It does not state any provider’s current data-retention or training policy; it points you to the provider’s own API terms, which change over time.
  • It does not claim your own key is always cheaper than a bundled plan. For occasional writing, included AI can cost the same or less.

Write on your own key, or with the AI included.

Anthropic, OpenAI, Google, xAI or OpenRouter keys work for chapter builds, or skip the key and use the AI included in credits.