curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/project/p-{Project_Id}/endpoint/is-{Endpoint_Id}/v1/chat/completions?project_id=<PROJECT_ID>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "model": "your-model-name", "messages": [ { "role": "user", "content": "Hello!!" } ], "max_tokens": 512, "temperature": 0.7, "top_p": 1, "top_k": 50, "frequency_penalty": 0, "stream": false}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/project/p-{Project_Id}/endpoint/is-{Endpoint_Id}/v1/chat/completions", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "model": "your-model-name", "messages": [ { "role": "user", "content": "Hello!!", }, ], "max_tokens": 512, "temperature": 0.7, "top_p": 1, "top_k": 50, "frequency_penalty": 0, "stream": False, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/project/p-{Project_Id}/endpoint/is-{Endpoint_Id}/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({ "model": "your-model-name", "messages": [ { "role": "user", "content": "Hello!!" } ], "max_tokens": 512, "temperature": 0.7, "top_p": 1, "top_k": 50, "frequency_penalty": 0, "stream": false }),});console.log(await response.json());Generate chat completions using a deployed model endpoint. Supports any model deployed via TIR Inference Service, following the OpenAI-compatible chat completions API format.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Path parameter Project_Id.
Query Parameters
Section titled “Query Parameters”Project ID
Request Body
Section titled “Request Body”object
The model identifier to use for completion.
Example
your-model-nameA list of messages comprising the conversation so far.
object
Example
userExample
Hello!!Maximum number of tokens to generate in the response.
Example
512Controls randomness. Lower values make output more deterministic, higher values more creative.
Example
0.7Nucleus sampling probability mass. Only tokens with cumulative probability up to top_p are considered.
Example
1Limits the number of highest-probability tokens considered at each step.
Example
50Penalizes tokens based on how frequently they have appeared in the text so far.
Example
0If true, responses are streamed as server-sent events.
Example
falseResponses
Section titled “Responses”Successful chat completion response.
object
Unique identifier for the completion.
Object type, always chat.completion.
Unix timestamp of when the completion was created.
The model used for the completion.
List of generated completion choices.
object
object
object
object
Example
{ "id": "chatcmpl-ab36a36c-2315-472f-9e58-0f68f19b8bf8", "object": "chat.completion", "created": 1776750085, "model": "meta-llama/Llama-3.2-1B-Instruct", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "In Nature's embrace, I find my peace,\nA world of wonder, a world to cease,\nFrom mountains high to valleys low,\nA tapestry of life, in all its glow.", "refusal": null, "tool_calls": [], "reasoning": null }, "logprobs": null, "finish_reason": "stop", "stop_reason": null, "token_ids": null } ], "service_tier": null, "system_fingerprint": null, "usage": { "prompt_tokens": 40, "completion_tokens": 274, "total_tokens": 314, "prompt_tokens_details": null }, "prompt_logprobs": null, "prompt_token_ids": null, "kv_transfer_params": null}