Skip to main content

Translate Text

POST 

/openai/v1/chat/completions

Translate text between Bambara, French and English.

Text translation has no dedicated endpoint in the OpenAI shape, so Djelia's translation model is addressed as a chat model. The text to translate is the last user message; the language pair comes from extra_body.

client.chat.completions.create(
model="banjugu-1",
messages=[{"role": "user", "content": "Bonjour"}],
extra_body={"djelia": {"source_language": "fra_Latn", "target_language": "bam_Latn"}},
)

Languages use FLORES-200 codes: bam_Latn, fra_Latn, eng_Latn.

What usage counts depends on the model. banjugu-1 is metered per character and reports characters; djelia-translate-v2 is metered per token and reports tokens. Either way it reports what you are actually billed for.

Ignored: temperature, top_p, n, max_tokens, stop, presence_penalty, frequency_penalty, logit_bias, logprobs, top_logprobs, seed, user, response_format, tools, tool_choice, store, metadata, service_tier. Djelia's translation model is not a general chat model and has no tool use.

Request​

Responses​

The translation. stream=true returns chat.completion.chunk events instead.