FundamentalsBeginner
What is a REST API? HTTP Methods, Endpoints, and RESTful Architecture
Direct Answer & Overview
A REST API (Representational State Transfer) is an architectural style for web services that uses standard HTTP verbs (GET, POST, PUT, DELETE) and stateless communication to manipulate server resources represented in formats like JSON.
1.The 6 Guiding Principles of REST
1. Client-Server Architecture: Separation of user interface concerns from data storage concerns.
2. Statelessness: No client context is stored on the server between requests.
3. Cacheability: Responses must explicitly label themselves as cacheable or non-cacheable.
4. Uniform Interface: Standard resource URIs and HTTP methods used consistently across all endpoints.
5. Layered System: The client cannot tell whether it is connected directly to the end server or an intermediate proxy/gateway.
6. Code on Demand (Optional): Servers can temporarily extend client functionality with executable code.
2.HTTP Verbs and CRUD Mapping
REST maps standard Create, Read, Update, Delete (CRUD) operations to HTTP verbs:
• GET /v1/models — Read a list of resources (idempotent, safe).
• POST /v1/chat/completions — Create or execute a new generation resource.
• PUT /v1/keys/123 — Replace an existing resource completely.
• PATCH /v1/keys/123 — Partially update specific fields on a resource.
• DELETE /v1/keys/123 — Remove a resource permanently.
3.REST vs. GraphQL vs. gRPC: When to Use Which
• REST: Universal standard, easiest to cache, supported by every programming language without special client libraries.
• GraphQL: Ideal for complex client applications where frontends need to query multiple nested entities in a single round-trip without over-fetching.
• gRPC: High-performance binary RPC protocol using Protocol Buffers and HTTP/2 multiplexing, ideal for internal microservice-to-microservice communication.
Executing Standard RESTful API Operations with cURLbash
# 1. GET: Read list of models
curl -X GET https://api.apihundred.com/v1/models \
-H "Authorization: Bearer your_api_key"
# 2. POST: Create a chat completion resource
curl -X POST https://api.apihundred.com/v1/chat/completions \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"model": "gemini-3.8-flash", "messages": [{"role": "user", "content": "Hello!"}]}'Frequently Asked Questions
What is the difference between an API and a REST API?
API is the broad umbrella term for any software interface. A REST API is a specific kind of web API that strictly follows the architectural constraints of REST using HTTP and JSON.
What is an idempotent API method?
An idempotent method (like GET, PUT, or DELETE) produces the exact same server state whether executed once or ten times in a row.
Why do AI APIs use POST instead of GET for completions?
Generating AI responses creates compute side-effects and requires sending large conversational message arrays in the request body, which exceeds HTTP GET URL length limits.
A100
API100 Engineering Team
Infrastructure & Latency Research

