Documentation Index
Fetch the complete documentation index at: https://liaobots.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
域名与认证
注意以下示例需要将 Authorization 中换成实际的登录码
主域名:https://ai.liaobots.work
备用域名:https://ai.liaobots1.work、https://ai.liaobots2.work、https://ai.liaobots3.work
切换域名时保留原路径后缀不变,例如 /v1、/v1beta
查询余额
通过 API 查询当前登录码的积分余额,返回总额度和剩余余额。
curl 'https://ai.liaobots.work/api/v1/credits' \
-H 'Authorization: Bearer <authcode>'
返回示例:
{
"data": {
"balance": 85.5,
"amount": 100.0
}
}
| 字段 | 说明 |
|---|
balance | 剩余可用积分 |
amount | 累计总额度 |
查询积分使用记录
在查询余额接口后添加 include_usage=true 可以同时返回详细扣款记录。接口支持通过 pageSize 控制每页数量,通过返回的 nextId 继续翻页。
curl 'https://ai.liaobots.work/api/v1/credits?include_usage=true&pageSize=50' \
-H 'Authorization: Bearer <authcode>'
返回示例:
{
"data": {
"balance": 85.5,
"amount": 100.0,
"usage": {
"pageSize": 50,
"nextId": "1234567890",
"list": [
{
"id": 1234567891,
"tokens": 1200,
"input_tokens": 800,
"output_tokens": 400,
"model": "gpt-5.4",
"price": 0.12,
"cache_hit_tokens": 0,
"cache_creation_tokens": 0,
"create_time": 1760000000000
}
]
}
}
}
| 字段 | 说明 |
|---|
usage.pageSize | 本次返回的每页数量 |
usage.nextId | 下一页游标,为空表示没有更多记录 |
usage.list[].model | 消耗对应的模型或服务 |
usage.list[].price | 本次扣除的积分 |
usage.list[].tokens | 本次总 token 数 |
usage.list[].input_tokens | 输入 token 数 |
usage.list[].output_tokens | 输出 token 数 |
usage.list[].cache_hit_tokens | 命中缓存的 token 数 |
usage.list[].cache_creation_tokens | 创建缓存的 token 数 |
usage.list[].create_time | 扣款时间,Unix 毫秒时间戳 |
OpenAI 格式(Chat Completions)
流式响应
curl --location 'https://ai.liaobots.work/v1/chat/completions' \
--header 'Authorization: Bearer <authcode>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.4",
"messages": [
{
"role": "user",
"content": "Hi"
}
],
"temperature": 1,
"stream": true
}'
非流式响应
curl --location 'https://ai.liaobots.work/v1/chat/completions' \
--header 'Authorization: Bearer <authcode>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.4",
"messages": [
{
"role": "user",
"content": "Hi"
}
],
"temperature": 1,
"stream": false
}'
Claude 格式(Anthropic Messages)
流式响应
curl 'https://ai.liaobots.work/v1/messages' \
-H 'x-api-key: <authcode>' \
-H 'anthropic-version: 2023-06-01' \
-H 'Content-Type: application/json' \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 1024,
"stream": true,
"messages": [
{
"role": "user",
"content": "Hi"
}
]
}'
非流式响应
curl 'https://ai.liaobots.work/v1/messages' \
-H 'x-api-key: <authcode>' \
-H 'anthropic-version: 2023-06-01' \
-H 'Content-Type: application/json' \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hi"
}
]
}'
OpenAI Responses API
流式响应
curl 'https://ai.liaobots.work/v1/responses' \
-H 'Authorization: Bearer <authcode>' \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-5.4",
"stream": true,
"input": "Hi"
}'
非流式响应
curl 'https://ai.liaobots.work/v1/responses' \
-H 'Authorization: Bearer <authcode>' \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-5.4",
"input": "Hi"
}'
Gemini 格式(Gemini 原生)
非流式响应
curl "https://ai.liaobots.work/v1beta/models/gemini-3-pro-preview(或其他模型):generateContent" \
-H "x-goog-api-key: <authcode>" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents": [
{
"role": "system",
"parts": [
{
"text": "You are a helpful assistant. Reply in Chinese."
}
]
},
{
"role": "user",
"parts": [
{
"text": "Explain how AI works in a few words"
}
]
}
]
}'
流式响应
curl "https://ai.liaobots.work/v1beta/models/gemini-3-pro-preview(或其他模型):streamGenerateContent?alt=sse" \
-H "x-goog-api-key: <authcode>" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents": [
{
"role": "system",
"parts": [
{
"text": "You are a helpful assistant. Reply in Chinese."
}
]
},
{
"role": "user",
"parts": [
{
"text": "Explain how AI works in a few words"
}
]
}
]
}'
Gemini Nano Banana 2/Pro
非流式响应
curl "https://ai.liaobots.work/v1beta/models/gemini-3-pro-image-preview:generateContent" \
-H "x-goog-api-key: <authcode>" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents": [
{
"parts": [
{
"text": "Generate a visualization of the current weather in Tokyo."
}
]
}
],
"tools": [
{
"googleSearch": {}
}
],
"generationConfig": {
"imageConfig": {
"aspectRatio": "1:1",
"imageSize": "2K"
},
"responseModalities":
[
"TEXT",
"IMAGE"
]
}
}
流式响应
curl "https://ai.liaobots.work/v1beta/models/gemini-3-pro-image-preview:streamGenerateContent?alt=sse" \
-H "x-goog-api-key: <authcode>" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents": [
{
"parts": [
{
"text": "Generate two dogs in manga style."
}
]
}
],
"generationConfig": {
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "1K"
},
"responseModalities":
[
"TEXT",
"IMAGE"
]
}
}