> For the complete documentation index, see [llms.txt](https://docs.kamiya.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kamiya.dev/kamiya-api/auth.md).

# 鉴权

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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
