Skip to content

Feature Request: Add xAI/Grok support for custom/manual logging #5552

@karthvp

Description

@karthvp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions