Haystack (gateway)
Route Haystack’s OpenAI-compatible LLM calls through the Respan gateway to use 1000+ models from different providers. No separate OpenAI provider key is required.
Setup
Switch models
Change the model parameter on OpenAIChatGenerator to use another OpenAI model through the same gateway-backed endpoint.
OpenAIChatGenerator is Haystack’s OpenAI-compatible chat generator. Haystack 3 removed the older OpenAIGenerator, so use the chat generator with ChatPromptBuilder and ChatMessage as shown above. This page avoids showing Claude or Gemini inside that OpenAI-named component; use the Respan API or OpenAI SDK gateway pages for provider-neutral Claude and Gemini examples.
See the full model list.
Prompt management
Use Respan prompt management to store the prompt template on the platform, then pass the managed prompt_id and variables through Haystack’s generation_kwargs.extra_body.prompt. Use schema_version: 2 for all new integrations.
Haystack still requires a runtime message for OpenAIChatGenerator. The Respan gateway reads extra_body.prompt, renders the managed prompt from the platform, and uses the prompt variables for the final model request. The prompt must have a deployed version, otherwise the gateway returns a 404.
See the full Haystack examples.