Haystack
SDKs & frameworksdeepset's pipelines for RAG and agents.
Fill the guide with your values
Stays in this browser tab — never sent or stored by us. Sign in to create one
Setup
- 1Use
OpenAIChatGeneratorwithapi_base_url=https://api.ultragpt.pro/v1.
# pip install haystack-ai
from haystack.components.generators.chat import OpenAIChatGenerator
from haystack.dataclasses import ChatMessage
from haystack.utils import Secret
llm = OpenAIChatGenerator(
api_key=Secret.from_env_var("ULTRAGPT_API_KEY"),
api_base_url="https://api.ultragpt.pro/v1",
model="grok-4.7",
)
print(llm.run([ChatMessage.from_user("Hello!")])["replies"][0].text)Tips
- Any model id from Models works; suffixes like :online (web search) and :nitro work too.
- Give each tool its own key with a spend limit, so usage shows separately in Activity.
- Something off? Error codes · Support