Skip to main content
POST
Generate a new component

Authorizations

x-api-key
string
header
default:yalg_live_your_api_key
required

YALG Developer API key. Send it in the x-api-key header from a server-side environment only.

Body

application/json
prompt
string
required

Natural language description of the component to generate

Required string length: 10 - 2000
Example:

"A stat card that displays a percentage with a circular progress indicator"

category
enum<string>
required

Category for the component

Available options:
text,
stat,
transition,
cta,
custom
Example:

"stat"

name
string

Name for the component

Maximum string length: 200
Example:

"Circular Progress Card"

tags
string[]

Tags for searchability

Example:
themeId
string<uuid>

Theme ID to use for generation context

isPublic
boolean
default:false

Whether the component should be public

Response

Component generated successfully

Generated visual component.

id
string<uuid>

Component identifier.

Example:

"018f9f40-7d7b-7712-9b0f-2e5d9fd5df3f"

name
string
Example:

"Metric counter"

category
string
Example:

"chart"

code
string

Generated component source code.

isPublic
boolean
Example:

false

isValidated
boolean
Example:

true

createdAt
string<date-time>
Example:

"2026-06-20T17:24:39.000Z"

updatedAt
string<date-time>
Example:

"2026-06-20T17:24:39.000Z"