curl --request POST \
--url https://api.horay.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"messages": [
{
"role": "user",
"content": "Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?"
}
],
"stream": false,
"max_tokens": 512,
"stop": [
"<string>"
],
"temperature": 0.7,
"top_p": 0.7,
"top_k": 50,
"frequency_penalty": 0.5,
"n": 1
}
EOFimport requests
url = "https://api.horay.ai/v1/chat/completions"
payload = {
"model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"messages": [
{
"role": "user",
"content": "Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?"
}
],
"stream": False,
"max_tokens": 512,
"stop": ["<string>"],
"temperature": 0.7,
"top_p": 0.7,
"top_k": 50,
"frequency_penalty": 0.5,
"n": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'meta-llama/Meta-Llama-3.1-8B-Instruct',
messages: [
{
role: 'user',
content: 'Unlock your AI Creativity with Horay.ai\'s Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?'
}
],
stream: false,
max_tokens: 512,
stop: ['<string>'],
temperature: 0.7,
top_p: 0.7,
top_k: 50,
frequency_penalty: 0.5,
n: 1
})
};
fetch('https://api.horay.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.horay.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'meta-llama/Meta-Llama-3.1-8B-Instruct',
'messages' => [
[
'role' => 'user',
'content' => 'Unlock your AI Creativity with Horay.ai\'s Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?'
]
],
'stream' => false,
'max_tokens' => 512,
'stop' => [
'<string>'
],
'temperature' => 0.7,
'top_p' => 0.7,
'top_k' => 50,
'frequency_penalty' => 0.5,
'n' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.horay.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"meta-llama/Meta-Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 512,\n \"stop\": [\n \"<string>\"\n ],\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.horay.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"meta-llama/Meta-Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 512,\n \"stop\": [\n \"<string>\"\n ],\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.horay.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"meta-llama/Meta-Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 512,\n \"stop\": [\n \"<string>\"\n ],\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"choices": [
{
"message": {
"role": "assistant",
"content": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"created": 123,
"model": "<string>",
"object": "chat.completion"
}"<string>""<string>""<string>""<string>""<string>""<string>"Chat Completions
Creates a model response for the given chat conversation.
curl --request POST \
--url https://api.horay.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"messages": [
{
"role": "user",
"content": "Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?"
}
],
"stream": false,
"max_tokens": 512,
"stop": [
"<string>"
],
"temperature": 0.7,
"top_p": 0.7,
"top_k": 50,
"frequency_penalty": 0.5,
"n": 1
}
EOFimport requests
url = "https://api.horay.ai/v1/chat/completions"
payload = {
"model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"messages": [
{
"role": "user",
"content": "Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?"
}
],
"stream": False,
"max_tokens": 512,
"stop": ["<string>"],
"temperature": 0.7,
"top_p": 0.7,
"top_k": 50,
"frequency_penalty": 0.5,
"n": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'meta-llama/Meta-Llama-3.1-8B-Instruct',
messages: [
{
role: 'user',
content: 'Unlock your AI Creativity with Horay.ai\'s Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?'
}
],
stream: false,
max_tokens: 512,
stop: ['<string>'],
temperature: 0.7,
top_p: 0.7,
top_k: 50,
frequency_penalty: 0.5,
n: 1
})
};
fetch('https://api.horay.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.horay.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'meta-llama/Meta-Llama-3.1-8B-Instruct',
'messages' => [
[
'role' => 'user',
'content' => 'Unlock your AI Creativity with Horay.ai\'s Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?'
]
],
'stream' => false,
'max_tokens' => 512,
'stop' => [
'<string>'
],
'temperature' => 0.7,
'top_p' => 0.7,
'top_k' => 50,
'frequency_penalty' => 0.5,
'n' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.horay.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"meta-llama/Meta-Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 512,\n \"stop\": [\n \"<string>\"\n ],\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.horay.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"meta-llama/Meta-Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 512,\n \"stop\": [\n \"<string>\"\n ],\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.horay.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"meta-llama/Meta-Llama-3.1-8B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Unlock your AI Creativity with Horay.ai's Blazing Fast, Affordable and Production Ready API, What impact will it have on the industry?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 512,\n \"stop\": [\n \"<string>\"\n ],\n \"temperature\": 0.7,\n \"top_p\": 0.7,\n \"top_k\": 50,\n \"frequency_penalty\": 0.5,\n \"n\": 1\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"choices": [
{
"message": {
"role": "assistant",
"content": "<string>"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"created": 123,
"model": "<string>",
"object": "chat.completion"
}"<string>""<string>""<string>""<string>""<string>""<string>"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The name of the model to query.
meta-llama/Meta-Llama-3.1-405B-Instruct, meta-llama/Meta-Llama-3.1-70B-Instruct, meta-llama/Meta-Llama-3.1-8B-Instruct, meta-llama/Llama-3.2-1B-Instruct, meta-llama/Llama-3.2-3B-Instruct, nvidia/Llama-3.1-Nemotron-70B-Instruct, google/gemma-2-27b-it, google/gemma-2-9b-it, Qwen/Qwen2.5-72B-Instruct, Qwen/Qwen2.5-Coder-32B-Instruct, Qwen/Qwen2.5-7B-Instruct, Qwen/Qwen2-72B-Instruct, Gryphe/MythoMax-L2-13b, gpt-4o-2024-11-20, gpt-4o-2024-08-06, gpt-4o-mini, o1-preview, o1-mini, claude-3-5-sonnet-v2@20241022, claude-3-5-sonnet@20240620 "meta-llama/Meta-Llama-3.1-8B-Instruct"
A list of messages comprising the conversation so far.
1 - 10 elementsShow child attributes
Show child attributes
If set, tokens are returned as Server-Sent Events as they are made available. Stream terminates with data: [DONE]
false
The maximum number of tokens to generate.
1 <= x <= 4096512
A list of string sequences that will truncate (stop) inference text output.
Determines the degree of randomness in the response.
0.7
The top_p (nucleus) parameter is used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities.
0.7
50
0.5
Number of generations to return
1