CloudTalkAPI
CloudtalkAPI は、高性能な会話生成およびタスク処理を提供する API です。複数の AI モデルを活用して、自然な対話生成やタスクの実行が可能です。簡単な入力インターフェースを持ち、幅広いシナリオで活用できます。
導入用途
カスタマーサポートの自動化 サポートボットを通じて、顧客の質問に迅速かつ正確に応答します。
コンテンツ生成の効率化 ジョーク、物語、ブログ記事など、さまざまなコンテンツを自動生成します。
教育アシスタント 質問への回答や課題のサポートを行い、教育現場での利用をサポートします。
会話型アプリケーションの構築 人工知能を活用したチャットボットや仮想アシスタントを作成します。
クリエイティブライティングの補助 執筆支援やアイデアのブレインストーミングに役立ちます。
Base URL
https://cloudtalk-mixederapi.mixeder.com/
Endpoints
POST /
指定されたタスクを処理し、会話の生成または関連タスクの実行を行います。
Headers
ヘッダー名
必須
説明
Content-Type
はい
application/json
Request Body
パラメーター名
必須
説明
key
はい
使用する API キー
system
いいえ
AI モデルに与えるシステムプロンプト(デフォルト: "You are a helpful assistant.")
user
いいえ
ユーザーからの入力メッセージ(デフォルト: "Who won the world series in 2020?")
Response
成功時: HTTP Status: 200 Body:
{ "message": "API authentication, task processing, and billing completed successfully", "username": "user", "tasks": [ { "inputs": { "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Who won the world series in 2020?" } ] }, "response": { "response": "The Los Angeles Dodgers won the World Series in 2020, defeating the Tampa Bay Rays in six games (4-2). It was the Dodgers' first World Series title since 1988!" } } ], "billingResponse": "{\"status\":\"success\"}" }
エラー時: HTTP Status: 400 または 500 Body:
{ "error": "Error message" }
サンプルコード
JavaScript Fetch Example
async function processTasks(apiKey, system, user, prompt) {
const apiUrl = 'https://cloudtalk-mixederapi.mixeder.com/';
const body = {
key: apiKey,
system: system || 'You are a helpful assistant.',
user: user || 'Who won the world series in 2020?'
};
try {
const response = await fetch(apiUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
});
if (!response.ok) {
throw new Error(`API error: ${response.statusText}`);
}
const data = await response.json();
console.log('Tasks processed successfully:', data.tasks);
return data.tasks;
} catch (error) {
console.error('Error during task processing:', error.message);
throw error;
}
}
// 使用例
processTasks('your-api-key')
.then((tasks) => console.log('Tasks:', tasks))
.catch((err) => console.error('Task processing failed:', err));
Python Requests Example
import requests
def process_tasks(api_key, system=None, user=None, prompt=None):
api_url = 'https://cloudtalk-mixederapi.mixeder.com/'
payload = {
"key": api_key,
"system": system or "You are a helpful assistant.",
"user": user or "Who won the world series in 2020?"
}
try:
response = requests.post(api_url, json=payload)
response.raise_for_status()
data = response.json()
print("Tasks processed successfully:", data["tasks"])
return data["tasks"]
except requests.exceptions.RequestException as e:
print("Error during task processing:", e)
raise
# 使用例
process_tasks("your-api-key")
cURL Example
curl -X POST https://cloudtalk-mixederapi.mixeder.com/ \
-H "Content-Type: application/json" \
-d '{
"key": "your-api-key",
"system": "You are a helpful assistant.",
"user": "Who won the world series in 2020?"
}'
最終更新
役に立ちましたか?