AI智能类
zhipuAI & v1

2024-08-30 02:15:28

Start Me
Pasta

累计调用:1001

头像
客源
未开源

专注于企业级API开发与架构设计,5年以上开发经验

智谱AI

GET

全栈自研GLM架构,数十万亿tokens中英双语训练,综合能力接近 GPT-4-Turbo,最高推理速度达到 80 tokens/s ,超出人类极限阅读速度(300字/分钟)的 25 倍。

接口地址: https://api.qster.top/API/v1/zhipuAI
接口示例: https://api.qster.top/API/v1/zhipuAI/?msg=你好

请求参数

参数名 类型 必填 说明
msg string 问题
model string 模型,默认glm-4,模型编码:glm-4-plus、glm-4v-plus、glm-4-0520、glm-4 、glm-4-air、glm-4-airx、glm-4-long、glm-4-flash、glm-4v、glm-4-9b、glm-3-turbo
qskey string 申请临时密钥

响应参数

参数 说明
problem 问题
answer 答案
model 模型
code 200正常400失败 查看更多

代码示例

<?php
// 要调用的 URL
$url = "https://api.qster.top/API/v1/zhipuAI";

// 参数数组
$params = [
"msg" => "问题",
"model" => "模型,默认glm-4,模型编码:glm-4-plus、glm-4v-plus、glm-4-0520、glm-4 、glm-4-air、glm-4-airx、glm-4-long、glm-4-flash、glm-4v、glm-4-9b、glm-3-turbo",
"qskey" => "0",
];

// 使用 http_build_query 将参数转换为查询字符串
$queryString = http_build_query($params);

// 在 URL 中添加查询字符串
$finalUrl = $url . '?' . $queryString;

// 使用 file_get_contents 获取内容
$response = file_get_contents($finalUrl);

// 输出响应
echo $response;
?>

import requests

url = "https://api.qster.top/API/v1/zhipuAI";
params = {
"msg" : "问题",
"model" : "模型,默认glm-4,模型编码:glm-4-plus、glm-4v-plus、glm-4-0520、glm-4 、glm-4-air、glm-4-airx、glm-4-long、glm-4-flash、glm-4v、glm-4-9b、glm-3-turbo",
"qskey" => "0"
}
response = requests.get(url, params=params)
print(response.text)

function fetchData(url, params) {

const queryString = Object.keys(params)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
.join('&');
const fullUrl = `${url}?${queryString}`;

fetch(fullUrl)
.then(response => response.text())
.then(data => {
const resultElement = document.createElement('pre');
resultElement.textContent = data;
document.body.appendChild(resultElement);
})
.catch(error => console.error('Error fetching data:', error));
}

// 示例用法
const url = "https://api.qster.top/API/v1/zhipuAI";
const params = {
"msg" : "问题",
"model" : "模型,默认glm-4,模型编码:glm-4-plus、glm-4v-plus、glm-4-0520、glm-4 、glm-4-air、glm-4-airx、glm-4-long、glm-4-flash、glm-4v、glm-4-9b、glm-3-turbo",
"qskey" => "0"
};
fetchData(url, params);

在线调试