Skip to main content

Overview

LemonData automatically manages caching to optimize performance and reduce costs. While there is no public endpoint to clear cache entries, you have full control over caching behavior through request-level controls.

Bypassing Cache

To get fresh responses without using cache, use the cache_control parameter in your request:
curl -X POST "https://api.lemondata.cc/v1/chat/completions" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}],
    "cache_control": {"type": "no_cache"}
  }'

Cache Control Options

TypeEffect
no_cacheSkip cache lookup, always get fresh response
no_storeDon’t store this response in cache
response_onlyOnly use exact match cache (skip semantic)
semantic_onlyOnly use semantic cache (skip exact match)

Cache Feedback

If you receive an incorrect cached response, you can report it:
curl -X POST "https://api.lemondata.cc/v1/cache/feedback" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "cache_entry_id": "abc123",
    "feedback_type": "wrong_answer",
    "description": "Response was outdated"
  }'
When a cache entry receives enough negative feedback, it is automatically invalidated.

Use Cases

During development, use cache_control: {"type": "no_cache"} to ensure you’re getting fresh API responses.
For real-time data like stock prices or weather, always use no_cache to get current information.
When debugging unexpected responses, use no_cache to rule out cached results.
For more details on caching, see the Caching Guide.