# DeepSeek

> See what you spend on DeepSeek and who uses it. Upload the monthly usage export as your bill, and connect the usage Claude Code, Codex and your apps report.

Source: https://docs.levelfour.ai/connectors/deepseek


## What you can connect

DeepSeek publishes no usage or cost API. Its bill is a file you export from its platform, and the tools your team runs on DeepSeek report their own usage to LevelFour.

| What you use                    | Connect              | What you see                                                |
| ------------------------------- | -------------------- | ----------------------------------------------------------- |
| The DeepSeek API, any use       | Monthly usage export | Your bill by day, model, API key and token type             |
| Claude Code pointed at DeepSeek | Claude Code usage    | Who uses which model, how much, and how Claude Code is used |
| Codex pointed at DeepSeek       | Codex usage          | Who uses which model, how much, and how Codex is used       |
| Your own apps calling DeepSeek  | App usage            | Each model call by app and model                            |

Connect any mix, in any order. The export is your bill. The tools add who used it and how.

LevelFour values what the tools report at DeepSeek's list price for the hour each request was made. DeepSeek charges twice the off-peak rate from 01:00 to 04:00 and from 06:00 to 10:00 UTC, Monday to Friday. It bills Chinese public holidays off-peak, and LevelFour prices those days as weekdays, so a holiday reads a little high.

## History and what is left out

| Source                           | History                           | First data                           | Not included                                             |
| -------------------------------- | --------------------------------- | ------------------------------------ | -------------------------------------------------------- |
| Monthly usage export             | Every month you upload            | Minutes after you confirm the upload | Top-ups, the remaining balance, tax, and a wallet in CNY |
| Claude Code, Codex and app usage | From the day you add the settings | A few minutes after you verify       | Developers or apps that have not added the settings      |

## Prerequisites

**Monthly usage export**

* A DeepSeek account with a wallet in US dollars. LevelFour does not read exports in CNY yet.
* Access to the Usage page of [platform.deepseek.com](https://platform.deepseek.com/usage).

**Claude Code usage**

* Claude Code pointed at DeepSeek's Anthropic-compatible API, with `ANTHROPIC_BASE_URL` set to `https://api.deepseek.com/anthropic`.

**Codex usage**

* Codex with DeepSeek as its model provider, in a `[model_providers.deepseek]` table of `~/.codex/config.toml` with `wire_api = "responses"`, as [DeepSeek's Codex guide](https://api-docs.deepseek.com/quick_start/agent_integrations/codex) sets it up. The CLI, the IDE extension and the ChatGPT app share that file.

**App usage**

* An app that calls DeepSeek through the OpenAI SDK, with its base URL at `https://api.deepseek.com`.

## Connect

Open **Connect Providers** and select **DeepSeek**. The first time an admin opens it, **Connect DeepSeek** starts by itself; after that, click **Add account**. Pick what your team uses and click **Continue**. Each pick adds its own step, a review at the end lists what you connected, and you can run it again at any time to add more.

**Monthly usage export**

### Export a month from DeepSeek

Open [Usage](https://platform.deepseek.com/usage) on the DeepSeek platform and export the month you want. DeepSeek downloads a ZIP file. There is no need to unzip it.

### Upload it

In **Connect DeepSeek**, pick **DeepSeek API**. On the **Usage export** step, click **Select a file**, choose the ZIP, then click **Review costs**. Check the dates and the totals, and click **Confirm and import**.

Upload one file a month into the same account. A file that covers days already imported replaces them, so uploading a month again never counts it twice.

LevelFour reads one row per day, model, API key and token type (cache hit input, cache miss input, output and requests), and matches each day and model to the total DeepSeek's cost file states. An API key shows as its name and the last four characters DeepSeek leaves unmasked. The export dates each charge by DeepSeek's own billing day, in China Standard Time.

**Claude Code usage**

### Generate the settings

In **Connect DeepSeek**, pick **Claude Code**. On the **Claude Code** step, click **Generate settings**. LevelFour shows the same eight-entry settings block as [for Claude](/connectors/anthropic#claude-code-usage), with a new ingest key, once.

### Add it next to your DeepSeek settings

Add the eight entries to the `env` object that points Claude Code at DeepSeek, next to `ANTHROPIC_BASE_URL`:

* **One developer:** `~/.claude/settings.json`.
* **Everyone:** an admin adds them to the managed settings file on each machine, for example through MDM: `/Library/Application Support/ClaudeCode/managed-settings.json` on macOS, `/etc/claude-code/managed-settings.json` on Linux and WSL, or `C:\Program Files\ClaudeCode\managed-settings.json` on Windows. Claude Code reads the file when it starts and again when it changes.

> **Warning**
>
> A settings file holds one set of these entries, so Claude Code on a machine reports to one key. If the same machine also runs Claude Code against Anthropic, those sessions count here as DeepSeek usage, because both name their models after Claude. Keep the two apart on separate machines, or measure one of them.

### Verify

Run one prompt in Claude Code, then click **Verify connection** in the step.

DeepSeek serves a Claude model name on its own models: Opus on V4 Pro, every other Claude model on Flash. LevelFour stores and prices each request as the model DeepSeek served, and ignores the cost Claude Code reports, which is a Claude price. [What LevelFour keeps from Claude Code](/connectors/anthropic#what-levelfour-keeps-from-claude-code-and-cowork) applies here unchanged.

**Codex usage**

### Generate the settings

In **Connect DeepSeek**, pick **Codex**. On the **Codex** step, click **Generate settings**. LevelFour shows the same `[otel]` table as [for OpenAI](/connectors/openai#codex-usage), with a new ingest key, once.

### Add it to the file that names DeepSeek

Add the block at the end of `~/.codex/config.toml`, the file that holds your `[model_providers.deepseek]` table, below every other setting. Then quit Codex and open it again: Codex reads the file when it starts.

> **Warning**
>
> A configuration file holds one `[otel]` table, so Codex on a machine reports to one key. If the file already has an `[otel]` table, for example the one from [Codex usage on the OpenAI page](/connectors/openai#codex-usage), replacing it moves that machine's reports here. LevelFour then counts the requests DeepSeek served and leaves out the ones OpenAI served.

### Verify

Run one prompt in Codex, then click **Verify connection** in the step.

[What LevelFour keeps from Codex](/connectors/openai#what-levelfour-keeps-from-codex) applies here unchanged.

**App usage**

Follow [App usage on the OpenAI page](/connectors/openai#app-usage), with two differences: generate the variables from **Your apps** in **Connect DeepSeek**, and keep the OpenAI SDK's base URL at `https://api.deepseek.com`. The OpenAI instrumentation labels a DeepSeek call as an OpenAI one, so LevelFour reads the vendor from the host that served it.

DeepSeek reports cache hits in the same fields OpenAI uses, so `opentelemetry-instrumentation-genai-openai` reports them and LevelFour prices them at DeepSeek's cache-hit rate. On `opentelemetry-instrumentation-openai-v2`, every input token counts at the cache-miss rate, up to 50 times the cache-hit price.

## Who a request belongs to

Claude Code and Codex name a person only when the developer signs in to Claude or ChatGPT. With DeepSeek as the model provider, most developers sign in to neither, so each shows as a device or a machine. A developer can name themselves by setting `OTEL_RESOURCE_ATTRIBUTES=levelfour.person=<their email>` in the environment their tool runs in. For Claude Code that is the `env` object of its settings, next to the block.

## What you see

DeepSeek spend appears under [**Costs and Usage**](/cost-and-usage) and on its own **DeepSeek** board under [**Boards**](/boards), which appears once you connect a source.

| Group by           | Monthly usage export                                | Claude Code, Codex and app usage |
| ------------------ | --------------------------------------------------- | -------------------------------- |
| Model              | The model                                           | The model DeepSeek served        |
| Tool               | Not reported                                        | Claude Code, Codex or Apps       |
| Token type         | Cache hit input, Cache miss input, Output, Requests | On the board's tokens card       |
| Key, person or app | API key                                             | Person, or app for app usage     |

**Billed** is the export. **Usage value** is what the tools report, priced at DeepSeek's list price, and LevelFour never adds it to a billed total.

The DeepSeek board groups its cards the way the [OpenAI board](/connectors/openai#the-openai-board) does, with the activity Claude Code adds: lines of code, commits and pull requests, edits, plugins, skills and MCP connections. Its usage bands are sized to DeepSeek's prices.

## Rotating or removing access

You cannot rotate an ingest key. Disconnect the usage source, keeping its data, generate the settings again, and replace the block or the variables. Disconnecting a usage source stops its key working at once.

Disconnecting the monthly usage export keeps or purges what you imported, as you choose when you disconnect.

## Troubleshooting

| Symptom                                                    | What to do                                                                                                                                                                              |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The upload says the export is in CNY                       | LevelFour reads wallets in US dollars only for now                                                                                                                                      |
| LevelFour marks the upload failed                          | The file is not the export DeepSeek downloads, or the download broke. Export the month again and upload the ZIP as it came                                                              |
| A month shows twice                                        | Upload into the account that already holds it, from its **Upload another month** action, and the new file replaces the old one                                                          |
| **Verify connection** says no usage has arrived            | Check the block sits in the settings the tool reads, next to its DeepSeek settings, then restart the tool and run one prompt. A request for a model DeepSeek does not serve is left out |
| The account shows a warning that a model has no list price | A request used a DeepSeek model LevelFour cannot price yet. Its tokens count, at no cost, until LevelFour adds the price                                                                |
| A developer shows as a device or a machine                 | Expected when they are not signed in to Claude or ChatGPT. Have them set `levelfour.person`                                                                                             |

## Next

* [Connect Providers](/connectors) lists every provider you can connect
* [OpenAI](/connectors/openai) and [Anthropic](/connectors/anthropic) connect the same way
