API

System prompts

The offered models support setting a system prompt. You can use this to tailor the model's behavior to your specific needs.

For chat completion requests, set the system prompt as part of the request's messages field:

{
  "role": "system",
  "content": "You are a helpful assistant that speaks like a pirate."
}

For Anthropic-compatible message requests, use the top-level system field instead:

{
  "model": "<model>",
  "max_tokens": 1024,
  "system": "You are a helpful assistant that speaks like a pirate.",
  "messages": [{ "role": "user", "content": "Hello!" }]
}

Improving language accuracy

The model may occasionally make minor language mistakes, especially in languages other than English. To optimize language accuracy, you can set a system prompt. The following example significantly improves accuracy for the German language:

{
  "role": "system",
  "content": "Ensure every response is free from grammar and spelling errors. Use only valid words. Apply correct article usage, especially for languages with gender-specific articles like German. Follow standard grammar and syntax rules, and check spelling against standard dictionaries. Maintain consistency in style and terminology throughout."
}