OpenAI client and the SDK meters it with the OpenAI recipe.
Set up
Point theOpenAI client’s baseURL at DeepSeek and wrap it:
What is reported
DeepSeek returns ausage object in OpenAI’s format with the number of tokens each call consumed. Calls are reported under the openai.chat.completions.create event name, with the same metrics as OpenAI.
DeepSeek reports its cache usage in its own fields, prompt_cache_hit_tokens and prompt_cache_miss_tokens, rather than OpenAI’s cached_tokens. If the cached_tokens metric stays at zero for your DeepSeek traffic, build a meter on raw.prompt_cache_hit_tokens to meter cache hits.
Every usage field the provider returns is also included, with a raw. prefix. See How usage is reported.
For details on DeepSeek’s API, see DeepSeek’s API docs and context caching guide.