- A key is optional, so Corsair does not prompt for one. With no key connected, GenderAPI.io falls back to an IP-scoped trial of 10 credits per 24 hours, shared by every caller behind the same public IP (on a shared server, every tenant without a key). Connect the key with a connect link or the
keyoption before paid use.meta.access.modesays which one was used:api_keyorip_trial. A missing or unknown key falls back too, while a disabled, expired or restricted key does not and answers 403. A trial batch takes at most 10 items. - An unknown gender is a billed result, not an error. The answer is HTTP 200 with
gender: null,result_status: "unknown"and areasonsuch asnot_foundorambiguous. sourcesays who answered.datasetmeans the name was in the database,aimeans a model inferred it, andnonemeans nothing could.confidence_kindfollows:observed_frequencyfor the dataset,model_reportedfor AI.- What a call costs. A single request defaults to
ai_mode: 'fallback', which costs 1 credit in total whether the dataset or AI answers.ai_mode: 'always'costs 2, and so does aforceToGenderizecall that AI answers. A batch defaults tooff, so passai_mode(for the batch or per item) when a batch needs AI. Phone validation costs 1, and so does an unknown result. - A batch item can fail without failing the batch. Only successful items are billed, and
meta.summarycountstotal,succeeded,unknownandfailed. - A failed prediction may already be charged. The error catalog says to inspect
billing_statusbefore retrying, because a retry starts a new billed operation. The plugin does not retry a prediction or phone call after a 5xx, a timeout or a dropped connection; an HTTP failure is core’sApiError, whose body keepsmeta.usage.billing_statuswhen the API sent one (genderApiIoErrorInfo(error).billingStatusreads it). Only the free GET routes and a 429 are retried. usage,capabilitiesanderrorCatalogare free. They are safe to poll: the first gives the balance, the second the batch limit and AI availability, the third every error code with what to do about it.- Confidence is not a calibrated probability. The docs say so explicitly, so treat it as a ranking signal rather than a certainty.
- 6 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the GenderAPI.io API key before the first call: More: API Key
pnpm corsair setup --plugin=genderapiio --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Validate and format a phone numberWhat’s next
API reference
Every
genderapiio.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.