Quickstart

Your first deterministic search in two minutes

Get a key, search the global knowledge base, then index and search your own documents. Every example runs as-is once you drop in your key.

Step 1

Get an API key

Create a free account and copy your key from the dashboard. Keys start with cs_live_ and go in the Authorization header of every request. The free plan needs no credit card; quotas for each plan are on the pricing page.

You can also register over the API. The response includes your first key:

curl -X POST https://cold-api.coldstate.ai/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "at-least-8-chars", "company_name": "Acme"}'
Step 3

Index your own documents

Send your documents once and ColdState builds a searchable index. Builds are asynchronous: the call returns 202 and the index moves from queued to processing to ready.

curl -X POST https://cold-api.coldstate.ai/v1/indexes \
  -H "Authorization: Bearer cs_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support articles",
    "collection_name": "support",
    "documents": [
      { "ref_id": "kb-101", "content": "How to reset your password …" },
      { "ref_id": "kb-102", "content": "Exporting invoices as PDF …" }
    ]
  }'
Request body
namestring, required, max 200 chars — Display name for the index.
collection_namestring, max 100 chars — A name you can search by instead of the index id.
documents[].contentstring, required — The text to index.
documents[].ref_idstring — Your own reference id. It is the only identifier stored.
documents[].metadataobject — Optional metadata returned with results.
domain_presetstring — general, medical, biomedical, scientific, technical, legal, financial or ecommerce.
modehosted | iaas, default hosted — Use iaas to build the index and download it instead of hosting it.

Custom indexes are zero-knowledge: your document text is not stored, only a derived index keyed by your reference ids. Poll the index until it is ready:

curl https://cold-api.coldstate.ai/v1/indexes/idx_... \
  -H "Authorization: Bearer cs_live_..."
Step 4

Search your index

Search by index id, or by the collection name you chose:

curl -X POST https://cold-api.coldstate.ai/v1/search \
  -H "Authorization: Bearer cs_live_..." \
  -H "Content-Type: application/json" \
  -d '{"collection": "support", "query": "reset password", "limit": 5}'

Each result returns your ref_id and metadata with a score and state, so you can look the document up in your own system. The index-id form is POST /v1/indexes/:id/search and takes query, limit and offset.

Step 5

Ask why a document ranked

The explain endpoint returns a term-by-term breakdown of why a document ranked for a query. It is deterministic, so the explanation is the same every time you ask.

curl -X POST https://cold-api.coldstate.ai/v1/indexes/idx_.../explain \
  -H "Authorization: Bearer cs_live_..." \
  -H "Content-Type: application/json" \
  -d '{"query": "reset password", "doc_id": "doc_42"}'

Where to go next

Connect the MCP server to use the same key from Claude and other assistants, fetch, cite and verify facts from the knowledge base, or browse every endpoint in the API reference.