{"openapi":"3.1.0","info":{"title":"Nairon Platform API","description":"OpenAI-compatible data plane: chat/speech/transcriptions/realtime/batch/knowledge-base routes, ClickHouse usage telemetry, DB-backed API-key auth. Point an OpenAI SDK's `base_url` at this host's `/v1`.","version":"0.2.5"},"paths":{"/v1/chat/completions":{"post":{"tags":["chat"],"summary":"Chat Completions","operationId":"chat_completions_v1_chat_completions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/v1/audio/speech":{"post":{"tags":["speech"],"summary":"Speech","operationId":"speech_v1_audio_speech_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/v1/audio/transcriptions":{"post":{"tags":["transcriptions"],"summary":"Transcriptions","operationId":"transcriptions_v1_audio_transcriptions_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_transcriptions_v1_audio_transcriptions_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/v1/stores":{"get":{"tags":["stores"],"summary":"List Stores","operationId":"list_stores_v1_stores_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/StoreResponse"},"type":"array","title":"Response List Stores V1 Stores Get"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["stores"],"summary":"Create Store","operationId":"create_store_v1_stores_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStoreRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/v1/stores/{store_id}":{"get":{"tags":["stores"],"summary":"Get Store","operationId":"get_store_v1_stores__store_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["stores"],"summary":"Delete Store","operationId":"delete_store_v1_stores__store_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/stores/{store_id}/information":{"post":{"tags":["stores"],"summary":"Add Information","operationId":"add_information_v1_stores__store_id__information_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInformationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InformationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["stores"],"summary":"List Information","operationId":"list_information_v1_stores__store_id__information_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InformationResponse"},"title":"Response List Information V1 Stores  Store Id  Information Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/stores/{store_id}/information/{information_id}":{"delete":{"tags":["stores"],"summary":"Remove Information","operationId":"remove_information_v1_stores__store_id__information__information_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","title":"Store Id"}},{"name":"information_id","in":"path","required":true,"schema":{"type":"string","title":"Information Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/stores/{store_id}/query":{"post":{"tags":["stores"],"summary":"Query Store Route","operationId":"query_store_route_v1_stores__store_id__query_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files":{"post":{"tags":["files"],"summary":"Create File","operationId":"create_file_v1_files_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_file_v1_files_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["files"],"summary":"List Files Route","operationId":"list_files_route_v1_files_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"purpose","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files/{file_id}":{"get":{"tags":["files"],"summary":"Get File","operationId":"get_file_v1_files__file_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["files"],"summary":"Delete File","operationId":"delete_file_v1_files__file_id__delete","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files/{file_id}/content":{"get":{"tags":["files"],"summary":"Get File Content","operationId":"get_file_content_v1_files__file_id__content_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batches":{"post":{"tags":["batches"],"summary":"Create Batch","operationId":"create_batch_v1_batches_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBatchRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["batches"],"summary":"List Batches","operationId":"list_batches_v1_batches_get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batches/{batch_id}":{"get":{"tags":["batches"],"summary":"Get Batch","operationId":"get_batch_v1_batches__batch_id__get","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batches/{batch_id}/cancel":{"post":{"tags":["batches"],"summary":"Cancel Batch","operationId":"cancel_batch_v1_batches__batch_id__cancel_post","security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["ops"],"summary":"Health check","description":"Readiness gate: healthy only once the auth-store DB pool is up — so\nno /v1 traffic is served before API keys can actually be resolved.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/v1/me":{"get":{"tags":["auth"],"summary":"Introspect the presented API key","operationId":"whoami_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhoAmIResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}}},"components":{"schemas":{"Body_create_file_v1_files_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"purpose":{"type":"string","title":"Purpose"}},"type":"object","required":["file","purpose"],"title":"Body_create_file_v1_files_post"},"Body_transcriptions_v1_audio_transcriptions_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"model":{"type":"string","title":"Model","default":"auto"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"response_format":{"type":"string","title":"Response Format","default":"json"}},"type":"object","required":["file"],"title":"Body_transcriptions_v1_audio_transcriptions_post"},"ChatCompletionRequest":{"properties":{"model":{"type":"string","title":"Model"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages"},"stream":{"type":"boolean","title":"Stream","default":false},"reasoning":{"anyOf":[{"type":"string","enum":["turbo","fast","balanced","smart"]},{"type":"null"}],"title":"Reasoning"}},"additionalProperties":true,"type":"object","required":["model","messages"],"title":"ChatCompletionRequest","description":"OpenAI chat-completions-compatible; unknown fields pass through to the\nupstream provider.\n\n``model`` accepts a catalogue tag (``llm_models.tags``) or ``\"auto\"``.\n``reasoning`` is a Nairon-specific extension consulted only when\n``model == \"auto\"`` — never forwarded upstream."},"ChatMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"title":"Content"}},"additionalProperties":true,"type":"object","required":["role"],"title":"ChatMessage","description":"A single OpenAI chat message. ``content`` may be a string or a list of\ncontent-part objects (image/audio parts) — kept as ``Any`` and forwarded\nverbatim rather than re-modeled."},"CreateBatchRequest":{"properties":{"input_file_id":{"type":"string","title":"Input File Id"},"endpoint":{"type":"string","title":"Endpoint"},"completion_window":{"type":"string","title":"Completion Window","default":"24h"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["input_file_id","endpoint"],"title":"CreateBatchRequest"},"CreateInformationRequest":{"properties":{"name":{"type":"string","minLength":1,"title":"Name"},"sourceType":{"type":"string","enum":["website","file"],"title":"Sourcetype"},"source":{"type":"string","minLength":1,"title":"Source"},"crawlMode":{"type":"boolean","title":"Crawlmode","default":false},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"content":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Content"}},"type":"object","required":["name","sourceType","source"],"title":"CreateInformationRequest"},"CreateStoreRequest":{"properties":{"name":{"type":"string","minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"CreateStoreRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InformationResponse":{"properties":{"id":{"type":"string","title":"Id"},"knowledgeBaseId":{"type":"string","title":"Knowledgebaseid"},"name":{"type":"string","title":"Name"},"sourceType":{"type":"string","title":"Sourcetype"},"source":{"type":"string","title":"Source"},"crawlMode":{"type":"boolean","title":"Crawlmode"},"indexingStatus":{"type":"string","title":"Indexingstatus"},"indexingProgress":{"type":"integer","title":"Indexingprogress"},"createdAt":{"type":"string","title":"Createdat"},"updatedAt":{"type":"string","title":"Updatedat"}},"type":"object","required":["id","knowledgeBaseId","name","sourceType","source","crawlMode","indexingStatus","indexingProgress","createdAt","updatedAt"],"title":"InformationResponse"},"QueryChunk":{"properties":{"text":{"type":"string","title":"Text"},"score":{"type":"number","title":"Score"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["text","score"],"title":"QueryChunk"},"QueryRequest":{"properties":{"query":{"type":"string","minLength":1,"title":"Query"},"top_k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Top K","default":6},"score_threshold":{"type":"number","maximum":1.0,"minimum":-1.0,"title":"Score Threshold","default":0.35}},"type":"object","required":["query"],"title":"QueryRequest"},"QueryResponse":{"properties":{"chunks":{"items":{"$ref":"#/components/schemas/QueryChunk"},"type":"array","title":"Chunks"}},"type":"object","required":["chunks"],"title":"QueryResponse"},"SpeechRequest":{"properties":{"input":{"type":"string","minLength":1,"title":"Input"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice"},"response_format":{"type":"string","title":"Response Format","default":"wav"},"speed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speed"},"stream":{"type":"boolean","title":"Stream","default":true}},"additionalProperties":true,"type":"object","required":["input"],"title":"SpeechRequest","description":"OpenAI ``/v1/audio/speech``-compatible; unknown fields pass through.\n\n``voice`` is a Nairon ``agent_voices`` id or name — resolved by the route\nhandler to a provider-specific voice parameter, so it (like ``model``) is\nexcluded from the verbatim passthrough and re-added explicitly."},"StoreResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"type":"string","title":"Status"},"createdAt":{"type":"string","title":"Createdat"},"updatedAt":{"type":"string","title":"Updatedat"}},"type":"object","required":["id","name","status","createdAt","updatedAt"],"title":"StoreResponse"},"TranscriptionResponse":{"properties":{"text":{"type":"string","title":"Text"}},"additionalProperties":true,"type":"object","required":["text"],"title":"TranscriptionResponse","description":"OpenAI ``/v1/audio/transcriptions``-compatible response. ``text`` is\nthe only field OpenAI guarantees for ``response_format=json``; extra\nfields (segments, language, duration, …) pass through for\n``verbose_json``."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WhoAmIResponse":{"properties":{"apiKeyId":{"type":"string","title":"Apikeyid"},"projectId":{"type":"string","title":"Projectid"},"organizationId":{"type":"string","title":"Organizationid"},"keyType":{"type":"string","title":"Keytype"}},"type":"object","required":["apiKeyId","projectId","organizationId","keyType"],"title":"WhoAmIResponse","description":"``GET /v1/me`` — lets a caller verify which key/project/org resolved."}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"Nairon platform secret key (nrn_sk_...) as a Bearer token","scheme":"bearer"},"APIKeyHeader":{"type":"apiKey","description":"Nairon platform secret key (nrn_sk_...)","in":"header","name":"x-api-key"}}}}