Skip to content

Sarvam Translate

POST
/project/p-{Project_Id}/genai/sarvam_translate/v1/chat/completions
curl --request POST \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/project/p-{Project_Id}/genai/sarvam_translate/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": 300,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 1,
"stream": false,
"model": "sarvam_translate",
"messages": [
{
"role": "system",
"content": "Translate the text below to Hindi."
},
{
"role": "user",
"content": "Can you write a poem about open source machine learning?"
}
]
}'

Sarvam Translate is a multilingual translation model specializing in Indian languages, enabling seamless translation across multiple language pairs.

Project_Id
required
string

Path parameter Project_Id.

project_id
required
integer

Project ID

Media typeapplication/json
object
temperature
number

Example

0.5
max_tokens
integer

Example

300
top_p
number

Example

1
frequency_penalty
number

Example

0
presence_penalty
number

Example

1
stream
boolean

Example

false
model
string

Example

sarvam_translate
messages
Array<object>
object
role
string
Allowed values: system user

Example

system
content
string

Example

Translate the text below to Hindi.

Example

[
{
"role": "system",
"content": "Translate the text below to Hindi."
},
{
"role": "user",
"content": "Can you write a poem about open source machine learning?"
}
]

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
reasoning_content
string
nullable
content

The translated text

string
tool_calls
Array<string>
logprobs
string
nullable
finish_reason
string
stop_reason
string
nullable
usage
object
prompt_tokens
integer
total_tokens
integer
completion_tokens
integer
prompt_tokens_details
string
nullable
prompt_logprobs
string
nullable
kv_transfer_params
string
nullable

Example

{
"id": "chatcmpl-5bf016be-7107-4157-98d7-badbf5293e95",
"object": "chat.completion",
"created": 1770614476,
"model": "sarvam_translate",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "क्या आप ओपन सोर्स मशीन लर्निंग के बारे में कविता लिख सकते हैं?",
"tool_calls": []
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"total_tokens": 43,
"completion_tokens": 15
}
}