{"openapi":"3.1.0","info":{"title":"Dendrite Inference API","version":"0.1.0","description":"OpenAI-compatible standard-tier distributed inference API. See /agent-instructions.md for boundaries and safe agent behavior."},"servers":[{"url":"https://dendrite.airanger.dev"}],"paths":{"/healthz":{"get":{"operationId":"health","security":[],"responses":{"200":{"description":"Worker is live.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/providers":{"get":{"operationId":"listProviders","security":[{"clientBearer":[]}],"responses":{"200":{"description":"Currently registered providers and their advertised capabilities.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderListResponse"}}}},"401":{"description":"Client bearer token missing or invalid."}}}},"/v1/chat/completions":{"post":{"operationId":"createChatCompletion","security":[{"clientBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"Streaming SSE when stream is true or omitted; JSON chat completion otherwise.","content":{"text/event-stream":{"schema":{"type":"string"}},"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponse"}}}},"400":{"description":"Invalid JSON or missing model/messages."},"401":{"description":"Client bearer token missing or invalid."},"503":{"description":"No fresh provider advertises the exact requested model."}}}}},"components":{"securitySchemes":{"clientBearer":{"type":"http","scheme":"bearer","bearerFormat":"opaque shared token"}},"schemas":{"HealthResponse":{"type":"object","required":["ok","service","version"],"properties":{"ok":{"type":"boolean"},"service":{"type":"string"},"version":{"type":"string"}}},"ProviderListResponse":{"type":"object","required":["providers"],"properties":{"providers":{"type":"array","items":{"type":"object","required":["provider_id","trust_tier","capabilities","last_seen","active_requests"],"properties":{"provider_id":{"type":"string"},"trust_tier":{"type":"string","enum":["standard"]},"capabilities":{"type":"array","items":{"$ref":"#/components/schemas/ProviderCapability"}},"last_seen":{"type":"string","format":"date-time"},"active_requests":{"type":"integer","minimum":0}}}}}},"ProviderCapability":{"type":"object","required":["model_id","model_digest","engine","device_class","context_window","max_output_tokens","modalities","quantization","max_concurrency","streaming","request_modes"],"properties":{"model_id":{"type":"string"},"model_digest":{"type":"string"},"engine":{"type":"string"},"device_class":{"type":"string"},"context_window":{"type":"integer","minimum":1},"fast_context_window":{"type":"integer","minimum":1},"memory_tiers":{"type":"array","items":{"type":"object"}},"max_output_tokens":{"type":"integer","minimum":1},"modalities":{"type":"array","items":{"type":"string"}},"quantization":{"type":"string"},"max_concurrency":{"type":"integer","minimum":1},"streaming":{"type":"boolean"},"request_modes":{"type":"array","items":{"type":"string","enum":["coordinator-plaintext","client-sealed"]}}}},"ChatCompletionRequest":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","minLength":1,"description":"Exact capabilities[].model_id from /v1/providers."},"messages":{"type":"array","minItems":1,"items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"name":{"type":"string"},"tool_call_id":{"type":"string"}}}},"stream":{"type":"boolean","default":true},"temperature":{"type":"number"},"max_tokens":{"type":"integer","minimum":1}},"additionalProperties":true},"ChatCompletionResponse":{"type":"object","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string"},"object":{"const":"chat.completion"},"created":{"type":"integer"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object"}}}}}},"x-dendrite":{"provider_websocket":"/ws/provider","request_mode":"coordinator-plaintext","trust_tier":"standard","routing":"request-level round-robin among fresh providers advertising the exact model"}}