How it works
An endpoint is the combination of a URL and an HTTP method (GET, POST, PUT, DELETE) that defines an operation in an API. It is the "address" where you send the request.
In AI APIs, the most common endpoints are: /chat/completions (generate text), /embeddings (generate embeddings), /images/generations (generate images) and /audio/transcriptions (transcribe audio). Each one accepts specific parameters and returns a defined response format.
The endpoint includes the base URL (e.g.: https://api.openai.com/v1) plus the resource path (e.g.: /chat/completions). The full URL is https://api.openai.com/v1/chat/completions.
Practical example
To call the OpenAI API and generate text, you make a POST to the endpoint https://api.openai.com/v1/chat/completions with a JSON body containing the model, the messages and the parameters. The response comes from the same endpoint, with the generated text.
If you use an SDK, the endpoint is called internally. If you use direct HTTP, you need to build the URL and headers manually. In both cases, the endpoint is the same.
What it's for
It serves as an access point to a specific functionality of an API. It allows developers to integrate AI services into their code in a predictable and documented way.
Difference between endpoint and API
The API is the complete set of endpoints, rules and authentication for a service. The endpoint is a specific point within that API. The API is the "restaurant"; the endpoint is the "table where you order".