Skip to main content

Fireworks

Route your Fireworks API calls through AI SpendOps for automatic usage tracking and cost attribution.

Configuration

SettingValue
Route/v1/fireworks/*
Upstreamhttps://api.fireworks.ai/inference
Auth headerAuthorization: Bearer ...
Streaming usageNative. 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

FieldDescription
prompt_tokensInput tokens
completion_tokensOutput tokens

What AI SpendOps records

FieldPopulated
cache_read_tokensNo
cache_write_tokensNo
reasoning_tokensOnly where the model returns completion_tokens_details
provider_costNo. Cost is calculated from token counts and the current Fireworks rate card

Notes

  • The proxy does not inject stream_options for Fireworks. Streamed responses carry usage natively, and any response that completes without a usage block is recorded with usage_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 /inference added again.