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 status | Typical meaning | Next step |
|---|---|---|
| 400 / 413 / 415 | Malformed JSON, oversized body or unsupported media type. | Correct the request. |
| 401 / 403 | Access rejected, account restriction or insufficient credits. | Inspect code; correct access or replenish credits / wait for trial reset. |
| 422 | Invalid input or incompatible options. | Correct the fields identified in errors. |
| 404 / 405 | Unknown route or unsupported HTTP method. | Check the endpoint path and the Allow response header. |
| 429 | Rate or concurrency limit. | Wait for Retry-After before sending another request. |
| 500 | Unexpected server failure. | Contact support with request_id; check billing before retrying. |
| 502 / 503 / 504 | Provider, dependency, billing or timeout failure. | Inspect code, action and billing_status before retrying. |
{
"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
}
}
}Error response fields
| Field | Type | Nullable | Example | Description |
|---|---|---|---|---|
type | string | No | "urn:genderapi:problem:validation_error" | URI identifying the problem type. |
title | string | No | "validation error" | Short human-readable error title. |
status | integer | No | 422 | HTTP status code. |
detail | string | No | "The request does not match the schema." | Explanation of this specific failure. |
instance | string | No | "urn:uuid:550e8400-e29b-41d4-a716-446655440000" | Identifier for the failed request. |
code | string | No | "validation_error" | Stable machine-readable error code. |
request_id | string | No | "550e8400-e29b-41d4-a716-446655440000" | Unique identifier for this HTTP attempt; also sent in X-Request-ID. |
documentation | string | No | "https://api.genderapi.io/api/v2/errors" | Link to the error catalog when supplied. |
action | string | No | "correct_request" | Suggested recovery action; present when defined in the error catalog. |
errors | array<object> | No | [{"pointer":"/value","message":"must NOT have fewer than 1 characters"}] | Validation issues, present when available. Each item contains pointer and message. |
errors[].pointer | string | No | "/value" | JSON Pointer identifying the invalid input. |
errors[].message | string | No | "must NOT have fewer than 1 characters" | Explanation of the validation issue. |
Access, billing and request metadata
| Field | Type | Nullable | Example | Description |
|---|---|---|---|---|
meta.request_id | string | No | "550e8400-e29b-41d4-a716-446655440000" | Unique identifier for this HTTP attempt; also sent in X-Request-ID. |
meta.duration_ms | integer | No | 42 | Request processing time in milliseconds. |
meta.access.mode | string | No | "api_key" | api_key, ip_trial or unauthenticated. Verify api_key when using a paid account. |
meta.access.reason | string | Yes | null | Trial fallback reason: api_key_missing, api_key_invalid or api_key_not_found; null otherwise. |
meta.usage.charged_credits | integer | Yes | 1 | Net credits charged. Zero before charging or after a full confirmed refund; null when billing is unconfirmed. |
meta.usage.remaining_credits | integer | Yes | 99 | Balance when the operation completes. May be negative; null when unavailable or billing is unconfirmed. |
meta.usage.billing_status | string | No | "confirmed" | not_charged, confirmed or unconfirmed. Check this before retrying a failed prediction. |
meta.usage.resets_at | string | Yes | "2026-09-27T12:00:00.000Z" | IP trial reset time in UTC (ISO 8601); null for API-key accounts or when unknown. |
meta.usage.limit | integer | Yes | 10 | IP trial allowance; null for API-key accounts. |
meta.usage.period_seconds | integer | Yes | 86400 | IP trial window in seconds; null for API-key accounts. |
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.
| Limit | Value |
|---|---|
| JSON request body | 64 KiB maximum |
| Prediction value | 1–254 characters |
| Batch | 50 items with an API key; 10 with the IP trial |
| Account rate | 120 requests per minute |
| IP rate | 600 requests per minute |
| Concurrent operations | 2 per account; 16 across the service |