Translate, generate and classify text through one simple API.
Click “Translate” to see the result.
Click “Generate” to see the result.
Click “Classify” to see the result.
curl https://ai.bzzoiro.com/v1/translate \
-H "Authorization: Bearer $BZZOIRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello world",
"target": "es",
"source": "auto"
}'
const res = await fetch("https://ai.bzzoiro.com/v1/generate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.BZZOIRO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Write a product description for a smartwatch",
max_tokens: 300,
}),
});
const data = await res.json();
console.log(data.output);
import os, httpx
r = httpx.post(
"https://ai.bzzoiro.com/v1/classify",
headers={"Authorization": f"Bearer {os.environ['BZZOIRO_API_KEY']}"},
json={
"text": "The customer is angry and wants refund",
"labels": ["positive", "negative", "neutral"],
},
timeout=60,
)
print(r.json())
<?php
$ch = curl_init("https://ai.bzzoiro.com/v1/translate");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("BZZOIRO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"text" => "Hello world",
"target" => "es",
]),
]);
echo curl_exec($ch);