Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ claude mcp add blockrun -s user -- npx -y @blockrun/mcp@latest
<div align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/context-cost-dark.svg">
<img src="assets/context-cost.svg" width="620" alt="Context cost: 14.0K tokens, 7% of a 200K context window, charged every turn whether or not you call a tool. 5.4K with --profile trading, 61% less.">
<img src="assets/context-cost.svg" width="620" alt="Context cost: 14.3K tokens, 7% of a 200K context window, charged every turn whether or not you call a tool. 5.4K with --profile trading, 62% less.">
</picture>
</div>

Expand Down Expand Up @@ -252,13 +252,13 @@ Package managers have shown install size for decades. Almost no MCP server shows

| Profile | Tools | Context |
|---------|-------|---------|
| `full` *(default)* | 19 | 14,018 |
| `full` *(default)* | 19 | 14,335 |
| `trading` | 8 | 5,411 |
| `media` | 7 | 6,827 |
| `media` | 7 | 7,144 |
| `research` | 5 | 2,727 |
| `chat` | 3 | 2,082 |

Running `--profile trading` instead of the default costs **61% less context** for the same trading
Running `--profile trading` instead of the default costs **62% less context** for the same trading
workflow. If you only ever ask about markets, that is the single cheapest change you can make.

Measure it yourself — against us, or against any other stdio MCP server:
Expand Down
6 changes: 3 additions & 3 deletions assets/context-cost-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions assets/context-cost.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/mcp-schema-overhead.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Written 2026-09-01, verified against `@modelcontextprotocol/sdk` 1.29.0. Numbers

| Profile | Tools | Context |
|---------|-------|---------|
| `full` *(default)* | 19 | 14,018 |
| `full` *(default)* | 19 | 14,335 |
| `trading` | 8 | 5,411 |
| `media` | 7 | 6,827 |
| `media` | 7 | 7,144 |
| `research` | 5 | 2,727 |
| `chat` | 3 | 2,082 |

Descriptions are ~54% of it, input schemas ~42%. `--profile trading` costs 61% less than the
Descriptions are ~54% of it, input schemas ~42%. `--profile trading` costs 62% less than the
default for the same workflow.

These figures move with every description edit, so they are not the source of truth — the README
Expand Down
20 changes: 20 additions & 0 deletions scripts/verify-prices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,22 @@ const PROBES: Probe[] = [
// nano-banana-2 is 1024-only upstream (the gateway 400s any other size), so a
// single probe covers its whole price surface.
{ label: "image nano-banana-2 1024", path: "images/generations", body: { model: "google/nano-banana-2", prompt: "a cube", size: "1024x1024" }, expected: estimateImageCost("google/nano-banana-2", "1024x1024") },
// Added 2026-10-20 with their rows: the 2.5 pair at both size tiers (flat
// across quality, $0.28 / $0.56), Grok Imagine 2.0, and the Pro row that
// had sat at $0.07 for six weeks after the gateway cut it to $0.05.
...([
["openai/gpt-image-2.5-flare", "1024x1024"],
["openai/gpt-image-2.5-flare", "1536x1024"],
["openai/gpt-image-2.5-sunburst", "1024x1024"],
["openai/gpt-image-2.5-sunburst", "1024x1536"],
["xai/grok-imagine-image-2.0", "1024x1024"],
["xai/grok-imagine-image-pro", "1024x1024"],
] as const).map(([model, size]) => ({
label: `image ${model.slice(model.indexOf("/") + 1)} ${size}`,
path: "images/generations",
body: { model, prompt: "a cube", size },
expected: estimateImageCost(model, size),
})),
// Seedream's tier is keyed on min(w,h), not max: 2048x1024 must bill BASE
// while 2048x2048 bills the large tier. Pin the boundary from both sides.
...(["1024x1024", "2048x1024", "2048x2048"].map((size) => ({
Expand All @@ -207,6 +223,10 @@ const PROBES: Probe[] = [
["xai/grok-imagine-video", undefined, undefined],
["xai/grok-imagine-video", undefined, "720p"],
["xai/grok-imagine-video", 15, "720p"],
["xai/grok-imagine-video-1.5", undefined, undefined],
["xai/grok-imagine-video-1.5", undefined, "720p"],
["xai/grok-imagine-video-1.5", undefined, "1080p"],
["xai/grok-imagine-video-1.5", 15, "1080p"],
["azure/sora-2", undefined, undefined],
["bytedance/seedance-1.5-pro", undefined, undefined],
["bytedance/seedance-1.5-pro", 12, undefined],
Expand Down
4 changes: 3 additions & 1 deletion skills/image-prompting/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ doubles the price ($0.064 → $0.127). Ask for `1536x1024` only when you need it
| Artistic / stylized / fast | `google/nano-banana` | generate | `1024x1024` | $0.0535 |
| Cheapest usable draft | `zai/cogview-4` | generate | `1024x1024` | $0.01675 |
| Widescreen / banner on a budget | `bytedance/seedream-5-pro` | generate | `2048x1024` or `1280x720` | $0.04825 ($0.0955 when both sides >1024) |
| Premium render or high-precision edit | `openai/gpt-image-2.5-sunburst` (`-flare` generates only, same price) | generate or edit | `1024x1024` | $0.295 ($0.589 at `1536x1024` / `1024x1536`) |
| Stylized Grok render, one step above the base | `xai/grok-imagine-image-2.0` | generate | `1024x1024` (only size) | $0.043 |
| Edit an existing image (localized change) | `openai/gpt-image-2` | edit | match source | $0.064 at 1024x1024, $0.127 above |
| Composite from multiple refs | `openai/gpt-image-2` | edit (multi-ref) | match target | $0.064 at 1024x1024, $0.127 above |

Expand Down Expand Up @@ -312,4 +314,4 @@ CONSTRAINTS:

## Reference

BlockRun image models: `openai/gpt-image-2`, `openai/gpt-image-1`, `google/nano-banana`, `google/nano-banana-2`, `google/nano-banana-pro`, `zai/cogview-4`, `xai/grok-imagine-image`, `xai/grok-imagine-image-pro`, `bytedance/seedream-5-pro`
BlockRun image models: `openai/gpt-image-2`, `openai/gpt-image-1`, `google/nano-banana`, `google/nano-banana-2`, `google/nano-banana-pro`, `openai/gpt-image-2.5-flare`, `openai/gpt-image-2.5-sunburst`, `zai/cogview-4`, `xai/grok-imagine-image`, `xai/grok-imagine-image-2.0`, `xai/grok-imagine-image-pro`, `bytedance/seedream-5-pro`
38 changes: 31 additions & 7 deletions src/tools/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,26 @@ export async function resolveImageRef(ref: string): Promise<ResolvedImageRef> {
return { dataUri: `data:${mime};base64,${buffer.toString("base64")}`, localPath };
}

// Base (1024x1024) prices, mirroring the live /v1/images/models catalog.
// dall-e-3 and flux-schnell were delisted upstream — do not re-add them.
// Base (1024x1024) prices, mirroring the gateway registry's IMAGE_MODELS
// (blockrun src/lib/models.ts). GET /v1/models publishes these WITH the 5%
// margin (per_image = base x 1.05, e.g. gpt-image-2 $0.063), so divide by 1.05
// when checking a row against it. dall-e-3 and flux-schnell were delisted
// upstream — do not re-add them.
//
// 2026-10-20: grok-imagine-image-pro cut $0.07 -> $0.05 (the gateway's own
// size row was corrected on 2026-09-08; this table never followed, so it
// over-reserved 40%). Added gpt-image-2.5-flare / -sunburst ($0.28, flat
// across `quality`, which this tool does not send) and grok-imagine-image-2.0
// ($0.04 — the gateway pins xAI's `quality: "low"`, the tier that price covers).
const GENERATE_MODEL_COST: Record<string, number> = {
"zai/cogview-4": 0.015,
"xai/grok-imagine-image": 0.02,
"xai/grok-imagine-image-pro": 0.07,
"xai/grok-imagine-image-2.0": 0.04,
"xai/grok-imagine-image-pro": 0.05,
"openai/gpt-image-1": 0.02,
"openai/gpt-image-2": 0.06,
"openai/gpt-image-2.5-flare": 0.28,
"openai/gpt-image-2.5-sunburst": 0.28,
"google/nano-banana": 0.05,
"google/nano-banana-2": 0.09,
"google/nano-banana-pro": 0.10,
Expand All @@ -140,14 +152,18 @@ const GENERATE_MODEL_COST: Record<string, number> = {
const LARGE_SIZE_COST: Record<string, number> = {
"openai/gpt-image-1": 0.04,
"openai/gpt-image-2": 0.12,
"openai/gpt-image-2.5-flare": 0.56, // 1536x1024 / 1024x1536
"openai/gpt-image-2.5-sunburst": 0.56,
"google/nano-banana-pro": 0.15, // 4096x4096 tier
"bytedance/seedream-5-pro": 0.09, // min(w,h) > 1024 tier — see LARGE_SIZE_MIN_DIM_MODELS
};

// Mirrors the gateway's EDIT_SUPPORTED_MODELS (/v1/images/image2image).
// Mirrors the gateway's EDIT_SUPPORTED_MODELS (/v1/images/image2image,
// src/lib/image-editing.ts). Of the 2.5 pair only Sunburst edits.
const EDIT_MODELS = new Set([
"openai/gpt-image-1",
"openai/gpt-image-2",
"openai/gpt-image-2.5-sunburst",
"google/nano-banana",
"google/nano-banana-2",
"google/nano-banana-pro",
Expand All @@ -162,7 +178,7 @@ const MAX_EDIT_IMAGES_BY_PREFIX: Record<string, number> = {
};

// Mirrors the gateway's MASK_SUPPORTED_MODELS — only OpenAI image models inpaint.
const MASK_MODELS = new Set(["openai/gpt-image-1", "openai/gpt-image-2"]);
const MASK_MODELS = new Set(["openai/gpt-image-1", "openai/gpt-image-2", "openai/gpt-image-2.5-sunburst"]);

const IMAGE_MODELS = [
"zai/cogview-4",
Expand All @@ -171,7 +187,10 @@ const IMAGE_MODELS = [
"google/nano-banana-pro",
"openai/gpt-image-1",
"openai/gpt-image-2",
"openai/gpt-image-2.5-flare",
"openai/gpt-image-2.5-sunburst",
"xai/grok-imagine-image",
"xai/grok-imagine-image-2.0",
"xai/grok-imagine-image-pro",
"bytedance/seedream-5-pro",
] as const;
Expand All @@ -190,6 +209,8 @@ const IMAGE_MODELS = [
const LARGE_SIZE_THRESHOLD: Record<string, number> = {
"openai/gpt-image-1": 1024,
"openai/gpt-image-2": 1024,
"openai/gpt-image-2.5-flare": 1024,
"openai/gpt-image-2.5-sunburst": 1024,
"google/nano-banana-pro": 2048, // $0.107001 through 2048; $0.159500 at 4096
};

Expand Down Expand Up @@ -343,16 +364,19 @@ Actions:

Generation models (1024x1024 base price; larger sizes cost more on gpt-image-*):
- openai/gpt-image-2 ($0.06–0.12) — flagship, reasoning-driven, multilingual on-image text + character consistency (default)
- openai/gpt-image-2.5-sunburst ($0.28–0.56) — OpenAI's most capable image model, high-precision editing
- openai/gpt-image-2.5-flare ($0.28–0.56) — GPT Image 2.5 fast tier, same price as Sunburst (generate only)
- openai/gpt-image-1 ($0.02–0.04) — GPT native image generation
- google/nano-banana ($0.05) — Gemini-family image model
- google/nano-banana-2 ($0.09) — Gemini 3.1 Flash, pro-level quality at Flash speed (1024x1024 only)
- google/nano-banana-pro ($0.10; $0.15 at 4096px) — up to 4K, strongest photorealism
- xai/grok-imagine-image ($0.02) — stylized, fast
- xai/grok-imagine-image-pro ($0.07) — higher quality Grok Imagine
- xai/grok-imagine-image-2.0 ($0.04) — Grok Imagine 2.0, between Grok Imagine and Pro on price
- xai/grok-imagine-image-pro ($0.05) — higher quality Grok Imagine
- zai/cogview-4 ($0.015) — cheapest, photorealistic detailed scenes
- bytedance/seedream-5-pro ($0.045; $0.09 when both dimensions exceed 1024) — Seedream 5.0 Pro; cheap widescreen at 1280x720 / 2048x1024, large formats up to 2848x1600

Edit (img2img) models: openai/gpt-image-2 (default), openai/gpt-image-1, google/nano-banana, google/nano-banana-2, google/nano-banana-pro
Edit (img2img) models: openai/gpt-image-2 (default), openai/gpt-image-2.5-sunburst, openai/gpt-image-1, google/nano-banana, google/nano-banana-2, google/nano-banana-pro
Multi-image edit: pass an array of 2–4 source images to "image" to fuse them in one render (openai/* up to 4, google/* up to 3) — e.g. a subject plus a sprite layout guide, or a reference plus a brand logo.
Source images and masks accept a base64 data URI, an http(s) URL, or a local file path (auto-encoded). Inpaint mask (openai/gpt-image-* only) via "mask"; not combinable with multiple source images.`,
annotations: TOOL_ANNOTATIONS.generative,
Expand Down
Loading
Loading