API DOCUMENTATION V2

API v2 errors and retries

Handle GenderAPI v2 Problem Details, validation errors, rate limits and billing uncertainty. Understand retry charges and when to contact support.

Errors and HTTP status codes

Application errors use application/problem+json (RFC 9457). Branch on the stable code and action, not the human-readable detail. Validation errors include JSON Pointer locations in errors. Include request_id when contacting support. Proxy or transport failures can return a different body, so check Content-Type before parsing JSON.

The following synthetic 422 example shows invalid email syntax before billing. The public error catalog lists every code, status, explanation and suggested action.

HTTP statusTypical meaningNext step
400 / 413 / 415Malformed JSON, oversized body or unsupported media type.Correct the request.
401 / 403Access rejected, account restriction or insufficient credits.Inspect code; correct access or replenish credits / wait for trial reset.
422Invalid input or incompatible options.Correct the fields identified in errors.
404 / 405Unknown route or unsupported HTTP method.Check the endpoint path and the Allow response header.
429Rate or concurrency limit.Wait for Retry-After before sending another request.
500Unexpected server failure.Contact support with request_id; check billing before retrying.
502 / 503 / 504Provider, dependency, billing or timeout failure.Inspect code, action and billing_status before retrying.
Illustrative JSON response
{
  "type": "urn:genderapi:problem:validation_error",
  "title": "validation error",
  "status": 422,
  "detail": "A valid email address is required.",
  "instance": "urn:uuid:11111111-1111-4111-8111-111111111111",
  "code": "validation_error",
  "request_id": "11111111-1111-4111-8111-111111111111",
  "documentation": "https://api.genderapi.io/api/v2/errors",
  "action": "correct_request",
  "errors": [
    {
      "pointer": "/value",
      "message": "Invalid email address."
    }
  ],
  "meta": {
    "request_id": "11111111-1111-4111-8111-111111111111",
    "duration_ms": 12,
    "access": {
      "mode": "ip_trial",
      "reason": "api_key_missing"
    },
    "usage": {
      "charged_credits": 0,
      "remaining_credits": null,
      "billing_status": "not_charged",
      "resets_at": "2026-09-26T12:00:00.000Z",
      "limit": 10,
      "period_seconds": 86400
    }
  }
}

Retries and billing

Every prediction request is a new operation, including an identical request sent again. Normal credit rules apply to each request. There is no duplicate-request protection, so avoid automatic retries after a connection loss or an unknown outcome.

For a 429 response, wait for Retry-After before sending another request. For prediction failures, inspect code, action and meta.usage.billing_status first. For billing_reconciliation_required or unconfirmed billing, contact support with request_id before retrying.

A partially successful batch may return HTTP 200. Check each item and resubmit only failed items after billing is confirmed; successful items would be billed again if resubmitted.

X-Request-ID and meta.request_id identify the current HTTP attempt. Read /usage for the current balance. HEAD does not start a billable prediction. Prediction and account responses are not cacheable.

Clients should tolerate additive response fields and preserve null values when information is unavailable.

Request limits

Handle HTTP 429 and Retry-After rather than assuming requests will always be accepted at these ceilings. Service capacity is shared. The values shown are the current service defaults. Rate-limit responses include X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix seconds). Retry-After is a delay in seconds. These headers describe request limits, not remaining credits. Even the free /usage read counts toward rate limits.

LimitValue
JSON request body64 KiB maximum
Prediction value1–254 characters
Batch50 items with an API key; 10 with the IP trial
Account rate120 requests per minute
IP rate600 requests per minute
Concurrent operations2 per account; 16 across the service