Quickstart

Three steps from key to routed traffic.

1 Β· Get a key

Claim a Starter key, or request a paid plan.

Get $1 key

2 Β· Make a routing call

Send a prompt; get back the task type and complexity tier.

curl https://138.226.222.209/v1/route \
  -H 'Authorization: Bearer cortiq_your_key' \
  -H 'content-type: application/json' \
  -d '{
    "input": { "text": "Write a Python function to reverse a list" },
    "taxonomy_id": "data-assistant"
  }'

Example response

{
  "schema_version": "1.1",
  "request_id": "req_18c98f1adb897a78001871",
  "decision": {
    "task_label": "code",
    "confidence": 0.997,
    "complexity": { "tier": "low", "score": 0.27, … },
    "source": "router", …
  },
  "scores": [ { "task_label": "code", "probability": 0.997, … }, … ],
  "usage": { "billable_decisions": 1, "oracle_calls": 0 },
  "meta": { "model_version": "data-assistant@2026.08.02", "latency_ms": 0.03, … }
}

3 Β· Map tier β†’ your model

Route easy prompts to a cheap or local model and hard ones to your flagship.

# your side β€” map the router's answer to your models
tier == "low"     β†’ cheap / local  (llama.cpp, Ollama, gpt-4o-mini)
tier == "medium"  β†’ mid
tier == "high"    β†’ flagship       (Claude, GPT-4o, …)

Don't want to write this mapping yourself? Below is a ready open-source gateway that does it for you.

⚑ cortiq-gateway β€” the ready open-source gateway

One OpenAI-compatible endpoint on top of this router: complexity-based routing out of the box, a web console at /admin (7 languages), local .cmf models plus cloud providers, and a first-run wizard. The flag-less command creates its config and opens the browser by itself.

# crates.io
cargo install cortiq-gateway
cortiq-gateway

# Docker
docker run -p 9000:9000 -v cortiq-data:/app/data ghcr.io/infosave2007/cortiq-gateway:latest

Then point any OpenAI client at base_url http://localhost:9000/v1 with model "cortiq-auto"; paste your router key in the console's Settings. Prebuilt binaries for Linux, Windows and macOS live under Releases on GitHub.

GitHub β†’ infosave2007/cortiq-gateway

4 Β· List taxonomy tasks β€” GET /v1/taxonomies

Your account's full label set in one call β€” build routing settings from the live list instead of hardcoded constants.

curl https://138.226.222.209/v1/taxonomies \
  -H 'Authorization: Bearer cortiq_your_key'

Example response

{
  "schema_version": "1.1",
  "taxonomies": [
    {
      "taxonomy_id": "data-assistant",
      "taxonomy_version": "data-assistant@1",
      "model_version": "data-assistant@2026.08.02",
      "labels": [
        "chitchat", "code", "creative-writing",
        "extraction", "math", "qa",
        "summarization", "translation"
      ]
    }
  ]
}

The full set never appears in a /v1/route response (scores carry only the top-3) β€” this endpoint is its single source. A label newly added to the taxonomy shows up here automatically.

API reference

The remaining endpoints β€” same Bearer key, same base URL.

POST /v1/route:batch

Batch classification: many prompts per call; results come back in the same order as inputs.

curl https://138.226.222.209/v1/route:batch \
  -H 'Authorization: Bearer cortiq_your_key' \
  -H 'content-type: application/json' \
  -d '{
    "taxonomy_id": "data-assistant",
    "inputs": [ { "text": "Fix this bug" }, { "text": "ΠŸΠ΅Ρ€Π΅Π²Π΅Π΄ΠΈ: Π΄ΠΎΠ±Ρ€Ρ‹ΠΉ Π²Π΅Ρ‡Π΅Ρ€" } ]
  }'
# β†’ { "results": [ { "request_id": …, "decision": { "task_label": "code", … } }, … ] }

POST /v1/feedback

Correct a wrong classification β€” pass the request_id from a /v1/route response and the right label. The router learns from your corrections.

curl https://138.226.222.209/v1/feedback \
  -H 'Authorization: Bearer cortiq_your_key' \
  -H 'content-type: application/json' \
  -d '{ "request_id": "req_…", "correct_task_label": "math" }'
# β†’ { "accepted": true, "message": "…" }

GET /v1/usage

Account usage and limits: billed decisions, oracle calls, quota and rate limit.

{
  "account": { "id": "acct_…", "billable_decisions": 98, "decision_quota": 0, "rate_per_min": 60 },
  "usage": { "cache_hits": 85, "oracle_calls": 58, "escalation_rate": 0.64, … }
}

GET /v1/taxonomies/{id}

One taxonomy by id: version, model version and the full label list.

GET /v1/healthz Β· GET /v1/readyz

Liveness and readiness checks β€” for monitoring, no auth required.