Cost Planning
What a self-hosted CortexDB costs to run in model spend — recommended models, per-event and per-answer costs, monthly estimates, and how to replace them with your own numbers.
CortexDB itself has no per-token charge: you pay your model provider for the lanes you turn on.
Bottom line. For a corpus of about 10,000 events, loading and enriching everything costs about $4 one time, and each answered question costs about 2 to 4 cents on the recommended model. At 10,000 questions a month that is roughly $220 to $400 a month in LLM spend; searches without a generated answer cost almost nothing. Question volume drives the cost, not corpus size.
Recommended models
| Role | Model | Why |
|---|---|---|
| Embeddings | text-embedding-3-small | $0.02 per million tokens; cost is negligible at any corpus size. On a high-end machine you can run embeddings locally instead (Embeddings). |
| Enrichment (facts and entities extracted from each event) | gpt-4o-mini | Cheapest reliable extraction model; about $0.40 per 1,000 events. |
| Answers | gpt-5.6-terra | Best quality per dollar; about 2 to 4 cents per answer. |
| Answers, budget option | gpt-5.6-luna | About 0.2 to 0.4 cents per answer, for high-volume or simpler questions. |
| Answers, premium option | gpt-5.6-sol or gpt-6-astra | 4 to 7 cents or 11 to 18 cents per answer, only where answer quality is the product. |
Terra, Luna and Sol all work as CORTEX_ANSWER_MODEL (CORTEX_ANSWER_PROVIDER=openai).
Use gpt-5.6-sol for premium answers
gpt-6-astra expects max_completion_tokens rather than the max_tokens CortexDB sends, so on the
answer lane it answers ANSWER_PROVIDER_ERROR. Use gpt-5.6-sol for premium answers.
# Embeddings (the image default; only the key is needed)
CORTEX_EMBEDDING_API_KEY=sk-...
# Entity extraction lane
CORTEX_LLM_URL=https://api.openai.com/v1
CORTEX_LLM_MODEL=gpt-4o-mini
CORTEX_ENTITY_API_KEY=sk-...
# Enrichment (Facts, Beliefs, Understanding); DELAY_SECONDS is required to switch it on
CORTEX_ENRICHMENT_URL=https://api.openai.com/v1
CORTEX_ENRICHMENT_MODEL=gpt-4o-mini
CORTEX_ENRICHMENT_API_KEY=sk-...
CORTEX_ENRICHMENT_DELAY_SECONDS=5
# Answers
CORTEX_ANSWER_PROVIDER=openai
CORTEX_ANSWER_URL=https://api.openai.com/v1
CORTEX_ANSWER_MODEL=gpt-5.6-terra
CORTEX_ANSWER_API_KEY=sk-...
# Rates the built-in price book does not have (USD per million tokens, input/output); see below
CORTEX_MODEL_PRICES=gpt-5.6-terra=2/12,gpt-5.6-luna=0.2/1.2,gpt-5.6-sol=4/20,gpt-6-astra=10/50The answer model is chosen per deployment by CORTEX_ANSWER_MODEL. A per-request answer_model on
/v1/answer is only echoed in diagnostics.answer_model (the server calls the configured model), so to serve simple questions on Luna, run a second
deployment (or a second answer service) whose lane is set to gpt-5.6-luna.
Estimate
| Item | Cost |
|---|---|
| Load and enrich 10,000 events (one time) | about $4 |
| Each additional 1,000 events | about $0.40 |
| Each answered question, Terra | $0.02 to $0.04 |
| Each answered question, Luna | $0.002 to $0.004 |
| Each search without a generated answer | under $0.001 |
| 1,000 answers a month, Terra | $22 to $40 |
| 10,000 answers a month, Terra | $220 to $400 |
| 100,000 answers a month, Terra | $2,200 to $4,000 |
The range on answers covers the model's reasoning tokens, which OpenAI bills as output. All rates are OpenAI list prices as of September 2026; multiply by your own negotiated rates if they differ.
Assumptions
Events average about 150 tokens (a chat turn or a short note); long documents cost more to enrich.
Answers use the default context size, about 10,000 input tokens per question. The verifier lane is off
in the configuration above (it switches on if OPENAI_API_KEY or CORTEX_VERIFIER_API_KEY is set, and
then adds one gpt-4.1 call per verified answer).
CortexDB's built-in usage dashboard reports the actual tokens and spend per role, so these estimates can be replaced with measured numbers after the first week.
Reading your real numbers
GET /v1/admin/usage (and Observability → Tokens & cost in the Admin Console)
reports exact tokens per role and model. Three things to know before you trust its dollar column:
Set CORTEX_MODEL_PRICES for GPT-5.6 and GPT-6 models
The price book has no rates for gpt-5.6-* or gpt-6-*. Instead of reporting those calls as
unpriced, it bills gpt-5.6-terra at the gpt-5 rate ($1.25 / $10 per million), which understates Terra
by about a third. Set CORTEX_MODEL_PRICES as in the configuration above. The override applies to calls
made after it is set; calls already recorded keep the rate they were priced at, so re-price older
windows yourself from the token columns.
- The ledger records the model that was actually called. Because a per-request
answer_modelis not applied, answers requested with one appear (correctly) under the configuredCORTEX_ANSWER_MODEL;diagnostics.answer_modelon the response is the echoed request, not the model used. - Entity extraction is priced. Each entity call records its input and output tokens and its model,
and the ledger shows it under
entity_extraction, priced onCORTEX_LLM_MODEL(the enrichment model when that is unset). Usage recorded by older releases sits under__unknown__withunpriced_calls: price those windows yourself at the extraction model's rates. IfCORTEX_LLM_MODELnames a model the price book does not know, declare its rate inCORTEX_MODEL_PRICES.
Governed memory spend
Governed memory adds spend you control with caps:
| Spend | Cap |
|---|---|
| Ongoing extraction under a derivation policy | The policy's budget_usd_per_day: once spent, its extraction waits for the next UTC midnight |
| Policy tests and re-extraction dry runs | CORTEX_DERIVATION_BUDGET_USD per tenant per UTC day (default 5 US dollars); a test's own max_cost_usd (default 1) |
| A re-extraction job | The cap_usd you approve, at most CORTEX_DERIVATION_BUDGET_MAX_USD (default 500) |
| An undo's re-extraction of what a rejection kept out | The daily extraction budget |
A regate calls no model and costs nothing. A model a budget cannot price spends the whole day's
budget, because no dollar cap can hold an unpriced model: declare its rate in CORTEX_MODEL_PRICES.
List prices
OpenAI list prices, September 2026, USD per million tokens (source):
| Model | Input | Cached input | Output |
|---|---|---|---|
text-embedding-3-small | 0.02 | — | — |
gpt-4o-mini | 0.15 | 0.075 | 0.60 |
gpt-5.6-luna | 0.20 | 0.02 | 1.20 |
gpt-5.6-terra | 2.00 | 0.20 | 12.00 |
gpt-5.6-sol | 4.00 | 0.40 | 20.00 (promotional, at least through 21 November 2026) |
gpt-6-astra | 10.00 | 1.00 | 50.00 |
Related
- Token & Cost Ledger — measured tokens and dollars per role.
- LLM & Answer Generation — the four lanes and their settings.
- Embeddings — hosted vs local embeddings by hardware.
- Profiles & Presets — ready-made configurations.
Token & Cost Ledger
GET /v1/admin/usage — durable per-role token and dollar accounting, what it measures exactly, what it only bounds, and what it refuses to price.
Benchmarking
How CortexDB 0.14.2 scored 95.4% on LongMemEval-S and 92.8% on LoCoMo — the server configuration, the harness, how the answers were scored, and how to rerun them.