Summary
Add xAI (Grok) provider support for the custom/manual logging endpoint, enabling cost calculation for xAI requests logged via the Manual Logger SDK.
Current Behavior
When using the Manual Logger (@helicone/helpers) or the /custom/v1/log endpoint with xAI/Grok models:
- Provider shows as "unknown" in the dashboard
- Cost calculation returns "Cost Unsupported"
- The
provider: "X" field in the payload is not recognized
Expected Behavior
- Provider should be identified as "X" or "xAI"
- Cost calculation should work using the existing xAI pricing in
packages/cost/providers/x/index.ts
- Ideally, a dedicated
/x/v1/log route (similar to /oai/v1/log, /anthropic/v1/log)
Context
The cost package already has xAI pricing defined with URL pattern matching for the gateway (/^https:\/\/api\.x\.ai/), but this pattern matching doesn't apply to the custom logging endpoint.
The providerRoutes map in the SDK only includes:
- OPENAI → oai
- ANTHROPIC → anthropic
- GOOGLE → googleapis
Adding X → x (or similar) would enable xAI support.
Workaround
Currently, the only way to get xAI cost tracking is through the gateway (x.helicone.ai), which isn't always feasible for async/manual logging use cases.
Related
Summary
Add xAI (Grok) provider support for the custom/manual logging endpoint, enabling cost calculation for xAI requests logged via the Manual Logger SDK.
Current Behavior
When using the Manual Logger (
@helicone/helpers) or the/custom/v1/logendpoint with xAI/Grok models:provider: "X"field in the payload is not recognizedExpected Behavior
packages/cost/providers/x/index.ts/x/v1/logroute (similar to/oai/v1/log,/anthropic/v1/log)Context
The cost package already has xAI pricing defined with URL pattern matching for the gateway (
/^https:\/\/api\.x\.ai/), but this pattern matching doesn't apply to the custom logging endpoint.The
providerRoutesmap in the SDK only includes:Adding
X → x(or similar) would enable xAI support.Workaround
Currently, the only way to get xAI cost tracking is through the gateway (
x.helicone.ai), which isn't always feasible for async/manual logging use cases.Related