今天我要给大家介绍团队的最新项目——一个集成了ChatGPT-3.5/4.0、Claude3、文心一言、通义千问、智谱AI等多个AI模型的API模型聚合平台。仅需使用一个接口就可以对接所有AI模型
网址:https://api.atalk-ai.com/

为什么要创建这个平台?
随着不同的AI模型陆续问世,每个模型都有其独特的优势和用途。但是,要同时与多个模型交互通常需要切换不同的平台和接口,这不仅耗时而且效率低下。
因此,团队萌生了一个想法:为什么不创建一个一站式的平台,让用户能够通过单一的接口与多个模型交流呢?这样,用户就可以轻松地比较不同模型的表现,并根据需要选择最合适的一个。于是诞生了这个API聚合平台-海鲸AI
支持的模型
海鲸AI支持的AI模型覆盖了当前市场上的多个主流选项,包括但不限于:
| 品牌 | 模型 |
|---|---|
| ChatGPT | gpt-3.5-turbo,gpt-4-turbo,gpt-4-turbo-2024-04-09,gpt-4-1106-preview,gpt-4-vision-preview |
| Claude 3 | claude-3-sonnet-20240229,claude-3-opus-20240229,claude-3-haiku-20240307 |
| 文心一言 | ERNIE-3.5-8K |
| 通义千问 | qwen-turbo,qwen-plus,qwen-max |
| 智谱AI | glm-3-turbo,glm-4,glm-4v |
调用方式
1、获取APIkey
可通过登录API聚合平台获取APIkey,登录后可获取5元的体验券,来调用API
2、查看API文档,并进行接口调用
通过一个接口即可对接国际主流AI模型,兼容性这边已经帮大家处理好了,无脑对接即可
API文档地址:https://api.atalk-ai.com/api#/operations/post-gpt-completions-messages

3、各个语言的调用示例
java
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "https://api.atalk-ai.com/gpt/completions")
.setHeader("Authorization", "")
.setHeader("Content-Type", "application/json")
.setBody("{n "messages": [n {n "role": "system",n "content": "You are a helpful assistant."n },n {n "role": "assistant",n "content": "can i help you ?"n },n {n "role": "user",n "content": "Hello!"n }n ],n "model": "gpt-3.5-turbo",n "max_tokens": 1000,n "stream": true,n "temperature": 0.2n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
python3
import http.client
conn = http.client.HTTPSConnection("api.atalk-ai.com")
payload = "{n "messages": [n {n "role": "system",n "content": "You are a helpful assistant."n },n {n "role": "assistant",n "content": "can i help you ?"n },n {n "role": "user",n "content": "Hello!"n }n ],n "model": "gpt-3.5-turbo",n "max_tokens": 1000,n "stream": true,n "temperature": 0.2n}"
headers = {
'Authorization': "",
'Content-Type': "application/json"
}
conn.request("POST", "/gpt/completions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
NodeJS
const axios = require('axios').default;
const options = {
method: 'POST',
url: 'https://api.atalk-ai.com/gpt/completions',
headers: {Authorization: '', 'Content-Type': 'application/json'},
data: {
messages: [
{role: 'system', content: 'You are a helpful assistant.'},
{role: 'assistant', content: 'can i help you ?'},
{role: 'user', content: 'Hello!'}
],
model: 'gpt-3.5-turbo',
max_tokens: 1000,
stream: true,
temperature: 0.2
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
PHP
<?php $client = new GuzzleHttpClient();
$response = $client->request('POST', 'https://api.atalk-ai.com/gpt/completions', [
'body' => '{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "assistant",
"content": "can i help you ?"
},
{
"role": "user",
"content": "Hello!"
}
],
"model": "gpt-3.5-turbo",
"max_tokens": 1000,
"stream": true,
"temperature": 0.2
}',
'headers' => [
'Authorization' => '',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
海鲸AI-API聚合平台是我们对AI技术无限探索的一次尝试。它不仅简化了与多个AI模型的交互过程,也为用户提供了一个高效、便捷的解决方案。我相信,随着AI技术的不断进步,海鲸AI将成为您实现创意和解决问题的得力助手。
文章来源于互联网:一个API接口对接ChatGPT3.5/4.0,Claude3,文心一言,通义千问,智谱AI等多款AI模型,打造属于自己的AI应用
ChatGPT和文心一言都是当前人工智能领域的热门产品,它们都具有各自独特的优点和缺点。以下是对这两款产品的对比: ChatGPT的优点: 强大的自然语言处理能力:ChatGPT经过大量的数据训练,能够模拟人类对话,表达思想和感情,提供更加自然流畅的回答。 多…
5bei.cn大模型教程网










