Proxy Router

The proxy is the core of PincerAPI. It routes your requests to third-party APIs, handling authentication and billing automatically.

Endpoint Format

{METHOD} /api/v1/proxy/{api_id}/{path}

  • api_id — The slug of the API (e.g. openweathermap, sendgrid)
  • path — The downstream API path (everything after the base URL)

Examples

# OpenWeatherMap

GET /api/v1/proxy/openweathermap/data/2.5/weather?q=London

SendGrid

POST /api/v1/proxy/sendgrid/v3/mail/send

Serper (Google Search)

POST /api/v1/proxy/serper/search

Supported Methods

All standard HTTP methods are supported:

  • GET, POST, PUT, PATCH, DELETE

Request Headers

Your request headers are forwarded to the downstream API, with these additions/overrides:

HeaderBehavior
AuthorizationReplaced with the API's own auth credentials
Content-TypeForwarded as-is
X-API-KeyStripped (used for PincerAPI auth only)
All othersForwarded transparently

Response

The proxy returns the downstream API's response directly:

  • Same status code
  • Same response body
  • Same content type

Plus these added headers:

HeaderDescription
X-Pincer-CostCost charged for this call (USD)
X-Pincer-BalanceYour remaining balance after the call
X-Pincer-ApiThe API ID that was called

Pricing Lanes

How the proxy authenticates depends on the API's pricing lane:

  • Instant — PincerAPI uses its own platform key. You pay proxy fee + markup.
  • BYOK (Bring Your Own Key) — You store your API key in PincerAPI. You pay proxy fee only.
  • Managed — Metered billing. PincerAPI manages the subscription.

Error Codes

StatusErrorDescription
400Bad RequestMalformed proxy path or missing required params
401UnauthorizedMissing or invalid PincerAPI auth
402Payment RequiredInsufficient balance
404Not FoundAPI not in directory or endpoint doesn't exist
429Rate LimitedToo many requests (check Retry-After header)
502Bad GatewayDownstream API returned an error
503Service UnavailableDownstream API is down