How AI APIs work
Short, plain explanations of the ideas behind DigitSpace, with the numbers that matter.
- What is an AI gateway?An AI gateway is one API between your code and many AI providers, handling keys, routing, failover, costs and rules. What it does and when you need one.
- LLM routing, explainedLLM routing sends each request to the model and provider that best fit it. How capability matching, cost and latency strategies and quality levels work.
- LLM API failoverAI APIs fail with timeouts, rate limits and overloads. Which errors are worth retrying elsewhere, which aren't, and how automatic failover keeps features up.
- How to cut LLM API costsWays to lower LLM API spend: send simple requests to small models, cap output, cache prompts, set budgets, use cloud credits and measure every request.
- Tokens and LLM pricingHow AI APIs charge: tokens, input and output prices per million, cached and cache-write tokens, and how to work out what a request costs.
- BYOK vs. creditsBring your own key (BYOK) or buy credits from the gateway? How each works, what they cost, and when to mix them.
- OpenAI-compatible APIsAn OpenAI-compatible API takes the same requests as OpenAI's Chat Completions, so SDKs and tools work by changing the base URL. What to check.