curl -X POST https://api.byleeos.my.id/api/ask \
-H "Content-Type: application/json" \
-H "x-api-key: free-001" \
-d '{
"model": "byleeos/byleeos-soft-14b",
"message": "halo bantu aku",
"history": []
}'
Copy
fetch("https://api.byleeos.my.id/api/ask",{
headers:{
"Content-Type":"application/json",
"x-api-key":"free-001"
},
method:"POST",
body:JSON.stringify({
model:"byleeos/byleeos-soft-14b",
message:"halo bantu aku",
history:[]
})
})
Copy
import requests
import json
url = "https://api.byleeos.my.id/api/ask"
headers = {"Content-Type": "application/json", "x-api-key": "free-001"}
data = {"model": "byleeos/byleeos-soft-14b", "message": "halo bantu aku", "history": []}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.text)
Copy
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.byleeos.my.id/api/ask"
data := map[string]interface{}{"model":"byleeos/byleeos-soft-14b","message":"halo bantu aku","history":[]interface{}{}}
body,_ := json.Marshal(data)
req,_ := http.NewRequest("POST", url, bytes.NewBuffer(body))
req.Header.Set("Content-Type","application/json")
req.Header.Set("x-api-key","free-001")
client := &http.Client{}
resp,_ := client.Do(req)
defer resp.Body.Close()
buf := new(bytes.Buffer)
buf.ReadFrom(resp.Body)
fmt.Println(buf.String())
}
Copy
"byleeos/byleeos-soft-14b","message"=>"halo bantu aku","history"=>[]];
$options = [
"http" => [
"header" => "Content-Type: application/json\r\nx-api-key: free-001\r\n",
"method" => "POST",
"content" => json_encode($data),
],
];
$context = stream_context_create($options);
$response = file_get_contents($url,false,$context);
echo $response;
?>
Copy
require "net/http"
require "json"
url = URI("https://api.byleeos.my.id/api/ask")
data = {model: "byleeos/byleeos-soft-14b", message: "halo bantu aku", history: []}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
req = Net::HTTP::Post.new(url.path, {'Content-Type'=>'application/json', 'x-api-key'=>'free-001'})
req.body = data.to_json
res = http.request(req)
puts res.body
Copy