Translation
Context-aware English-Korean / Korean-English translation that leverages previous dialogues to ensure unmatched coherence and continuity in your conversations.
Available models
Model | Release date | Context Length | Description |
---|---|---|---|
solar-1-mini-translate-enkobeta | 2024-05-22 | 32768 | English-to-Korean translation specialized model based on the Solar Mini.solar-1-mini-translate-enko is alias for our latest Solar Mini Translation enko model. (Currently solar-1-mini-translate-enko-240507 ) |
solar-1-mini-translate-koenbeta | 2024-05-22 | 32768 | Korean-to-English translation specialized model based on the Solar Mini.solar-1-mini-translate-koen is alias for our latest Solar Mini Translation koen model. (Currently solar-1-mini-translate-koen-240507 ) |
Request
POST https://api.upstage.ai/v1/solar/chat/completions
Parameters
The messages
parameter is a list of message objects. Each message object has a role
(which can be one of "user", or "assistant") and content
. The "system" role is not used in the translation API.
A user
message is what the user inputs. Through a user message, users can request the translation of a sentence. The assistant
message can either record the previous response from the assistant or be the result of the translation. With multi-turn input, Translation API dynamically adapts to your conversation tone, intelligently translating only the latest message for a seamless experience.
Currently, timeout for non-stream mode is 60 seconds. Please use stream mode for long text translation.
Request headers
Authorization string Required |
Request body
messages list Required |
messages[].content string Required |
messages[].role string Required |
model string Required |
max_tokens integer Optional |
stream boolean Optional |
temperature float Optional |
top_p float Optional |
Response
Return values
Returns a chat.completion
object, or a streamed sequence of chat.completion.chunk
objects if the request is streamed.
The chat completion object
id string |
object string |
created integer |
model string |
system_fingerprint null |
choices list |
choices[].finish_reason string |
choices[].index integer |
choices[].message object |
choices[].message.content string |
choices[].message.role string |
choices[].logprobs null |
usage object |
usage.completion_tokens integer |
usage.prompt_tokens integer |
usage.total_tokens integer |
The chat completion chunk object
id string |
object string |
created integer |
model string |
system_fingerprint null |
choices list |
choices[].finish_reason string |
choices[].index integer |
choices[].delta object |
choices[].delta.content string |
choices[].delta.role string or null |
choices[].logprobs null |
Example
Request
curl --location 'https://api.upstage.ai/v1/solar/chat/completions' \
--header 'Authorization: Bearer UPSTAGE_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "solar-1-mini-translate-koen",
"messages": [
{
"role": "user",
"content": "아버지가방에들어가셨다"
},
{
"role": "assistant",
"content": "Father went into his room"
},
{
"role": "user",
"content": "엄마도들어가셨다"
}
]
}'
Response
{
"id": "3e5649eb-50aa-416a-b999-92a3eb75b0d5",
"object": "chat.completion",
"created": 1708441325,
"model": "solar-1-mini-translate-koen-240507",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Mother went into her room"
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 37,
"completion_tokens": 10,
"total_tokens": 47
},
"system_fingerprint": null
}