Prerequisites
- Python 3.10 or higher, or Node.js 22 or higher
- An Anchor API key from the Anchor dashboard
- A Fireworks API key from app.fireworks.ai

Setup
- Set your API keys:
- Install dependencies:
playwright install. The browser runs in Anchor, and Playwright only connects to it over CDP.
Quick example: a Fireworks agent in an Anchor browser
The script below:- Creates an Anchor session with a 5 minute limit.
- Connects Playwright to it over CDP.
- Gives a Fireworks model two tools,
gotoandget_text, and lets it call them until it has an answer, for up to 8 steps. - Ends the session, even if something fails along the way.
accounts/fireworks/models/glm-5p3-flash by default. Set FIREWORKS_MODEL to try another model with function calling, such as accounts/fireworks/models/kimi-k3p1-pro, accounts/fireworks/models/deepseek-v4p1-flash-1017 or accounts/fireworks/models/minimax-m3.
await, which needs "type": "module" in your package.json. The install step sets it with npm pkg set type=module.
Expected output
goto({"url":"https://github.com/trending"}).
This is the page the model was reading in the Anchor session:

Use Fireworks with Anchor’s built-in agent (BYOK)
If you’d rather not write the agent loop yourself, Anchor’sperform-web-task agent can run on your Fireworks key through Bring Your Own Keys.
- In the Anchor dashboard, open Project Settings, scroll to BYOK and click Add Key.
- Pick Custom / OpenAI-compatible, name the key
fireworks, paste your Fireworks API key and set the base URL tohttps://api.fireworks.ai/inference/v1. - Click Verify & Save. Anchor makes a live test call before it stores the key.
byok_web_task.py
provider is optional. If you send it, it has to be custom to match the stored key, otherwise Anchor rejects the request. The current SDKs don’t have a key_slug parameter yet, so this example calls the REST API directly.
The task leaves its browser session running when it finishes, so the example ends it using the sessionId from the response.
Expected output:
glm-5p3-flash, deepseek-v4p1-flash-1017 and minimax-m3.
Token usage for each model shows up in Fireworks under Analytics, on the Serverless tab.

Next steps
- Add proxies or captcha solving for sites that block automated browsers
- Sign your agent into web apps with Managed Authentication
- Watch or debug runs with session recordings and live view
- Browse the Fireworks model library for other models with function calling

