AI Model Wiki

    Skip to main content
    Back to Glossary

    API (Application Programming Interface)

    An Application Programming Interface (API) is a defined contract that lets one piece of software call the functionality of another. In the AI context, a model API exposes endpoints that accept structured requests — typically containing a prompt, model identifier, and configuration parameters — and return the model output in a predictable format. The provider handles all infrastructure, model weights, and scaling; the caller only needs to conform to the request/response schema.

    Think of it like a restaurant menu. You do not enter the kitchen and cook yourself; you submit a standardised order (the API request), and the kitchen (the model provider) handles the preparation and returns your dish (the completion).

    Most AI APIs follow a similar HTTP pattern. Here is a minimal call using Python against a chat-completion endpoint:

    import requests, os
    
    response = requests.post(
        "https://api.example.com/v1/chat/completions",
        headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
        json={
            "model": "example-model-3",
            "messages": [{"role": "user", "content": "Summarise this article."}],
            "temperature": 0.3
        }
    )
    print(response.json()["choices"][0]["message"]["content"])
    

    The Temperature parameter controls output randomness, while the model field selects which Foundation Model runs the request. Providers enforce API Rate Limiting so that no single caller can monopolise shared compute. Understanding Tokenization matters here because billing and Context Window limits are both expressed in tokens, not words or characters.

    You will encounter AI APIs whenever you integrate a language model into a product — whether building a chatbot, a document-processing pipeline, or an automated coding assistant — and provider documentation will be your primary reference for available models, pricing tiers, and endpoint behaviour.

    AI Terminology
    Glossary