API ReferenceServices & Catalog
Proxy to Service
Proxy requests to a registered third-party service through the gateway.
Proxy to Service
Forward any HTTP request to a registered service. The gateway handles authentication, billing, and logging.
Authentication
Requires X-API-Key header. Credits are deducted per call.
Path parameters
| Parameter | Type | Description |
|---|---|---|
service_id | string | Service UUID |
* | string | Sub-path forwarded to the upstream service |
Optional headers
| Header | Description |
|---|---|
X-Wallet-Id | Wallet UUID for usage tracking. Also accepted as ?wallet_id query param. |
Request
# Proxy GET request
curl http://localhost:4000/v1/proxy/SERVICE_ID/forecast?city=London \
-H "X-API-Key: ak_your_key" \
-H "X-Wallet-Id: wallet-uuid"
# Proxy POST request
curl -X POST http://localhost:4000/v1/proxy/SERVICE_ID/analyze \
-H "X-API-Key: ak_your_key" \
-H "Content-Type: application/json" \
-d '{"text": "Hello world"}'Response
The response is passed through directly from the upstream service. Status codes, headers, and body are all forwarded as-is.
How it works
- Request arrives at
/v1/proxy/:service_id/path - Gateway looks up the service's
base_url - Request is forwarded to
{base_url}/path - Usage is logged and credits deducted
- Upstream response is returned to the caller
SDK usage
const response = await aibank.catalog.call(
"service-uuid",
"/forecast?city=London"
);
const data = await response.json();Errors
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 402 | INSUFFICIENT_CREDITS | No credits remaining |
| 404 | -- | Service not found |