Skip to content
GitHub Login

Chat Completions

Generate chat completions using an OpenAI-style chat completions API or the eighty80 sdk.

The 8080 chat completions endpoint is designed to match the OpenAI API for generating chat completions. To learn more, refer to the OpenAI docs.

curl https://api.8080.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $_8080_API_KEY" \
-d '{
"model": "8080/taalas/llama3.1-8b-instruct",
"messages": [
{
"role": "user",
"content": "Tell me a joke"
}
]
}'
Parameter
TypeDescription
messages requiredarrayA list of messages comprising the conversation so far. Supports different message types like text, images, and audio depending on the model.
model requiredstringModel ID used to generate the response, like 8080/llama-8b.
frequency_penaltynumber0
logit_biasmapnull
max_completion_tokensintegernull
ninteger1
presence_penaltynumber0
reasoning_effortstring”medium”
seedintegernull
stopstring/arraynull
streambooleanfalse
temperaturenumber1
top_pnumber1
toolsarraynull

The messages array can contain different types of messages:

  • Developer message: Instructions for the model to follow, replacing system messages in newer models
  • System message: Legacy instructions for the model (prefer developer messages for newer models)
  • User message: Messages from end users containing prompts or context
  • Assistant message: Model-generated responses
  • Tool message: Messages related to tool/function calling

Pass a tools array in the request to let the model call your functions. When the model returns tool_calls, add tool messages with the results and call the API again until the model sends a final text response. See the Tool Calling guide for the request format and a full Python example.