Fireworks
Route your Fireworks API calls through AI SpendOps for automatic usage tracking and cost attribution.
Configuration
| Setting | Value |
|---|---|
| Route | /v1/fireworks/* |
| Upstream | https://api.fireworks.ai/inference |
| Auth header | Authorization: Bearer ... |
| Streaming usage | Native. stream_options is not injected |
SDK base URL
https://proxy.aispendops.com/v1/fireworks/v1
Example
curl https://proxy.aispendops.com/v1/fireworks/v1/chat/completions \
-H "Authorization: Bearer your-fireworks-key" \
-H "X-ASO-API-Key: aso_k_yourkey.secret" \
-H "Content-Type: application/json" \
-d '{"model":"accounts/fireworks/models/llama-v3p3-70b-instruct","messages":[{"role":"user","content":"Hello"}]}'
Model names are fully qualified
Fireworks model identifiers are account-scoped paths, not bare names:
accounts/fireworks/models/llama-v3p3-70b-instruct
This matters for cost attribution in two ways. First, your own fine-tuned models
carry your account in the path (accounts/your-account/models/...), so they are
distinct entries in AI SpendOps rather than being folded in with the base model.
Second, if you set model allow-lists on an ASO
key, the entry has to be the full path, not llama-v3p3-70b-instruct.
Serverless and dedicated are billed differently
Fireworks offers both on-demand serverless inference, billed per token, and dedicated deployments, billed for reserved capacity by time rather than by usage.
AI SpendOps measures requests, so it captures serverless spend accurately and cannot see the cost of a dedicated deployment. A reserved GPU costs the same whether you send it one request an hour or a thousand, and nothing in the API response reflects that. If you run dedicated deployments, treat the AI SpendOps figure as your variable inference cost and add the reserved capacity separately from your Fireworks invoice.
The per-request data is still useful in that case, because it tells you the utilisation of the capacity you are already paying for.
Usage fields
| Field | Description |
|---|---|
prompt_tokens | Input tokens |
completion_tokens | Output tokens |
What AI SpendOps records
| Field | Populated |
|---|---|
cache_read_tokens | No |
cache_write_tokens | No |
reasoning_tokens | Only where the model returns completion_tokens_details |
provider_cost | No. Cost is calculated from token counts and the current Fireworks rate card |
Notes
- The proxy does not inject
stream_optionsfor Fireworks. Streamed responses carry usage natively, and any response that completes without a usage block is recorded withusage_source: estimate. See Streaming. - Note the upstream path already includes
/inference, so the SDK base URL above is correct as written and should not have/inferenceadded again.