Mapping one chat API onto another
Field by field: messages, system prompts, stop sequences, tool schemas, streaming events, usage objects and finish reasons.
Every chat API expresses the same handful of ideas: a transcript, an instruction that sits above the transcript, a ceiling on how much comes back, a description of the tools the model may call, and a stream of fragments on the way out. Because the ideas are the same, moving between two of them looks like a renaming exercise, and for about eighty per cent of the surface it is. The interesting part is the other twenty.
These pages walk one concept at a time across the shapes each provider uses, and they spend most of their length on the part that does not survive the translation — the field with no counterpart, the value that means something subtly different on the other side, the default that differs, the signal one API gives you and the other does not. If you are writing the adapter by hand, that residue is the entire job; the renames write themselves.
Mapping the Messages Array Between Chat APIs
How a conversation transcript is expressed in each major chat API, and which parts of a message object have no counterpart on the other side.
9 min read
Mapping System Prompt Handling Between APIs
The three shapes a system prompt takes across chat APIs, and what changes about its precedence, its position and its cacheability when you move it.
9 min read
Mapping Stop Sequences Between Provider APIs
Parameter name, array limit and matching behaviour for stop sequences across chat APIs, and why only one of them tells you which sequence fired.
9 min read
Mapping Max Tokens Parameters Between APIs
The parameter name for the output ceiling on each chat API, whether it is required, what happens if you omit it, and why the same number buys less than it used to.
9 min read
Mapping Tool and Function Schemas Between APIs
One tool definition put through the JSON Schema shape each chat API expects, marking exactly which nesting level and which field name changes.
10 min read
Mapping Streaming Events Between Chat APIs
One streamed reply walked through the SSE event types each chat API emits, and the specific ways a parser written for one misreads another.
10 min read
Mapping Usage and Token-Count Objects Between APIs
The four shapes a token-count object takes across chat APIs, what each one leaves out, and why a cost script keyed to one reads undefined on another.
9 min read
Mapping Finish Reason Values Between APIs
What each chat API calls the field that says why generation stopped, which values map onto each other, and which have no counterpart at all.
9 min read
Mapping Error Response Shapes Between Chat APIs
How the nesting and field names of an error body differ across chat APIs, including the errors that arrive mid-stream after a 200 OK.
9 min read
What “OpenAI-Compatible” Actually Means for an Endpoint
Compatibility stated as a checkable surface — paths, auth, required request fields, response envelope and streaming framing — rather than as a claim on a landing page.
10 min read
Where OpenAI-Compatible Endpoints Actually Break
The parameters a self-declared OpenAI-compatible server most often accepts and then ignores, how to tell which ones, and what to do about each.
10 min read
Testing Whether an Endpoint Is Really OpenAI-Compatible
A probe script you point at any base URL that reports which OpenAI features the endpoint implements, which it silently ignores, and which it rejects.
10 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Local inference errors, string by string
- Running local models day to day
- Testing code that calls an LLM
- Snapshot and property testing for model output
- Regression suites for prompts
- Eval gates in CI
- Flaky tests against a model
- Determinism and the cost of testing
- Contract and streaming tests
- Testing tool calls and retrieval
- Inference, serving & latency
- Rolling out a prompt change
- Testing AI systems in practice
- Forecasting a time series
- Machine learning on tabular data
- Geospatial data and models
- Understanding audio that is not speech
- Understanding video
- Core computer vision tasks
- Machine learning on graphs
- Point clouds and 3D
- Evaluation, benchmarks & LLM-as-judge
- Sensor and IoT data
- Logs and event streams
- Models over biological sequences
- Machine learning on molecules
- Embedding and searching code
- Extracting invoices and purchase orders
- Receipts, statements and tax forms
- Insurance policies and contracts
- Deeds, court filings and patents
- Extracting from medical records
- Observability & LLMOps
- CVs, certificates and identity documents
- Shipping, customs and technical documents
- Meetings, email, chat and filled-in forms
- Building an extraction pipeline
- Business, property and inspection documents
- Contract clauses and insurance claims
- Regulated and compliance documents
- Consumer, travel and closing documents
- SDK and framework migrations
- Hallucination & failure modes
- Re-embedding and model deprecation
- Cutting over between providers
- Parity gaps, shims and legacy endpoints
- Moving between model versions
- Migrating vector stores and caches
- Mapping capabilities and parameters
- Migrating pipelines and agents
- Contracts, runbooks and rollback
- Auditing a codebase before a cutover
- Compliance and fine-tune migration
- LLM cost engineering
- Routing, cost tracking and multi-tenancy
- What a migration does to your prompts
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns
- Build it: end-to-end AI tutorials
- Python for AI: hands-on recipes
- TypeScript, React and the web
- Frameworks and SDKs
- Errors and troubleshooting
- AI facts, numbers and statistics
- The history of AI
- The maths behind AI
- Architectures beyond the transformer
- Reinforcement learning
- Diffusion and generative media
- Speech, audio and voice engineering
- Benchmarks, one at a time
- AI search visibility
- Infrastructure and operations
- Databases and storage for AI
- Knowledge graphs and structured knowledge
- Classical ML in production
- Regulation, jurisdiction by jurisdiction
- Prompt recipes and pattern library
- AI for people who do not write code
- Writing, media and creative work
- Edge and on-device AI
- Interpretability and model internals
- Field notes
- OpenAI model behaviour
- Claude model behaviour
- Gemini model behaviour
- Llama model behaviour
- Mistral model behaviour
- Qwen model behaviour
- DeepSeek model behaviour
- Cohere model behaviour
- Grok model behaviour
- Small model behaviour
- Hybrid model architectures
- Token cost by language and script
- Transliteration, romanization and script handling
- Locale-correct output
- Multilingual generation quality
- Multilingual pipelines
- The EU AI Act, article by article
- AI under the GDPR and EU data law
- US AI regulation, state and sector
- International AI governance and standards
- AI litigation and enforcement
- Running AI workloads on AWS
- Running AI workloads on Google Cloud
- Running AI workloads on Azure
- AI at the edge: Workers, Vercel and Netlify
- Serving models on Kubernetes
- Operating AI infrastructure
- Quantization formats and what they cost
- llama.cpp, flag by flag
- Ollama and the desktop local-model runtimes
- Local models on Apple Silicon
- Hardware for local inference
- Running speech and embedding models locally
- Model files, adapters and conversion
- VRAM arithmetic for local models