Endpoint reference
Public machine routes for discovery, identities, elements, generation, search, and OpenAPI.
Discovery
| Method | Route | Response |
|---|---|---|
| GET | /llms.txt | Plain-text agent runbook |
| GET | /llms-full.txt | Complete agent-readable documentation corpus |
| GET | /api/docs/{slug} | One processed documentation page as Markdown |
| GET | /api/agent | Versioned manifest and generation contract |
| GET | /openapi.json | OpenAPI 3.1 JSON |
| GET | /api/catalog | Studio tool catalog, resource links, Shader Library, and deterministic Surface Library |
| GET | /api/labs | Complete Studio lab-plugin catalog |
| GET | /api/materials | Complete shared Shader Library with controls and attribution |
| GET | /api/identities | Built-in template and reference identity records |
| GET | /api/elements | Searchable brand element records |
| GET | /api/generate | Current generation contract and examples |
| GET | /api/search | Self-hosted documentation search index/query response |
| GET | /api/surface-textures/{assetId}/{map} | Allowlisted CC0 surface map with provider/license headers |
Generation
| Method | Route | Content type |
|---|---|---|
| POST | /api/generate | Request: application/json; response: JSON or image/svg+xml |
| OPTIONS | /api/generate | CORS preflight |
Generation supports template, background, element-brief, and design-sequence kinds.
design-sequence returns a response-schema-1 envelope with a version-3, apply-ready Design Lab compatibility document rather than a server-rendered approximation. Apply it with the programmatic browser API; Design Lab validates and normalizes it to CanvasDocument schema 2 with Design Lab source 4. Re-read that source, then invoke design.export with png, jpg, gif, or mp4. GIF and MP4 also accept mode: 'shader-sequence'; this keeps the result on the authentic Canvas/WebGL renderer.
Browser API
Every active Studio tool registers window.glyphfield.studio (version 1). The API discovers and operates visible controls by accessible label, including authorized uploads supplied as File objects. Source-enabled tools also expose exact readSource and async applySource methods. download(artifact) and artifact.download save returned Blob artifacts. Use describe() to discover current tool-specific actions.
Design Lab actions include PNG/JPG stills, GIF, ordinary MP4, sequence GIF/MP4, sequence preview, stop, describe, and configure. await invoke('design.export', { format, mode?, download? }) is the unified entry point. Export actions resolve to an object containing the generated Blob, file name, dimensions, and format; download: true also writes the file through the browser.
Documentation search
| Method | Route | Purpose |
|---|---|---|
| GET | /api/search | Self-hosted Fumadocs/Orama documentation search |
Search is used by the documentation UI and is separate from Studio tool search.
Supporting routes
GET /api/surface-textures/{assetId}/{map} only accepts an assetId published by the surface catalog and a map of color, displacement, metalness, normal, or roughness. It never acts as an arbitrary URL proxy. Successful responses include X-Surface-License and X-Surface-Provider; unavailable maps return 404, and unreachable allowlisted upstreams return 502.
GET /api/github-stars supplies the current repository-star count to product chrome. It is an optional UI utility rather than a generation dependency; consumers must tolerate 503 and stars: null.
OpenGraph routes /api/og-home, /api/og, and /og/docs/{slug}/image.png are covered in Social previews.
Caching
Discovery GET routes are publicly cacheable for a short period. Generation responses use Cache-Control: no-store.
CORS
Agent routes expose:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, AcceptThe current routes do not require an API key.
Recommended discovery order
/api/agent/api/labs- The task-specific catalog
/api/generatewhen producing an HTTP artifact/api/docs/{slug}or/llms-full.txtfor the necessary operating detail
Catalog IDs, schemas, and action lists are authoritative. Examples are explanatory and should not be treated as a substitute for discovery.