Skip to content

API

A defined way for one program to ask another for something.

An API is a contract: a set of endpoints or functions, a request format, a response format, and rules about failure. A model API is the same thing with a model behind it: you send a request containing messages, and you get back a response containing generated text and usage numbers.

The contract is the point. Because the interface is fixed, you can swap providers, put a cache in front, or switch to a local model without rewriting the code that calls it. Products that hard-code a provider's quirks lose that freedom, and pay for it every time the price or the behaviour changes.

Error handling is where most integrations go wrong. Rate limits, timeouts, and partial failures are normal operation, not exceptions.

Related terms

Want this working inside your team?

It starts with one conversation about your workflow.

Ask on WhatsApp