What is an API Endpoint? URIs, Paths, and Query Parameters
An API endpoint is a specific digital location or URL where an API receives requests for a particular resource or service, typically consisting of a base URL, a path, and optional query parameters.
Overview #
An API endpoint is a specific digital location or URL where an API receives requests for a particular resource or service, typically consisting of a base URL, a path, and optional query parameters.
Anatomy of an Endpoint URL #
An endpoint is structured into distinct segments:https://api.apihundred.com/v1/chat/completions?stream=true
• Protocol: https:// (encrypted communication)
• Host / Domain: api.apihundred.com (server destination)
• API Version: /v1 (enables backwards-compatible changes)
• Resource Path: /chat/completions (the specific capability requested)
• Query String: ?stream=true (optional filtering or behavior flags).
RESTful Endpoint Naming Best Practices #
Professional APIs use plural nouns rather than verbs for resource naming:
• Good: GET /v1/models, POST /v1/keys, DELETE /v1/keys/{id}
• Bad: GET /v1/getModels, POST /v1/createNewKey
Because HTTP methods (GET, POST, DELETE) already act as verbs, path names should strictly denote the entity being operated on.
Dynamic Path Parameters vs. Query Parameters #
Path parameters identify specific unique entities (e.g. /v1/keys/key_12345). Query parameters filter, sort, or paginate collections (e.g. /v1/models?limit=10&category=reasoning).
Code Example: Querying Endpoints with Dynamic Parameters in Node.js #
const BASE_URL = "https://api.apihundred.com/v1";
// 1. Static endpoint
const modelsEndpoint = `${BASE_URL}/models`;
// 2. Dynamic path parameter endpoint
const specificKeyId = "key_982410";
const keyDetailsEndpoint = `${BASE_URL}/keys/${specificKeyId}`;
// 3. Query parameter endpoint
const filteredEndpoint = `${BASE_URL}/models?category=multimodal&limit=5`;
console.log("Endpoint constructed:", filteredEndpoint);
Frequently Asked Questions #
Q: What is the difference between an API and an API endpoint?
The API is the entire software system and documentation. An endpoint is a single specific URL within that system dedicated to one particular operation.
Q: Why do endpoints include version numbers (/v1, /v2)?
Version prefixes ensure that when a provider updates response fields or schemas, existing production applications using /v1 do not break.
Q: Can an endpoint accept both GET and POST requests?
Yes. For example, GET /v1/keys might list your API keys, while POST /v1/keys creates a new API key on the same path.
Build with API100
Access 100+ AI models through one lightning-fast OpenAI-compatible API with sub-50ms routing overhead and zero markup on cached tokens.

