Swipe
SwipeSwipe
Swipe Apps

Paths

Motivation

Information

Putting the Pieces Together · Lesson 4 of 9

Choosing the Right Endpoint

A free lesson from Swipe AI · Building With AI APIs, level 2 · updated October 2026

By the Swipe team, founded by Colin · how we make lessons

🤖
Send a text prompt to an image endpoint and you'll get back... nothing useful. 🚪

You already know an endpoint is the specific address a request is sent to. Most AI providers actually expose several different endpoints, not just one — one built for generating text, another for generating an image, another for turning audio into text, and so on. Picking the right endpoint for the task is the very first decision in assembling a request, before the API key or the payload even come into play.

The endpoint you pick isn't just a formality — it determines what shape of payload the request expects and what shape of response comes back. A text-generation endpoint expects a prompt and returns generated text; an image-generation endpoint expects a description and returns image data instead. Sending the wrong shape of payload to the wrong endpoint is a common early mistake.

Two conceptual endpoints from the same provider:

endpoint: ".../generate-text"   -> payload expects a text prompt, returns generated text
endpoint: ".../generate-image"  -> payload expects a text description, returns image data

Same provider, same API key — different endpoint, different expected payload shape.
The endpoint you choose sets the shape of everything that follows in the request.
Quick check

Why does picking the right endpoint matter before anything else in a request?

Fill in the blank

Most AI providers expose more than one endpoint, each built for a different ____.

True or false

All endpoints from the same provider expect the exact same payload shape, regardless of what task they perform.

Keep your streak going in Swipe AI

Swipe through every level of Building With AI APIs on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.

Get the Swipe apps →