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.
- •https://talk.selviaai.com/v1/llms.txt: the whole API in one text file: what it is, the quick start, sessions, the render-mode protocol and every route on one line.
- •https://talk.selviaai.com/v1/openapi.json: every route with its request and response shapes, for tools that read OpenAPI.
- •https://talk.selviaai.com/v1/docs: the same, browsable, for you.
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
deleteunless 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.
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-secretmakes a new one. - •Test every one. Run each tool's and hook's Test call and fix the endpoint until
okistrue. 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.