API · Get started

Building with AI agents

Everything the console does is in the API, so an AI agent with a key can do the setup for you: create the agent, pick its face and voice, teach it your business and start sessions.

Give it the docs

Point your AI assistant or coding agent at one of these. Both are generated from the API, so they never fall behind it.

An example instruction

Prompt

You can use the Selvia AI API with the key in the SELVIA_API_KEY environment variable.
Read https://talk.selviaai.com/v1/llms.txt first: it describes every route.
Send the key as "Authorization: Bearer $SELVIA_API_KEY". Base URL: https://talk.selviaai.com/v1

Task: create an agent for "Bloom Hair Studio" (https://bloomhair.example) that greets visitors
in English and Spanish, uses a friendly woman's face and voice, and stands in a salon backdrop.
Build its knowledge from the website, then start a session and give me the player link.

The catalog routes describe every face in words and give stills of it, so an agent that can't see a gallery can still choose: see Faces, voices & backdrops.

Give it a safe key

  • •Make a key just for the agent and name it after it, so the console shows which key did what.
  • •Leave out delete unless the task needs it. Even with it, every delete must carry ?confirm=true.
  • •A key acts for your account and spends from it: sessions are billed per minute. Stop what you start.
  • •Revoke the key when the job is done.
Every change made with a key is recorded (which key, what it called, the result, when), so you can check what an agent changed. See Authentication & keys.

Letting an agent add tools and hooks

An AI agent can set up tools and hooks for you, and write the endpoint that answers them. Tell it three things:

  • •Save the signing secret. The answer that creates an agent's first tool or hook carries its whsec_… secret, shown that once. The agent must put it in your server's secret store straight away. If it is lost, POST /v1/agent/{agent_id}/actions/signing-secret makes a new one.
  • •Test every one. Run each tool's and hook's Test call and fix the endpoint until ok is true. Test calls carry "test": true: the endpoint must answer them without acting.
  • •Follow the warnings. Check every signature, decide who the visitor is from ids you control, and make actions safe to repeat. They are on Your endpoint & signatures and in llms.txt.

Live sessions

An agent can also direct a session while it runs: cut to a close-up when it says something important, or change the backdrop. Your Selvia AI assistant never does this on its own; it happens only when you call the API. See Direct a live session.