Skip to content

Chat Completions

POST
/project/p-{Project_Id}/endpoint/is-{Endpoint_Id}/v1/chat/completions
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
}'

Generate chat completions using a deployed model endpoint. Supports any model deployed via TIR Inference Service, following the OpenAI-compatible chat completions API format.

Project_Id
required
string

Path parameter Project_Id.

Endpoint_Id
required
string
project_id
required
integer

Project ID

Media typeapplication/json
object
model
required

The model identifier to use for completion.

string

Example

your-model-name
messages
required

A list of messages comprising the conversation so far.

Array<object>
object
role
string
Allowed values: user system assistant

Example

user
content
string

Example

Hello!!
max_tokens

Maximum number of tokens to generate in the response.

integer

Example

512
temperature

Controls randomness. Lower values make output more deterministic, higher values more creative.

number

Example

0.7
top_p

Nucleus sampling probability mass. Only tokens with cumulative probability up to top_p are considered.

number

Example

1
top_k

Limits the number of highest-probability tokens considered at each step.

integer

Example

50
frequency_penalty

Penalizes tokens based on how frequently they have appeared in the text so far.

number

Example

0
stream

If true, responses are streamed as server-sent events.

boolean

Example

false

Successful chat completion response.

Media typeapplication/json
object
id

Unique identifier for the completion.

string
object

Object type, always chat.completion.

string
created

Unix timestamp of when the completion was created.

integer
model

The model used for the completion.

string
choices

List of generated completion choices.

Array<object>
object
index
integer
message
object
role
string
content
string
refusal
string
nullable
tool_calls
Array<object>
object
reasoning
string
nullable
logprobs
string
nullable
finish_reason
string
stop_reason
string
nullable
token_ids
string
nullable
service_tier
string
nullable
system_fingerprint
string
nullable
usage
object
prompt_tokens
integer
completion_tokens
integer
total_tokens
integer
prompt_tokens_details
string
nullable
prompt_logprobs
string
nullable
prompt_token_ids
string
nullable
kv_transfer_params
string
nullable

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
}