Skip to content

AI Research API

public Information

Parameter Description Example
basePath The base path for invoking the mass api, including the fixed path /v1/ai https://genaiapi.cloudsway.net/v1/ai
endpointPath The randomly generated segment of the mass api RkBOAlaWzKcubSji
AccessKey The AccessKey for invoking the mass api RWxxxxxxxx0Gd

Request Method

POST

Request Path

{basePath}/{endpointPath}/chat/completions

Request Header

Parameter Description Example
Authorization AccessKey
Bearer ${AccessKey}
Bearer RWxxxxxxxx0Gd

Request Body

Parameter Type Description
model String Model name:Deepseek_R1_Search,Deepseek_V3_Search
stream boolean true ; false
messages List [{"role":"user", "content": "海因定理的证明"}]
max_tokens int Max tokens

Example

curl --location 'https://genaiapi.cloudsway.net/v1/ai/xxxxx/chat/completions' \
--header 'Authorization: Bearer {YOUR_ACCESS_KEY}' \
--header 'Content-Type: application/json' \
--data '{
    "model": "Deepseek_R1_Search",
    "messages": [
        {
            "role": "user",
            "content": "1+1等于几"
        }
    ],
    "stream": false,
    "stream_options": {
        "include_usage": true
    }
}'

Response Structure

In addition to the standard OpenAI response structure, reference data has been added: information from the searched web pages.

Parameter Type Description
reference List "reference": [{"name": "1+1等于几?有多少种答案 - 百度知道", "url":"https://zhidao.baidu.com/question/400830935332337885.html", "snippet": "1+1等于几?..." }, {"name": "“1+1”到底是什么?", "url": "https://baijiahao.baidu.com/s?id=1646919430155086496", "snippet": "..." }]
name Website Name称
url Website URL
snippet Website Summary

Non-streaming Response Example

{
    "id": "021741315812172e641ee46b93e8beaf1fb3bde23bbe0c6ccbaba",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "\n\n1+1在不同领域和情境中存在多种解释和答案...",
                "reasoning_content": "好的,用户问的是“1+1等于几”,..."
            },
            "finish_reason": "stop"
        }
    ],
    "created": 1741315831,
    "model": "deepseek-r1-250120",
    "object": "chat.completion",
    "usage": {
        "prompt_tokens": 1262,
        "completion_tokens": 1030,
        "total_tokens": 2292,
        "completion_tokens_details": {
            "reasoning_tokens": 572
        }
    },
    "reference": [
        {
            "name": "1+1等于几?有多少种答案 - 百度知道",
            "url": "https://zhidao.baidu.com/question/400830935332337885.html",
            "snippet": "1+1等于几?有多少种答案有12种答案。..."
        },
        {
            "name": "“1+1”到底是什么?为什么那么多数学家要去证明它",
            "url": "https://baijiahao.baidu.com/s?id=1646919430155086496",
            "snippet": "本文介绍了哥德巴赫猜想的历史和现状,..."
        }
    ]
}

Streaming Response Example

In a streaming response, reference content will be returned in the first chunk, followed by subsequent chunks structured according to the standard OpenAI response format.

data: {
    "choices": [
        {
            "delta": {
                "content": "",
                "reasoning_content": "好的",
                "role": "assistant"
            },
            "index": 0
        }
    ],
    "created": 1741316034,
    "id": "02174131603458223463574da793b897ea7fed342331c6eab8d9b",
    "model": "deepseek-r1-250120",
    "service_tier": "default",
    "object": "chat.completion.chunk",
    "reference": [
        {
            "name": "周杰伦(华语流行乐男歌手、音乐人、演员、导演、编剧 ...",
            "url": "https://baike.baidu.com/item/%E5%91%A8%E6%9D%B0%E4%BC%A6/129156",
            "snippet": "周杰伦(Jay Chou),..."
        }
    ]
}


data: {"choices":[{"delta":{"content":"","reasoning_content":",","role":"assistant"},"index":0}],"created":1741316034,"id":"02174131603458223463574da793b897ea7fed342331c6eab8d9b","model":"deepseek-r1-250120","service_tier":"default","object":"chat.completion.chunk","usage":null}

....
data: {"choices":[],"created":1741316034,"id":"02174131603458223463574da793b897ea7fed342331c6eab8d9b","model":"deepseek-r1-250120","object":"chat.completion.chunk","usage":{"completion_tokens":688,"prompt_tokens":1079,"total_tokens":1767,"prompt_tokens_details":{"cached_tokens":0},"completion_tokens_details":{"reasoning_tokens":324}}}

data: [DONE]