POST
/project/p-{Project_Id}/genai/llama3_1_8b_instruct/v1/chat/completions
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/project/p-{Project_Id}/genai/llama3_1_8b_instruct/v1/chat/completions?project_id=<PROJECT_ID>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "temperature": 0.5, "max_tokens": 1024, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 1, "stream": false, "model": "llama3_1_8b_instruct", "messages": [ { "role": "user", "content": "Hello" } ]}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/project/p-{Project_Id}/genai/llama3_1_8b_instruct/v1/chat/completions", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "temperature": 0.5, "max_tokens": 1024, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 1, "stream": False, "model": "llama3_1_8b_instruct", "messages": [ { "role": "user", "content": "Hello", }, ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/project/p-{Project_Id}/genai/llama3_1_8b_instruct/v1/chat/completions");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "temperature": 0.5, "max_tokens": 1024, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 1, "stream": false, "model": "llama3_1_8b_instruct", "messages": [ { "role": "user", "content": "Hello" } ] }),});console.log(await response.json());Llama 3.1 represents Meta’s most advanced language model to date. It integrates state-of-the-art techniques in natural language processing to deliver unparalleled performance in various tasks.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project_Id
required
string
Path parameter Project_Id.
Query Parameters
Section titled “Query Parameters”project_id
required
integer
Project ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
temperature
number
max_tokens
integer
top_p
number
frequency_penalty
number
presence_penalty
number
stream
boolean
model
string
Example
llama3_1_8b_instructmessages
Array<object>
object
role
string
Example
usercontent
string
Example
HelloResponses
Section titled “Responses”default
Section titled “default”Successful response (Non-streaming)
Media typeapplication/json
object
id
string
object
string
created
integer
model
string
choices
Array<object>
object
index
integer
message
object
role
string
content
string
tool_calls
Array<string>
logprobs
string
finish_reason
string
stop_reason
string
usage
object
prompt_tokens
integer
completion_tokens
integer
total_tokens
integer
Example
{ "id": "chat-a8fa533f74b346688f780c3b2e14638f", "object": "chat.completion", "created": 1738753122, "model": "llama3_1_8b_instruct", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "It looks like we're saying hello twice. How's your day going so far?", "tool_calls": [] }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 56, "completion_tokens": 18, "total_tokens": 74 }}