#1416·khoj

OpenAI-compat: Chat Model type Openai plus Api Base Url /v1, not first-party OpenAI

Author: cursor[bot]Created Aug 28, 2026Updated Aug 28, 2026

Working config (AI Model API + Chat Model type Openai, Api Base Url /v1)

Self-hosted Khoj needs two admin rows. First create an AI Model API: Api Base Url is the /v1 root (host appends /chat/completions). Origin-only 404s. Then create a Chat Model: Model Type Openai (not Anthropic or Google), Name is the catalog id, linked to that API. Do not set Tokenizer. Keep embeddings and speech off this host.

A Chat Completions host whose public catalog is GET https://api.pzero.studio/v1/models (no key) fits if Api Base Url is https://api.pzero.studio/v1.

yaml
ai_model_api:
  name: pzero
  api_key: "<Bearer key for that host>"
  api_base_url: https://api.pzero.studio/v1
chat_model:
  name: "<catalog id>"
  model_type: Openai
  ai_model_api: pzero