Blog

Practical notes on LLM APIs, cost control and multi-provider integration.

2026-07-11

Cut LLM API Costs with Prompt Caching: Pricing Mechanics and Practical Patterns

Prompt caching lets the model provider reuse the unchanged prefix of your prompt across requests and bill those repeated tokens at roughly 10% of the normal input rate β€” a 90% discount on current Anthropic and OpenAI models. If your application sends a long system prompt, runs agent loops, or injects retrieved documents into every call, caching is usually the single biggest lever for cutting your LLM API bill. This post walks through what actually gets cached, both providers' official cache pricing, how cached tokens are billed on CaMeL Hub, and concrete prompt-structuring rules that turn the discount into real savings.

2026-07-11

One API Endpoint for GPT, Claude, and Gemini: How the Compatibility Layer Works

You can call GPT, Claude, and Gemini through a single OpenAI-compatible endpoint by pointing your existing OpenAI SDK at https://api.camel-hub.com/v1 and changing only the model name β€” no separate SDKs, auth schemes, or request bodies to maintain per provider. This post explains why the base_url swap works, walks through working Python, Node.js, and curl examples, and covers the two places cross-provider portability actually breaks: provider-native endpoints and function-calling JSON shapes.

2026-07-11

Fix OpenAI API 401 and 429 Errors: A Step-by-Step Debugging Guide

A 401 means your request never got past authentication β€” the server rejected the key itself before it even looked at what you were asking for. A 429 means the opposite: the key checked out, but something downstream throttled you, either a request-rate limit or an account that has run out of quota. This guide walks through both failure modes for any OpenAI-compatible API, with a copy-pasteable Python backoff snippet and notes on where CaMeL Hub's console, per-key model restrictions, and balance system change the diagnosis.