Your own drafting history: files, metadata and quick search

Most chat apps keep your history on their servers. Most APIs keep none at all: each request is answered and forgotten, at least as far as conversation goes. For content work that is both a feature and a gap. Your unpublished drafts are not sitting in someone else's chat list, but nobody is keeping the prompt that produced last month's good intro, the settings behind it, or the three versions you rejected. Small tools that save chat history to plain local files, and local-first writing studios where nothing leaves the device unless you send it, have become popular for exactly this reason.
This guide is for writers and small teams who draft by API and want a history they control. It shows how to save every request and response to local files with useful metadata, how to search them later, how to reuse good prompts, and what to keep out of the archive. The code is short enough to adapt in an afternoon.
Examples call the free keyless endpoint on this site, which runs an independent open-weight model, free-ai, and is stateless by design. This site is not affiliated with DeepSeek; the archive works the same with DeepSeek's API or any OpenAI-compatible service.
Frequently asked questions
What does stateless mean for an API?
It means the server does not remember earlier requests as part of a conversation. If you want the model to see previous messages, you send them again. It also means the service does not keep a chat history for you to look up later.
Why keep a local archive at all?
To reuse prompts that worked, to see which settings produced which drafts, to prove where a piece of text came from, and to compare outputs when a model or provider changes. Without an archive, all of that depends on memory.
How does a local archive differ from a chat app's history?
A local archive lives on your machine or your own storage, in a format you choose, and includes settings and metadata that chat apps hide. A chat app's history is convenient but lives on the app's servers under its retention rules.
Which format is best, JSON files or a database?
For one writer, JSON Lines files or one JSON file per request are simple, readable and easy to back up. For a team or many thousands of drafts, a small SQLite database makes searching faster. Both are fine starting points.
Does the free endpoint store my drafts?
It keeps no conversation history. Each request leaves a technical log with time, IP, User-Agent, country, endpoint, status, latency, sizes and token counts. The text is processed to produce the answer, so confidential material should not be sent.
Should the archive include rejected drafts?
Yes, at least for a while. Rejected drafts show which prompts and settings failed, which is as useful as knowing what worked. Prune them after a few months if space or clutter becomes a problem.
Is a local archive enough for privacy?
It covers what you store, not what you send. The provider still receives every prompt. Local storage keeps your history out of third-party chat lists, but sensitive input should still be left out of requests.
Can I use the archive to rebuild a conversation?
Yes. Because each record holds the messages you sent and the answer received, you can load a record and resend it with a follow-up question, which is how stateless APIs handle conversations anyway.
Step by step
- Choose a folder and format — Create a drafts archive folder, ideally inside a backed-up location, and decide on JSON Lines with one record per request.
- Wrap every API call — Send all drafting requests through one small function that calls the API and writes the full request, response, settings and timing to the archive.
- Add project tags — Include a project name, a content type and a prompt version in each record so you can filter later.
- Search and reuse — Use a small search script, or any text search tool, to find past prompts by keyword, project or date, and copy good ones into your templates.
- Prune and back up — Back up the archive with your other work files, and delete or anonymise records with sensitive content on a regular schedule.
Why a stateless API leaves history to you
With a stateless API, every request carries everything the model needs: system prompt, instructions, notes and any earlier messages. The server answers and keeps no conversation record for you. That keeps things simple and avoids your drafts piling up in a third-party account, but it shifts the job of remembering onto your side.
In practice, writers lose track quickly. A prompt that produced a great product description gets edited for the next task, and the original is gone. A week later, nobody can say what temperature was used for the drafts an editor liked. A local archive solves this with very little effort.
History as working material
Old prompts and drafts are raw material. A rejected intro from one article can become the starting point for another. A prompt that worked for one category is a template for the next. An archive turns these into searchable assets.
History as evidence
Clients and editors sometimes ask where a passage came from. A record with the date, model, prompt and notes answers that question precisely, which protects you if originality or accuracy is ever disputed.
What each archive record should contain
A useful record holds everything needed to understand and reproduce the draft. That means the full messages sent, the answer, the model name the server reported, the sampling settings, token usage, timing and your own tags. Storing the whole request rather than just the prompt text is what makes later comparisons possible.
Why store the reported model
The model field in the response is the server's statement of what answered. If drafts change in style, comparing this field over time is the first check. The guide on confirming which model answers explains how to go further.
- Timestamp in UTC and a unique ID
- Project, content type and prompt version
- Model requested and model reported by the server
- Temperature, max_tokens and any other settings
- Full messages list and the full answer
- Token usage and response time
- Status: kept, edited, rejected

A small wrapper that archives every call
The function below replaces direct API calls in your scripts. It sends the request, appends a record to a JSON Lines file named after the month, and returns the answer text. Because it is the only path to the API, nothing is forgotten.
One file per month
Monthly files keep each file small enough to open in an editor, make backups incremental, and make pruning old records a matter of deleting a file. JSON Lines also survives crashes well, since each line is complete on its own.
Never store keys
If you use a paid provider, keep the API key out of the record. Store only the base URL or provider name. Archives get copied and shared far more casually than configuration files.
import json, time, uuid, datetime, pathlib
from openai import OpenAI
client = OpenAI(base_url="https://api.apifreedeepseekkey.com/v1", api_key="free")
ARCHIVE = pathlib.Path.home() / "drafts-archive"
ARCHIVE.mkdir(exist_ok=True)
def draft(messages, project, kind, prompt_version, **settings):
settings.setdefault("temperature", 0.6)
settings.setdefault("max_tokens", 800)
started = time.time()
r = client.chat.completions.create(model="free-ai", messages=messages, **settings)
answer = r.choices[0].message.content
now = datetime.datetime.now(datetime.timezone.utc)
record = {
"id": uuid.uuid4().hex, "time": now.isoformat(), "project": project, "kind": kind,
"prompt_version": prompt_version, "model_requested": "free-ai", "model_reported": r.model,
"settings": settings, "messages": messages, "answer": answer,
"usage": {"in": r.usage.prompt_tokens, "out": r.usage.completion_tokens},
"seconds": round(time.time() - started, 2), "status": "new",
}
with open(ARCHIVE / f"{now:%Y-%m}.jsonl", "a", encoding="utf-8") as f:
f.write(json.dumps(record, ensure_ascii=False) + "\n")
return answer
text = draft(
[{"role": "system", "content": "Friendly British English, short paragraphs."},
{"role": "user", "content": "Intro paragraph for a guide to watering succulents."}],
project="garden-blog", kind="intro", prompt_version="v3",
)
print(text)
Searching the archive
For a single writer, ordinary text search over the JSON Lines files is often enough. For more control, a dozen lines of Python can filter by project, kind and date, and print matching prompts with their answers. Save the search script next to the archive so anyone on the team can use it.
Over time, the most useful searches tend to be by prompt version and status. Finding every kept draft produced by version three of the intro prompt shows quickly whether version four is actually better.
Mark what you kept
Updating the status field after editing, to kept, edited or rejected, takes seconds and makes the archive far more valuable. Without it you know what was generated but not what was good.
Move to SQLite when it gets big
Once you have tens of thousands of records or several people searching, loading the files into a small SQLite database with indexes on project, kind and date makes queries instant. The JSON files can stay as the raw source.

Rebuilding conversations from records
Because each record contains the full message list, any past exchange can be continued. Load the record, append the model's answer as an assistant message, add your follow-up question and send it. That is exactly how conversations work on a stateless API, so nothing is lost by not having server-side history.
Keep in mind the context limit: on the free endpoint, 32,000 tokens covering input and answer. Long conversations need trimming, usually by dropping old turns and keeping the system prompt and the most recent exchanges.
Trim long threads deliberately
When resending an old conversation, keep the system prompt, the latest notes and the two or three most recent exchanges. Dropping older turns rarely hurts a drafting task, and it keeps each request well inside the context window and cheaper to send.
What to keep out of the archive
An archive is only private if you treat it carefully. Client names, unpublished financial figures, personal data from interviews and anything under embargo should not be in prompts in the first place, and if they are, they will be in your archive too. Decide on a retention period, and delete or redact records containing sensitive material when it expires.
Back up the archive like any other work folder, but think about where backups go. A synced folder in a consumer cloud service is convenient and may be acceptable for blog drafts, less so for client material under a confidentiality agreement.
Redact before sharing
When you share archive excerpts with a colleague or a tool vendor, strip names and identifiers first. A small script that replaces known client names with placeholders is worth writing once.
Separate personal and client work
Using a different archive folder per client keeps retention rules simple. When a contract ends, you can hand over or delete that client's folder without touching anything else.

Local archive versus local model
An archive keeps your history private; it does not keep your prompts private. The provider still receives every request. If the content itself must never leave your device, the answer is a local model, which local-first writing studios are built around. That brings hardware costs and usually lower quality than large hosted models, but full control.
Many writers combine both: a hosted model, free or paid, for general drafting with a local archive, and a local model for the few pieces that are too sensitive to send anywhere.
Same archive for both
Point the wrapper at a local OpenAI-compatible server for sensitive work and at a hosted endpoint for the rest. The archive format stays identical, which keeps searching and comparison simple across both.
Using the archive to improve prompts
Once a few hundred records have status marks, patterns become visible. Certain prompt versions produce more kept drafts. Certain temperatures produce more rejections for one content type. These are cheap, real measurements from your own work, more relevant than any general advice.
Feed those findings into your templates, and keep the records of each prompt version so you can always go back. The guide to house tests versus public benchmarks builds a small fixed test set from exactly this kind of archive, and the style diagnosis guide shows how saved settings make style problems easy to trace.
Small samples, real decisions
Even fifty marked records can show a clear preference between two prompt versions. You do not need statistics software; a simple count of kept versus rejected drafts per version, read with common sense, is enough to guide the next template change.

Send a short brief to the keyless endpoint on the home page and see what kind of first draft comes back, no account needed.
Read also
- Does a huge context window help when drafting long articles?
- How to generate title tag and meta description options at scale
- Why does an AI model switch to another language mid-draft?
- When should you schedule overnight batch drafting jobs?
- One model or two: is a planner plus cheap writer better for content?