---
title: "Update Cost Margin Config"
method: PATCH
path: "/config/cost_margin_config"
tags: ["Cost Tracking"]
---

# Update Cost Margin Config

`PATCH /config/cost_margin_config`

Update cost margin configuration.

Updates the cost_margin_config in litellm_settings.
Margins can be:
- Percentage: {"openai": 0.10} = 10% margin
- Fixed amount: {"openai": {"fixed_amount": 0.001}} = $0.001 per request
- Combined: {"vertex_ai": {"percentage": 0.08, "fixed_amount": 0.0005}}
- Global: {"global": 0.05} = 5% global margin on all providers

Example:
```json
{
    "global": 0.05,
    "openai": 0.10,
    "anthropic": {"fixed_amount": 0.001},
    "vertex_ai": {"percentage": 0.08, "fixed_amount": 0.0005}
}
```

## Request body

- object

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-18** `082b5fabd909` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status

[Change history](https://skmtc.dev/flock/apis/litellm-api/changes/config/cost_margin_config/patch.md)

---

[API](https://skmtc.dev/flock/apis/litellm-api.md) · [All operations](https://skmtc.dev/flock/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flock/apis/litellm-api/revisions/b694deb1e459?raw)
