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:
| Header | Behavior |
|---|---|
Authorization | Replaced with the API's own auth credentials |
Content-Type | Forwarded as-is |
X-API-Key | Stripped (used for PincerAPI auth only) |
| All others | Forwarded transparently |
Response
The proxy returns the downstream API's response directly:
- Same status code
- Same response body
- Same content type
Plus these added headers:
| Header | Description |
|---|---|
X-Pincer-Cost | Cost charged for this call (USD) |
X-Pincer-Balance | Your remaining balance after the call |
X-Pincer-Api | The 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
| Status | Error | Description |
|---|---|---|
| 400 | Bad Request | Malformed proxy path or missing required params |
| 401 | Unauthorized | Missing or invalid PincerAPI auth |
| 402 | Payment Required | Insufficient balance |
| 404 | Not Found | API not in directory or endpoint doesn't exist |
| 429 | Rate Limited | Too many requests (check Retry-After header) |
| 502 | Bad Gateway | Downstream API returned an error |
| 503 | Service Unavailable | Downstream API is down |