Bring Your Own Key: Fireworks AI
Run Abundant tools on your own Fireworks AI account. Your key, your models, your billing.
Overview
With BYOK, every model call Abundant makes is sent to Fireworks using your FIREWORKS_API_KEY. Usage, rate limits, and spend appear in your Fireworks dashboard. Abundant never stores or proxies your key.
Fireworks serves an OpenAI-compatible API, so no extra SDK is required.
Quick start
# Install
uv pip install swegen
# Add your Fireworks key
export FIREWORKS_API_KEY=<fireworks-api-key>
# Generate a task from a merged PR, powered by Fireworks
swegen create --repo axios/axios --pr 7150 --provider fireworksInstallation
uv pip install swegenCreate an API key at app.fireworks.ai/api-keys, then set these environment variables:
export GITHUB_TOKEN=<gh-token>
export FIREWORKS_API_KEY=<fireworks-api-key>Note: No other model provider keys are needed. Cloud sandbox environments (Daytona, E2B, Modal, etc.) still require their own API keys.
Configuration
Setting | Value |
Provider |
|
Base URL (OpenAI-compatible) |
|
Base URL (Anthropic-compatible) |
|
API key |
|
Model ID format |
|
Set a default model with a flag or environment variable:
swegen create --repo <owner/repo> --pr <num> \
--provider fireworks \
--model accounts/fireworks/models/kimi-k3
export ABUNDANT_PROVIDER=fireworks
export ABUNDANT_MODEL=accounts/fireworks/models/kimi-k3Options
--provider fireworks: Route all model calls through Fireworks--model ID: Fireworks model resource name (see the Fireworks model library)--base-url URL: Override the endpoint (default:https://api.fireworks.ai/inference/v1)
Verify your key
curl https://api.fireworks.ai/inference/v1/chat/completions \
-H "Authorization: Bearer $FIREWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "accounts/fireworks/models/kimi-k3",
"messages": [{"role": "user", "content": "Say hi in one word."}]
}'A 200 response with a completion means you’re ready.
Using the SDK directly
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.fireworks.ai/inference/v1",
api_key=os.environ["FIREWORKS_API_KEY"],
)
response = client.chat.completions.create(
model="accounts/fireworks/models/kimi-k3",
messages=[{"role": "user", "content": "Summarize this PR."}],
)
print(response.choices[0].message.content)Troubleshooting
- 401 Unauthorized: Key is missing, mistyped, or revoked. Regenerate it in the Fireworks console.
- 404 model not found: Use the full resource name, e.g.
accounts/fireworks/models/<model>. - 429 Too Many Requests: You’ve hit your Fireworks rate limit. Lower concurrency or raise your limits in your Fireworks account.
Security
- Keys are read from your environment and sent only to
api.fireworks.ai. - Never commit
FIREWORKS_API_KEYto version control. - Rotate keys any time from the Fireworks console.