cURL
Python
JavaScript
PHP
# POST /proxy/chat
curl -X POST https://apis-zyvora.biz.id/functions/v1/proxy/chat \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gemini",
"messages": [
{"role": "user", "content": "Halo!"}
]
}'
import requests
response = requests.post(
"https://apis-zyvora.biz.id/functions/v1/proxy/chat" ,
headers={
"Authorization" : "Bearer YOUR_API_KEY" ,
"Content-Type" : "application/json" ,
},
json={
"model" : "gemini" ,
"messages" : [
{"role" : "user" , "content" : "Halo!" }
]
}
)
print(response.json()["message" ])
const res = await fetch(
"https://apis-zyvora.biz.id/functions/v1/proxy/chat" ,
{
method: "POST" ,
headers: {
"Authorization" : "Bearer YOUR_API_KEY" ,
"Content-Type" : "application/json" ,
},
body: JSON.stringify({
model: "claude" ,
messages: [
{ role: "user" , content: "Halo!" }
]
})
}
);
const data = await res.json();
console.log(data.message);
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://apis-zyvora.biz.id/functions/v1/proxy/chat" ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_POST => true ,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY" ,
"Content-Type: application/json" ,
],
CURLOPT_POSTFIELDS => json_encode([
"model" => "gemini" ,
"messages" => [[
"role" => "user" ,
"content" => "Halo!"
]]
])
]);
$result = json_decode(curl_exec($ch), true );
echo $result["message" ];
Response
{ "success": true, "model": "...", "message": "...", "usage": {...}, "response_time": "1.2s" }