Skip to main content

NewEyes Open API

The NewEyes Open API puts the NewEyes assistant inside your own product. Your users talk to it by text or by voice; it searches, remembers, analyzes, and makes images, videos and music for them, and streams its replies back to your app as they are written.

How it fits together​

Two parts of your product call the API, each with its own credential:

Who callsCredentialWhat it does
Your backendA project secret, created in the consoleCreates your end users, issues their user tokens, and manages them.
Your appA user token, issued by your backend for one end userHolds conversations, uploads files, makes generations, joins voice calls — as that user.

A project secret never leaves your servers. Your app only ever holds a short-lived user token, so a leaked token exposes one user for at most a day, and you can revoke it at any time.

Your backend ──project secret──▶ /v1/users, /v1/users/{id}/tokens
│
│ hands each user their token
▼
Your app ──────user token──────▶ /v1/sessions, /v1/files, /v1/images, /v1/videos,
/v1/music, /v1/realtime, /v1/audio

The building blocks​

  • Project — your organization's space. It has a balance of credits that pays for what your users do, its secrets, and its end users. You create and manage projects in the console.
  • End user — one of your users, created by your backend. Everything an end user makes — sessions, files, generations — belongs to them and is visible only with their token.
  • Session — one conversation, typed or spoken. A text session's replies come either as formatted Markdown or as UI data your app renders (a2ui); you choose when you create it.
  • Task — the assistant's answer to one message. It streams as server-sent events while it runs: its text, the steps it takes, the media it makes, and its end.
  • Generation — an image, video or song made on request, outside a conversation. You start it and poll it until it is done.
  • File — an image, video or audio clip your user uploads, to attach to a message or use in a generation.

Where to go next​