Skip to main content

Build with an AI assistant

A prompt template that gives your coding assistant the facts it needs, instead of letting it guess at the API.

Coding assistants are confident about APIs they have never seen. Ask one to "add a talking avatar" and you will get a plausible SDK that does not exist, a bearer token where there is none, and a WebSocket connection to a URL that is always null.

The fix is to point it at llms.txt — a page-by-page index of these docs, written for assistants rather than people. Paste the template below, fill in two blanks, and the assistant works from the real contract instead of its own recollection.

The prompt​

I'm adding Golden Engine — an API for real-time AI avatar conversations — to my app.

## What I want to build
<DESCRIBE THE FEATURE — e.g. "a 'talk to our product expert' button on the pricing
page that opens a live avatar session">

## My stack
<e.g. Next.js 15 App Router, TypeScript, deployed on Vercel>

## The API
Start by reading https://docs.goldenengine.ai/llms.txt — a short index written for
assistants. It carries the base URL, the auth header, and the handful of facts that
are easiest to get wrong. Follow its links for anything you need in more depth: every
page has a Markdown twin at the same path plus `.md`.

The OpenAPI spec is at https://docs.goldenengine.ai/openapi.json.

Do not guess at endpoints, SDKs or field names. If it is not in those files, ask me.

## What I want from you
Walk me through it step by step. Before writing any code, tell me which endpoints you
will call and where each one runs — server or browser. Then give me the files, and
list what I need to set as environment variables.

Filling it in​

Only two blanks matter, and being specific in both is what separates a useful answer from a generic one.

What I want to build. "A support widget" gets you a support widget in the abstract. "A button in our footer that opens a 640px-tall avatar session, using the avatar whose ID is in AVATAR_ID, and stores the transcript against the logged-in user" gets you code you can paste.

My stack. Name the framework and the routing model. "Next.js" leaves the assistant guessing between Pages and App Router; "Next.js 15 App Router" does not.

If your assistant cannot browse​

The template assumes the assistant can fetch a URL. Not all of them can, and some will quietly invent the contents rather than admit it — which is the failure this page exists to prevent. Check that it actually quotes something specific back to you, like the X-Api-Key header or a /v1/ path.

If it cannot fetch, paste the docs in instead. https://docs.goldenengine.ai/llms-full.txt is the entire documentation as one file, small enough for a context window. For a single topic, the Copy page button at the top of any page hands you that page's Markdown, or opens it directly in ChatGPT or Claude.

Check four things in what comes back​

Assistants get these wrong in a consistent order, so they are worth checking in that same order.

Is the API key server-side only?

Look for the key in any file that ships to the browser — anything under a client directive, a NEXT_PUBLIC_ variable, or a fetch in a component. POST /v1/conversations must run on your server. If the assistant put it in a click handler, the key is now public and can create avatars billed to your account.

Is the conversation minted per visitor, at click time?

A single conversation_url fetched at build time, cached, or shared between visitors is wrong twice over: the token expires after 60 minutes, and anyone holding the URL can join that session. One conversation, one visitor, created when they click.

Does the iframe carry the allow attributes?

allow="microphone; camera; autoplay; fullscreen". Without microphone the avatar never hears anything. Leave out camera and the visitor gets a camera error the moment they start: the embed turns the camera on by itself when they press its Start Session button. fullscreen is what the control bar's fullscreen button needs. Start Session is the embed's own overlay, so the only button your page needs is the one that creates the conversation.

Does error handling branch on `code`?

if (error.message.includes("not found")) is a bug waiting for a copy edit. The code field is the stable contract; the message is prose and can change.