Documentation

REST API overview

Use a small set of HTTP endpoints to register services, configure routes, proxy traffic, and inspect individual requests.

Quickstart

All API requests use HTTPS and JSON. The base URL is https://api.vless.blog. Start by listing the services available to your token.

Request
curl https://api.vless.blog/v1/services \
  -H "Authorization: Bearer $GATEWAY_TOKEN" \
  -H "Accept: application/json"
200 OK
{
  "data": [
    { "id": "svc_payments", "name": "payments", "status": "healthy" }
  ],
  "request_id": "req_01J5D5W8R9F2"
}

Authentication

Pass a workspace token in the Authorization header. Tokens are scoped to environments and routes; a production token cannot modify a development route.

Keep tokens server-side. Never embed a gateway token in browser code, public repositories, or mobile application bundles.
Authorization header
Authorization: Bearer gw_live_••••••••••••

Core endpoints

Management endpoints configure the gateway. Proxy endpoints carry application traffic and preserve the upstream status code and body.

GET/v1/services

Lists services visible to the current token. Use cursor and limit for pagination.

POST/v1/routes

Creates a named route to an existing service. Route names are unique within an environment.

Create a route
curl -X POST https://api.vless.blog/v1/routes \
  -H "Authorization: Bearer $GATEWAY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "payments",
    "service_id": "svc_payments",
    "timeout_ms": 3000,
    "retry_count": 1
  }'
POST/v1/proxy/{route}

Forwards a request through the named route. Query parameters, body, and supported headers are sent to the upstream service.

GET/v1/requests/{request_id}

Returns gateway timing, selected upstream, retry count, and final outcome for one request. Request metadata is retained for 30 days.

Responses

Management endpoints return a JSON object. Proxy endpoints return the upstream body, plus gateway metadata in headers.

HeaderExampleMeaning
X-Request-Idreq_01J5D5W8R9F2Stable identifier for logs and support.
X-Gateway-Latency18Gateway processing time in milliseconds.
X-RateLimit-Remaining997Requests left in the current window.

Error handling

Gateway errors use a stable machine-readable code. A failed upstream remains distinguishable from a rejected gateway request.

429 Too Many Requests
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Request quota exceeded for route payments.",
    "request_id": "req_01J5D62AYM0P"
  }
}
StatusCodeRecommended action
400invalid_requestCheck required fields and JSON types.
401authentication_failedReplace or re-scope the token.
404route_not_foundVerify the route name and environment.
409idempotency_conflictReuse a key only for the same request body.
429rate_limit_exceededWait for Retry-After or request a higher quota.
502upstream_unavailableRetry with backoff and inspect service health.