Skip to content
TutujinAPI

LLM API guides

The 8 questions that come up most when you integrate an LLM API. Each guide starts with the answer, then explains it with concrete numbers and examples. Price examples are calculated from the live price list.

  1. 01

    What is a token? How LLM APIs bill you

    A token is the unit a model reads and writes in, and the unit LLM APIs bill by. How tokens map to words, what counts as input and output, and what one request and one month cost at live prices.Read
  2. 02

    How LLM API pricing works: per token, per request and cached input

    LLM APIs bill three ways — input and output tokens priced separately, cached input at a lower rate, and per request for image models — and the same model costs different amounts in different groups. Worked examples at live prices.Read
  3. 03

    How to choose a model: sort tasks by difficulty, then test on your own data

    Start from task difficulty — small, cheap models for classification, extraction and rewriting; mid-tier models for Q&A, summaries and writing; flagship or reasoning models for hard multi-step work. A tier table, an evaluation script and live price comparisons.Read
  4. 04

    What is context caching? Repeated prompt prefixes can cost far less

    Context caching bills a prompt prefix you send again and again at a lower cache-read price. How OpenAI, Claude, Gemini and DeepSeek handle caching, how to write prompts that hit the cache, and how much it saves at live prices.Read
  5. 05

    What is an OpenAI-compatible API? Change one base_url to switch providers

    An OpenAI-compatible API keeps OpenAI's paths and request format, so the official SDKs, LangChain, Dify, n8n and other tools connect by changing base_url and the key. Which endpoints this site supports, how to migrate, and how compatible and native APIs differ.Read
  6. 06

    How to choose a group: lines and prices for the same model

    A group decides which line an API key uses and which price tier it pays. What the lowest-price, official, cloud and mixed-sources labels mean, which group to use for development, batch jobs, production and failover, and live price differences for the same model across groups.Read
  7. 07

    How to control LLM API costs: 10 things you can do today

    LLM API spend comes down to unit price, input length, output length and call volume. Ten measures roughly in order of impact — choosing the right model tier, tiered routing, context caching, capping output and per-key spending limits — with savings shown at live prices.Read
  8. 08

    API key security best practices: keep keys on the server, one key per project

    Whoever holds your API key can spend your balance. Eight practices — server-side use only, environment variables or a secrets manager, one key per project and environment, spending limits and expiry, IP and model allowlists, rotation, watching usage — plus what to do after a leak.Read