Home → Help

The system prompt behaves differently across models

OpenAI-style APIs carry the system instruction as the first message in the messages array. Anthropic-style APIs take it as a separate top-level system parameter. A translation layer that maps one onto the other has to move it, and some do it by turning it into a user turn.

What you are seeing

Why it happens

Because both shapes are valid JSON for the other, mistakes rarely produce an error. The request succeeds and the instruction simply carries less weight, which looks like the model being worse rather than a wiring problem.

Multiple system messages are another divergence. Some implementations concatenate them, others keep only the first, and a few reject the request.

Reasoning models add a third variant: some treat developer instructions separately from user-visible system text, so where you put an instruction changes whether it survives into the reasoning step.

How to fix it

  1. Keep one system message, firstOne system message at the start of the array works everywhere. Splitting instructions across several is where implementations diverge.
  2. Test the instruction, not the response codeAsk the model to state its instruction back when you change providers. A 200 proves nothing about whether the instruction landed.
  3. Avoid depending on system-only behaviour for hard rulesIf a constraint really matters, restate it in the user turn as well. It costs a few tokens and survives every translation layer.
APICLAN exposes both shapes on the same key: /v1/chat/completions for the OpenAI form and /v1/messages for the Anthropic form. Use the endpoint that matches the model family and the system instruction needs no translation at all.

Related

Unexpected token '<' when calling an OpenAI-compatible API401 invalid API key — when the key looks right but still fails

Last checked 2026-10-01. Written from problems diagnosed on a live OpenAI-compatible gateway, not collected from other sites.