Check whether AI is available, ask one-off questions, hold a conversation and get structured JSON back. AI runs under the user's VibeOS plan and credits, so always handle "not available".
canUse() never throws. Call it before showing AI features so you can explain problems instead of failing.
One question, one answer. The optional instructions steer tone and format.
Send the whole conversation each time and the AI remembers earlier messages. The Result panel shows the exact messages array sent.
Give the AI an example of the shape you want and get a real object, ready to use in your app.
What aiProblem() (below) tells your users for each canUse() code.
Return values and errors show up here, exactly as your code would get them.
Every call this page made. Click one to see its result again.
The helpers this page runs on. Copy them into your app as they are.