Name to Avatar

API Docs

Everything you need to integrate Name to Avatar into your application

Avatars

Create, load, list, and share avatar records. Every avatar endpoint returns the same avatar item shape.

POST
/api/v1/avatars

Generate an avatar and demographic inference from a person's name.

Request Body

name - string, required if no name_id.

name_id - UUID from POST /api/v1/names.

country - optional country from GET /api/v1/countries.

style - optional avatar style, or a comma-separated set to pick one at random. Supported values: professional, casual, and creative. If not specified, professional is used by default.

age - optional avatar age, or a comma-separated set to pick one at random. Supported values: child, teenager, adult, and senior. If not specified, adult is used by default.

forceNew - optional boolean. Requires a valid x-api-key to bypass canonical-avatar reuse.

Query Parameters

stream=1 returns NDJSON progress events: analyzing, generating, complete, or error.

Duplicate in-flight requests may return 202 with a pending payload and Retry-After.

Response

This exact avatar item shape is also returned by GET /api/v1/avatars items, GET /api/v1/avatars/random, and GET /api/v1/avatars/{id}.

Examples

GET
/api/v1/avatars

List stored public avatars with filtering and pagination.

Query Parameters

name - optional fuzzy match against the stored name.

gender - optional, one of male, female, or unisex.

style - optional, one of professional, casual, or creative.

age - optional, one of child, teenager, adult, or senior.

country - optional country from GET /api/v1/countries.

page and page_size - optional positive integers. Defaults are 1 and 24.

Response

Each items[] entry uses the same avatar item shape shown above.

Example

GET
/api/v1/avatars/random

Return one random public avatar. "Public" uses the same visibility rule as the avatar catalog.

Try it out

Fetch a live response from /api/v1/avatars/random.

GET
/api/v1/avatars/{id}

Load one stored avatar by its UUID.

id must be the avatar UUID.

Names

Generate names or load stored name records. Every name endpoint returns the same name item shape.

POST
/api/v1/names

Generate a random, culturally authentic personal name.

Request Body

language - optional two-letter code, or a comma-separated set to pick one at random.

country - optional supported country name. Cannot be combined with language.

Response

This exact name item shape is also returned by GET /api/v1/names/random and GET /api/v1/names/{id}.

Examples

GET
/api/v1/names/random

Return one random stored name from the database.

Try it out

Fetch a live response from /api/v1/names/random.

GET
/api/v1/names/{id}

Load one stored name by its UUID.

id must be the name UUID.

Other

Lookup endpoints for supported countries and language codes.

GET
/api/v1/countries

List all supported country names. Use them with POST /api/v1/names and POST /api/v1/avatars.

GET
/api/v1/languages

List all supported language codes. Use them with POST /api/v1/names.

Error Responses
400Bad Request
404Not Found
429Too Many Requests
500Internal Server Error