# 鉴权

Kamiya API使用API Key作为鉴权凭据。

### 检查API端点

```
GET https://p0.kamiya.dev/api/checkNetwork
```

返回示例

```json
{
    "status":200,
    "ip":"103.186.212.127",
    "message":"OK"
}
```

## 鉴权方式

Kamiya API使用HTTP Header中的`Authorization`字段作为鉴权方式，需要将API Key以Bearer Token的方式传入。

以获取API Key所关联的账户详情为例

```http
GET https://p0.kamiya.dev/api/session/getDetails
```

Headers应包含

```json
{
  "Authorization": "Bearer sk-cAPqidPQEZlHQ2T09iKYwOeWz9ZF5VUbbCgSPxNtivnpCV67"
}
```

返回示例

```json
{
    "status": 200,
    "message": "OK",
    "data": {
        "email": "example@example.com",
        "role": "Normal", 
        "credit": 17993.36,
        "active": true
    },
    "useNAIFallback": false
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kamiya.dev/kamiya-api/auth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
