opencode-mistral-cache-key

Set the prompt_cache_key for Mistral models in OpenCode's transform.ts file.

113|8|Updated May 28, 2026
One-click install
npx skills add https://github.com/OnlyTerp/prompt-cache-skills --skill opencode-mistral-cache-key
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opencode-mistral-cache-key
Source: https://github.com/OnlyTerp/prompt-cache-skills/tree/main/skills/opencode-mistral-cache-key
Command: npx skills add https://github.com/OnlyTerp/prompt-cache-skills --skill opencode-mistral-cache-key

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

OpenCode fails to set the necessary prompt_cache_key for Mistral models, leading to missed opportunities for prompt caching and reduced cost savings.

Core Features & Use Cases

  • Optimize Cache Usage: Automatically sets the required prompt_cache_key for Mistral requests, enabling prompt caching.
  • Cost Savings: Increases cache hit rates to achieve up to 90% cost savings on cached tokens.
  • Use Case: Integrates with OpenCode to ensure that API calls to Mistral benefit from caching, reducing unnecessary API usage and costs.

Quick Start

Apply the opencode-mistral-cache-key skill to your OpenCode setup to activate prompt caching for Mistral models.

Frequently Asked Questions about opencode-mistral-cache-key

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable prompt caching for Mistral models in OpenCode?

To enable prompt caching for Mistral models in OpenCode, you must apply a modification to the `transform.ts` file to set the missing `prompt_cache_key` parameter. This fix automatically configures API requests to utilize caching.

Why does OpenCode fail to reduce API costs with Mistral prompt caching?

OpenCode fails to reduce API costs because it lacks the `prompt_cache_key` setting for Mistral models. Without this key, API requests miss caching opportunities, preventing potential cost savings of up to 90% on cached tokens.

What are the cost savings from optimizing Mistral API cache hit rates?

Optimizing Mistral API cache hit rates can achieve up to 90% cost savings on cached tokens. By ensuring the `prompt_cache_key` is properly set, unnecessary API usage is drastically reduced, improving both performance and cost efficiency.

Do I need to modify OpenCode source files to apply the Mistral cache fix?

Yes, applying the Mistral cache fix requires direct modification of OpenCode's `transform.ts` file. This source code adjustment is necessary to inject the `prompt_cache_key` setting into the API integration.

Does OpenCode natively support the prompt_cache_key setting for Mistral integrations?

No, OpenCode does not natively support the `prompt_cache_key` setting for Mistral integrations. This skill provides the necessary script to patch the integration and activate prompt caching for reduced API usage.