POST
/
completions

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required

A string providing context for the model to complete.

model
enum<string>
default: meta-llama/Meta-Llama-3.1-8B-Instructrequired

The name of the model to query See all of Horay.ai's chat models

Available options:
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,
nvidiaLlama-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,
deepseek-ai/DeepSeek-V2.5,
Gryphe/MythoMax-L2-13b
max_tokens
integer

The maximum number of tokens to generate.

stop
string[]

A list of string sequences that will truncate (stop) inference text output. For example, "</s>" will stop generation as soon as the model generates the given token.

temperature
number

A decimal number from 0-1 that determines the degree of randomness in the response. A temperature less than 1 favors more correctness and is appropriate for question answering or summarization. A value closer to 1 introduces more randomness in the output.

top_p
number

A percentage (also called the nucleus parameter) that's used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities. It specifies a probability threshold below which all less likely tokens are filtered out. This technique helps maintain diversity and generate more fluent and natural-sounding text.

top_k
integer

An integer that's used to limit the number of choices for the next predicted word or token. It specifies the maximum number of tokens to consider at each step, based on their probability of occurrence. This technique helps to speed up the generation process and can improve the quality of the generated text by focusing on the most likely options.

repetition_penalty
number

A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition.

stream
boolean

If true, stream tokens as Server-Sent Events as the model generates them instead of waiting for the full model response. The stream terminates with data: [DONE]. If false, return a single JSON object containing the results.

n
integer

The number of completions to generate for each prompt.

Required range: 1 < x < 128
presence_penalty
number

A number between -2.0 and 2.0 where a positive value increases the likelihood of a model talking about new topics.

frequency_penalty
number

A number between -2.0 and 2.0 where a positive value decreases the likelihood of repeating tokens that have already been mentioned.

logit_bias
object

Adjusts the likelihood of specific tokens appearing in the generated output.

seed
integer

If specified, the system will make its best effort to perform deterministic sampling, so repeated requests with the same seed and parameters should return the same results. Determinism is not guaranteed to be implemented; the system_fingerprint response parameter should be referenced to monitor backend changes.

Response

200 - application/json
id
string
required
choices
object[]
required
usage
object
required
created
integer
required
model
string
required
object
enum<string>
required
Available options:
text_completion
prompt
object[]