Skip to main content

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.

Domains & Authentication

Note: The following examples need to replace the Authorization with the actual Login Code
Primary domain: https://ai.liaobots.work
Backup domains: https://ai.liaobots1.work, https://ai.liaobots2.work, https://ai.liaobots3.work
Keep the same path suffix when switching domains, such as /v1 or /v1beta

Check Balance

Query remaining credits for your auth code.
Curl
curl 'https://ai.liaobots.work/api/v1/credits' \
  -H 'Authorization: Bearer <authcode>'
Response:
{
  "data": {
    "balance": 85.5,
    "amount": 100.0
  }
}
FieldDescription
balanceRemaining available credits
amountTotal credits received

Check Credit Usage Records

Add include_usage=true to the balance endpoint to return detailed credit usage records. Use pageSize to control page size, and pass the returned nextId to fetch the next page.
Curl
curl 'https://ai.liaobots.work/api/v1/credits?include_usage=true&pageSize=50' \
  -H 'Authorization: Bearer <authcode>'
Response:
{
  "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
        }
      ]
    }
  }
}
FieldDescription
usage.pageSizePage size returned by this request
usage.nextIdCursor for the next page. Empty means there are no more records
usage.list[].modelModel or service used
usage.list[].priceCredits charged for this record
usage.list[].tokensTotal token count
usage.list[].input_tokensInput token count
usage.list[].output_tokensOutput token count
usage.list[].cache_hit_tokensCache hit token count
usage.list[].cache_creation_tokensCache creation token count
usage.list[].create_timeCharge time as a Unix millisecond timestamp

OpenAI Format (Chat Completions)

Streaming Response

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
}'

Non-Streaming Response

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 Format (Anthropic Messages)

Streaming Response

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"
        }
    ]
}'

Non-Streaming Response

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

Streaming Response

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"
}'

Non-Streaming Response

curl 'https://ai.liaobots.work/v1/responses' \
  -H 'Authorization: Bearer <authcode>' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-5.4",
    "input": "Hi"
}'

Gemini Format (Gemini Native)

Non-Streaming Response

Curl
curl "https://ai.liaobots.work/v1beta/models/gemini-3-pro-preview(or other models):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"
          }
        ]
      }
    ]
  }'

Streaming Response

Curl
curl "https://ai.liaobots.work/v1beta/models/gemini-3-pro-preview(or other models):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

Non-Streaming Response

Curl
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"
          ]
      }
  }

Streaming Response

Curl
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"
          ]
      }
  }