# Langfuse Model Upsert

> Create or update Langfuse model pricing. Use when setting up new models, updating pricing, or configuring model costs.

- Skill: `neuradex/langfuse-model-upsert` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add neuradex/langfuse-model-upsert`
- Raw SKILL.md: https://api.skillmd.com/api/skills/neuradex/langfuse-model-upsert/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- License: MIT
- Author: neuradex (https://skillmd.com/u/neuradex)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/neuradex/langfuse-model-upsert

---


# Langfuse Model Upsert

Create or update model pricing information.

## Setup

Set the following environment variables before use:

| Variable | Required | Description |
|----------|----------|-------------|
| `LANGFUSE_PUBLIC_KEY` | Yes | Langfuse public key |
| `LANGFUSE_SECRET_KEY` | Yes | Langfuse secret key |
| `LANGFUSE_HOST` or `LANGFUSE_BASE_URL` | No | Langfuse host URL (default: `https://us.cloud.langfuse.com`) |

## When to Use

- Setting model pricing
- Adding a new model
- Updating pricing

## Commands

### 1. Set Model Pricing

```bash
npx tsx scripts/langfuse-model-upsert.ts "<model-name>" --input <input-price> --output <output-price>
```

### 2. With Custom Match Pattern

```bash
npx tsx scripts/langfuse-model-upsert.ts "<model-name>" --input <input-price> --output <output-price> --pattern "<regex>"
```

## Examples

```bash
# Set pricing for Groq qwen3-32b
npx tsx scripts/langfuse-model-upsert.ts "qwen/qwen3-32b" --input 0.29 --output 0.59

# Set pricing for Fireworks deepseek-v3 (with pattern)
npx tsx scripts/langfuse-model-upsert.ts "deepseek-v3" --input 0.20 --output 0.60 --pattern ".*deepseek-v3.*"
```

## Output Example

```
Updating existing model: qwen/qwen3-32b
  Current: input=$0.20, output=$0.40
  Deleted old model definition

Model updated successfully!
  Model Name: qwen/qwen3-32b
  Input Price: $0.29/1M tokens
  Output Price: $0.59/1M tokens
```

## Parameters

| Parameter | Description |
|-----------|-------------|
| `<model-name>` | Model identifier (required) |
| `--input` | Cost per 1M input tokens (USD) |
| `--output` | Cost per 1M output tokens (USD) |
| `--pattern` | Regex pattern for model name matching (default: exact match) |

## Notes

- Prices are in USD per 1M tokens
- Existing models are deleted and re-created (update)
- If no pattern is specified, the model name is used as an exact match

