const apiKey = "SYNAPSE-API_KEY";
fetch('https://synapse.rifqydev.my.id/api/chat', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_key: apiKey,
model: "google/gemini-2.5-flash",
prompt: "Jelaskan apa itu DNS."
})
})
.then(res => res.json())
.then(data => console.log(data.response));
import requests
url = "https://synapse.rifqydev.my.id/api/chat"
payload = {
"api_key": "SYNAPSE-API_KEY",
"model": "google/gemini-2.5-flash",
"prompt": "Jelaskan apa itu DNS."
}
response = requests.post(url, json=payload)
print(response.json()["response"])
<?php
$url = 'https://synapse.rifqydev.my.id/api/chat';
$data = [
'api_key' => 'SYNAPSE-API_KEY',
'model' => 'google/gemini-2.5-flash',
'prompt' => 'Jelaskan apa itu DNS.'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
echo json_decode($response, true)['response'];
?>
curl -X POST https://synapse.rifqydev.my.id/api/chat \
-H "Content-Type: application/json" \
-d '{
"api_key": "SYNAPSE-API_KEY",
"model": "google/gemini-2.5-flash",
"prompt": "Jelaskan apa itu DNS."
}'
package main
import (
"bytes"
"net/http"
"fmt"
)
func main() {
url := "https://synapse.rifqydev.my.id/api/chat"
payload := []byte(`{"api_key":"SYNAPSE-API_KEY","model":"google/gemini-2.5-flash","prompt":"Jelaskan DNS."}`)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println("Request Sent!")
}
import okhttp3.*;
public class Main {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
String json = "{\"api_key\":\"SYNAPSE-API_KEY\",\"model\":\"google/gemini-2.5-flash\",\"prompt\":\"Jelaskan DNS.\"}";
RequestBody body = RequestBody.create(mediaType, json);
Request request = new Request.Builder()
.url("https://synapse.rifqydev.my.id/api/chat")
.post(body)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://synapse.rifqydev.my.id/api/chat");
var content = new StringContent("{\n \"api_key\": \"SYNAPSE-API_KEY\",\n \"model\": \"google/gemini-2.5-flash\",\n \"prompt\": \"Jelaskan DNS.\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());