API
Call wapgee tools over HTTP with a personal API token. The tools on the site keep running in your browser. The API is a separate, server-side path.
Getting a token
- Log in.
- Open Tools, then Tokens in the dashboard.
- Name the token and create it. The full token is shown once. Copy it then. It cannot be retrieved later.
Each account can hold 5 active tokens. Revoking a token takes effect immediately.
Authentication
Send the token on every request in the Authorization header:
Authorization: Bearer wpg_your_tokenA missing, unknown or revoked token, or a locked account, returns 401.
Credits
Credits are the unit of API usage. Each request costs a fixed number of credits, listed under Tools. Credits are shared across all tokens on an account. 5 credits = $0.01.
Every account receives 50 credits per UTC day. The daily amount resets at 00:00 UTC and does not carry over.
Only successful requests are charged. Rejected requests (validation errors, rate limit, insufficient credits) cost 0. If a request fails after the charge, the credits are refunded.
Each token is limited to 30 requests per minute. Usage history is retained for 90 days.
Response headers
| Header | Meaning |
|---|---|
X-Credits-Cost | Credits charged for this request. 0 if rejected or refunded. |
X-Credits-Remaining | Credits left after this request. |
X-RateLimit-Limit | Requests allowed per minute for this token. |
X-RateLimit-Remaining | Requests left in the current window. |
X-RateLimit-Reset | When the window resets, as unix time in seconds. |
Retry-After | On 429 only. Seconds until you can retry: until the rate-limit window resets (at most 60) for rate_limited, or until the next 00:00 UTC for insufficient_credits when the daily amount can cover the request. |
Credit headers are sent on every authenticated tool response, including errors. A rate_limited response sends X-Credits-Cost: 0 only. A 401 or an unexpected 500 may send neither. GET /api/v1/usage reports a cost of 0.
Errors
Errors return { success: false, error, code } with the matching HTTP status. code is a stable identifier. Match on it, not on the message.
HTTP/1.1 429 Too Many Requests
X-Credits-Cost: 0
X-Credits-Remaining: 2
Retry-After: 43200
{
"success": false,
"error": "Insufficient credits.",
"code": "insufficient_credits",
"credits": {
"required": 5,
"remaining": 2,
"dailyFree": 50,
"resetsAt": "2026-10-05T00:00:00.000Z"
}
}| Status | Code | When |
|---|---|---|
400 | invalid_request | The request failed validation, or the tool rejected the input. |
401 | missing_token | No token was sent. |
401 | invalid_token | The token is not recognised. |
401 | token_revoked | The token has been revoked. |
401 | account_locked | The account is locked. |
413 | payload_too_large | The input is larger than the endpoint allows. |
429 | insufficient_credits | The request costs more credits than the account has. |
429 | rate_limited | The token exceeded its per-minute limit. |
500 | internal_error | An unexpected error occurred. |
502 | upstream_error | A dependency failed, for example PDF rendering or fetching a URL. |
503 | service_unavailable | The service is busy. Retry shortly. |
504 | timeout | The request took too long. |
Check your credits
GET /api/v1/usage returns your credit balance and the cost of each tool. It is free of charge and also shown on the Credits page.
curl https://wapgee.com/api/v1/usage \
-H "Authorization: Bearer wpg_your_token"{
"success": true,
"credits": {
"free": 42,
"paid": 0,
"total": 42,
"dailyFree": 50,
"resetsAt": "2026-10-05T00:00:00.000Z"
},
"tools": [
{ "tool": "csv-json-converter", "cost": 1 },
{ "tool": "csv-to-parquet", "cost": 4 },
{ "tool": "html-table-to-markdown", "cost": 1 },
{ "tool": "html-to-pdf", "cost": 5 },
{ "tool": "json-yaml-typescript", "cost": 1 },
{ "tool": "markdown-to-pdf", "cost": 5 },
{ "tool": "parquet-to-csv", "cost": 4 }
]
}Each tool's request and response are documented on its tool page.
Tools
Each endpoint is documented in the API section of its tool page.
| Tool | Endpoint | Credits per request |
|---|---|---|
| Markdown to PDF | POST /api/v1/tools/markdown-to-pdf | 5 |
| HTML to PDF | POST /api/v1/tools/html-to-pdf | 5 |
| CSV ⇌ JSON Converter | POST /api/v1/tools/csv-json-converter | 1 |
| JSON / YAML / TypeScript | POST /api/v1/tools/json-yaml-typescript | 1 |
| HTML Table to Markdown / CSV | POST /api/v1/tools/html-table-to-markdown | 1 |
| Parquet to CSV | POST /api/v1/tools/parquet-to-csv | 4 |
| CSV to Parquet | POST /api/v1/tools/csv-to-parquet | 4 |
Changelog
- October 2026. Credits replace the per-tool daily limits.
GET /api/v1/usagenow returnscreditsandtools[].cost. Usecredits.totalin place oftools[].remaining.