Skip to content
BENIBIX Learn

LLM API

Development🧬 AI EngineeringLLM APIs

Also known as Large Language Model API, Model API, AI API

A web service your code calls to get text back from a big AI model.

Think of it like

Think of it like ordering food by phone. You say what you want, and the kitchen sends it back.

Example

Jack's help app sends each customer question to the OpenAI API with a short system prompt. The reply comes back in about two seconds. It goes straight into the chat.

Why it matters

It puts the best models one web call away. You have no machines to buy or run.

Definition

An LLM API is a web service that lets your code send text to a large language model and get its reply. Your app sends a request with a secret key, the model's name, the messages and limits such as the most tokens to write. The provider runs the model on its own computers and sends back the answer. Each call is charged by the tokens it uses. Most apps that use AI talk to a model this way rather than running one themselves.

Example code

json
{
  "model": "model-name",
  "max_tokens": 300,
  "messages": [
    { "role": "user", "content": "Summarize this email." }
  ]
}
A request says which model to use, how long the reply can be, and what to say.
Your app sends a key, a model name and the messages. The reply comes back with its token count.

Common mistake

Putting the API key in code that runs in the browser. Anyone can copy it from there and spend your money.

Key takeaways

  1. 1
    Request and reply. Text in, text out.
  2. 2
    A secret key. Kept on the server.
  3. 3
    Paid per token. Every call costs.

Compare

Learn it properly