{
  "openapi": "3.0.3",
  "info": {
    "title": "纳雪 API 常用接口",
    "version": "2026-10-15",
    "description": "Common interface subset. Consult the full guide for streaming, tools, group permissions and billing."
  },
  "servers": [
    {
      "url": "https://api.xxxiai.com/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/models": {
      "get": {
        "summary": "查询模型",
        "description": "Requires a Naxue key with the matching group and protocol. A listed model is not proof of live availability.",
        "responses": {
          "200": {
            "description": "JSON response or SSE stream, depending on request; inspect terminal events."
          },
          "401": {
            "description": "Missing or invalid key"
          }
        }
      }
    },
    "/responses": {
      "post": {
        "summary": "Responses",
        "description": "Requires a Naxue key with the matching group and protocol. A listed model is not proof of live availability.",
        "responses": {
          "200": {
            "description": "JSON response or SSE stream, depending on request; inspect terminal events."
          },
          "401": {
            "description": "Missing or invalid key"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "type": "string"
                  },
                  "stream": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/chat/completions": {
      "post": {
        "summary": "Chat Completions",
        "description": "Requires a Naxue key with the matching group and protocol. A listed model is not proof of live availability.",
        "responses": {
          "200": {
            "description": "JSON response or SSE stream, depending on request; inspect terminal events."
          },
          "401": {
            "description": "Missing or invalid key"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/messages": {
      "post": {
        "summary": "Anthropic Messages",
        "description": "Requires a Naxue key with the matching group and protocol. A listed model is not proof of live availability.",
        "responses": {
          "200": {
            "description": "JSON response or SSE stream, depending on request; inspect terminal events."
          },
          "401": {
            "description": "Missing or invalid key"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "max_tokens",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "anthropic-version",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2023-06-01"
            }
          }
        ]
      }
    },
    "/images/generations": {
      "post": {
        "summary": "图片生成",
        "description": "Requires a Naxue key with the matching group and protocol. A listed model is not proof of live availability.",
        "responses": {
          "200": {
            "description": "JSON response or SSE stream, depending on request; inspect terminal events."
          },
          "401": {
            "description": "Missing or invalid key"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "size": {
                    "type": "string"
                  },
                  "n": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}