Small demo workspace for calling Fireworks AI through OpenAI-compatible APIs and the OpenAI Agents SDK.
openai_agents_sdk.py- OpenAI Agents SDK demo. It creates aFileListeragent with a locallist_filesfunction tool and uses Fireworks for model inference.response_api.py- Minimal OpenAI-compatible Responses API call against Fireworks.setup_venv.sh- Helper script that createsvenv312with Homebrew Python 3.12 and installsopenai-agents.requirements.txt- Pinned Python dependencies from the working environment.index.html- Standalone tic-tac-toe landing page/demo. Open it directly in a browser.
From this directory:
./setup_venv.sh
source venv312/bin/activateOr, if you already have a virtual environment:
python -m pip install -r requirements.txtBoth Python demos default to:
https://api.fireworks.ai/inference/v1
accounts/fireworks/models/glm-5p2
Before running, add your Fireworks API key in the Python file:
FIREWORKS_API_KEY = "ADD YOUR API KEY HERE!"For shared code, prefer reading the key from the environment instead of committing it:
export FIREWORKS_API_KEY="your_fireworks_key"Agents SDK tool-calling demo:
python openai_agents_sdk.pySimple Responses API demo:
python response_api.pyStandalone HTML page:
open index.htmlThe Fireworks model ID contains slashes: accounts/fireworks/models/glm-5p2. If that string is passed directly as an Agents SDK model name, the SDK may interpret accounts as a provider prefix and raise:
agents.exceptions.UserError: Unknown prefix: accounts
openai_agents_sdk.py avoids that by constructing an explicit OpenAIChatCompletionsModel with an AsyncOpenAI client pointed at the Fireworks base URL.
Do not commit real API keys. If a real key was ever saved in this folder, rotate it in Fireworks.