Welcome to the XTHK API Documentation

This API allows you to interact with the XTHK system. Below is the information you need to get started:

API Endpoint

https://api.xthk.aischat.xyz/v1/chat/completions

API Key

You need a valid API key to access the API. Example keys include:

Supported Models

Example Code


import requests

url = "https://api.xthk.aischat.xyz/v1/chat/completions"
api_key = "sk-freekey"
headers = {
    "Authorization": "Bearer {}".format(api_key),
}
data = {
    "messages": [
        {"role": "user", "content": "默写出并翻译《活版》全文"}
    ],
    "stream": False, # 启用流式改为 True
    "model": "xthk-1",
}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print("Request successful")
    print(response.json())
else:
    print(f"Request failed with status code {response.status_code}")
    print(response.text)