Recommended models
| Model | Strengths |
|---|---|
| Qwen3-Max | Best for CJK (Chinese, Japanese, Korean), strong European |
| DeepSeek-V3 | Strong across all major languages, cost-effective for volume |
Basic translation
from runcrate import Runcrate
client = Runcrate(api_key="rc_live_YOUR_API_KEY")
response = client.models.chat_completion(
model="Qwen/Qwen3-Max",
messages=[
{"role": "system", "content": "Translate to Japanese. Output only the translation."},
{"role": "user", "content": "Our new API reduces integration time from weeks to hours."}
],
)
print(response.choices[0].message.content)
import Runcrate from '@runcrate/sdk';
const rc = new Runcrate({ apiKey: 'rc_live_YOUR_API_KEY' });
const response = await rc.models.chatCompletion({
model: 'Qwen/Qwen3-Max',
messages: [
{ role: 'system', content: 'Translate to Japanese. Output only the translation.' },
{ role: 'user', content: 'Our new API reduces integration time from weeks to hours.' },
],
});
console.log(response.choices[0].message.content);
curl https://api.runcrate.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer rc_live_YOUR_API_KEY" \
-d '{"model": "Qwen/Qwen3-Max", "messages": [{"role": "system", "content": "Translate to Japanese. Output only the translation."}, {"role": "user", "content": "Our API reduces integration time from weeks to hours."}]}'
Multi-language
source = "Your account has been upgraded. You now have access to all premium features."
for lang in ["Japanese", "Spanish", "German", "Korean"]:
response = client.models.chat_completion(
model="Qwen/Qwen3-Max",
messages=[
{"role": "system", "content": f"Translate to {lang}. Output only the translation."},
{"role": "user", "content": source}
],
)
print(f"{lang}: {response.choices[0].message.content}")
Batch — localization file
import json
strings = {"welcome": "Welcome back", "upgrade": "Upgrade your plan", "settings.save": "Save changes"}
def translate_batch(strings, target):
r = client.models.chat_completion(
model="deepseek-ai/DeepSeek-V3",
messages=[
{"role": "system", "content": "Translate UI strings. Keep JSON keys unchanged. Valid JSON only."},
{"role": "user", "content": f"Translate values to {target}:\n\n{json.dumps(strings, indent=2)}"}
],
response_format={"type": "json_object"},
)
return json.loads(r.choices[0].message.content)
for code, name in [("ja", "Japanese"), ("es", "Spanish"), ("de", "German")]:
with open(f"locales/{code}.json", "w") as f:
json.dump(translate_batch(strings, name), f, indent=2, ensure_ascii=False)
Context-aware translation
response = client.models.chat_completion(
model="Qwen/Qwen3-Max",
messages=[
{"role": "system", "content": "Cloud computing translator. Translate to German. Keep API, SDK in English. Formal Sie."},
{"role": "user", "content": "Deploy your model to a GPU instance in seconds."}
],
)
Tips
- Qwen3 for CJK. More natural Chinese, Japanese, Korean output.
- DeepSeek-V3 for volume. Cheaper per token, strong European languages.