FundamentalsBeginner
What is an API Endpoint? URIs, Paths, and Query Parameters
Direct Answer & 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.
1.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).
2.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.
3.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`).
Querying Endpoints with Dynamic Parameters in Node.jsjavascript
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
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.
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.
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.
A100
API100 Engineering Team
Infrastructure & Latency Research

