Issue about "developer" role in Assistant API

Hello guys,

I’m currently working with the Assistants API (v2) and tried to send a message to a thread using role: "developer" in the body payload. However, I received the following error:

Invalid value: ‘developer’. Supported values are: ‘user’ and ‘assistant’.

I confirmed that:

My intention was to use role: "developer" to inject internal system-level data into the thread — things like company name, hours of operation, city, business rules, etc. These values are dynamic and change per client, and I would like the assistant to consider them when generating a response, but not treat them as user messages.

Since these are relatively small structured texts, I wanted to avoid setting up a full RAG pipeline, and instead use developer messages as a lightweight way to supply context dynamically.

Can you confirm:

  1. Is this a valid intended use of the developer role?
  2. Are there any known limitations or requirements to enable its use?
  3. If developer is not the right approach for this use case, what would be the recommended method?

Thanks in advance for your guidance!

Marcus

The correct parameter to use is on a run, and is called additional_instructions. This allows you to place transitional data into the authoritative message beyond that of “instructions”. It is still positioned at the start of context, and you cannot inject system messages the way that OpenAI is doing so after tool returns, unless using Chat Completions for complete context control.

3 Likes

Interesting, I will test it. Thank you!

Is there a limit of token to inject in this field?

There were character count limitations for the instructions fields in Assistants, but those should now be lifted to above any practical need, 256,000 characters.