CortexDB Docs
Operations

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.

RoleModelWhy
Embeddingstext-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-miniCheapest reliable extraction model; about $0.40 per 1,000 events.
Answersgpt-5.6-terraBest quality per dollar; about 2 to 4 cents per answer.
Answers, budget optiongpt-5.6-lunaAbout 0.2 to 0.4 cents per answer, for high-volume or simpler questions.
Answers, premium optiongpt-5.6-sol or gpt-6-astra4 to 7 cents or 11 to 18 cents per answer, only where answer quality is the product.

Terra, Luna and Sol were each run as CORTEX_ANSWER_MODEL on v0.9.13 and v0.9.8 (CORTEX_ANSWER_PROVIDER=openai) and returned correct answers.

gpt-6-astra does not work on the answer lane yet

CortexDB sends max_tokens to the answer model; gpt-6-astra rejects it (HTTP 400 unsupported_parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead), so every answer fails with ANSWER_PROVIDER_ERROR. Verified on v0.9.13 and v0.9.8; clearing CORTEX_ANSWER_MAX_TOKENS does not help. Use gpt-5.6-sol for premium answers until a server release sends max_completion_tokens.

# 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 v0.9.13 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/50

The answer model is chosen per deployment by CORTEX_ANSWER_MODEL. A per-request answer_model on /v1/answer is not applied on v0.9.13 (the server calls the configured model and only echoes the requested name in diagnostics.answer_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

ItemCost
Load and enrich 10,000 events (one time)about $4
Each additional 1,000 eventsabout $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 answerunder $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 on v0.9.13:

Set CORTEX_MODEL_PRICES for GPT-5.6 and GPT-6 models

The v0.9.13 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_model is not applied on v0.9.13, answers requested with one appear (correctly) under the configured CORTEX_ANSWER_MODEL; diagnostics.answer_model on the response is the echoed request, not the model used.
  • Entity extraction is unpriced. That lane reports one combined token number and no model name, so the ledger shows it under __unknown__ with unpriced_calls rather than dollars. Price it yourself at the extraction model's rates.

List prices

OpenAI list prices, September 2026, USD per million tokens (source):

ModelInputCached inputOutput
text-embedding-3-small0.02——
gpt-4o-mini0.150.0750.60
gpt-5.6-luna0.200.021.20
gpt-5.6-terra2.000.2012.00
gpt-5.6-sol4.000.4020.00 (promotional, at least through 21 November 2026)
gpt-6-astra10.001.0050.00

On this page