AI chat
ai_chatStarts an EdgeCloud chat completion and returns the reply and tokens used. Charges credits by tokens, only on success; price it first with quote or price_list. Needs sign-in (auth_challenge then auth_verify).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"messages": "<messages>"
},
"name": "ai_chat"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model name from price_list | |
| messages | Yes | Chat turns: [{role: system|user|assistant, content}] | |
| quote_id | No | The quote_id returned by quote (valid 5 minutes, single use). Use instead of max_price_credits | |
| max_tokens | No | Most output tokens, 1-2000 | |
| max_price_credits | No | The most you'll pay for this call, in Wave credits. Needed unless you pass quote_id; the call fails if the price is higher |