{"openapi":"3.1.0","info":{"title":"Fucking Opencode","version":"0.1.6","description":"OpenCode 免费层网关：OpenAI Chat Completions、Anthropic Messages、OpenAI Responses。"},"servers":[{"url":"http://127.0.0.1:20134"}],"paths":{"/health":{"get":{"summary":"健康状态与身份/网关诊断","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/metrics":{"get":{"summary":"Prometheus 指标（设置 METRICS_TOKEN 后需 Bearer）","responses":{"200":{"description":"text/plain","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/models":{"get":{"summary":"当前可用的免费模型","responses":{"200":{"description":"模型列表","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/models/{model}":{"get":{"summary":"单个模型","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"模型条目","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"模型不存在"}}}},"/v1/chat/completions":{"post":{"summary":"OpenAI Chat Completions（支持 stream）","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"完成体或 SSE 流"},"401":{"description":"缺少或无效的 API key"},"429":{"description":"上游额度或网关并发上限"}}}},"/v1/completions":{"post":{"summary":"OpenAI 旧版 Completions（翻译成 Chat 后回译）","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"text_completion 或 SSE 流"}}}},"/v1/embeddings":{"post":{"summary":"不提供：上游免费层无 embeddings","responses":{"501":{"description":"embeddings_not_supported"}}}},"/v1/messages":{"post":{"summary":"Anthropic Messages（支持 stream）","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Anthropic 完成体或事件流"}}}},"/v1/messages/count_tokens":{"post":{"summary":"Anthropic 词元近似计数（不触上游）","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"{ input_tokens }"}}}},"/v1/responses":{"post":{"summary":"OpenAI Responses（支持 stream）","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Responses 结果"}}}}}}