#message(prompt: string, maxTokens: int32): string
inferencepaidopen
Prompt the model to generate text.
- params
- prompt — The prompt to generate text from.
- maxTokens — The maximum number of tokens to generate.
- kind
- inference: runs AI inference; maxTokens caps the output tokens
- price
- $2.50 per 1M input tokens · $10.50 per 1M output tokens
- recipient
org_7-qf-a35t-Evoi1CIdS8Jg- access
- open: anyone can call it
usage
requestscript
request SonnetMessage {
const sonnet: sh.stellarium.inference.claude.Sonnet
const result = sonnet.message(prompt: "prompt", maxTokens: 1024)
if (result.error != null) {
return result.error.message
}
return result.value
}Your node first asks the host for an estimate: the input tokens, and maxAmount, the charge for those plus maxTokens output tokens. It signs an inference voucher for maxAmount if that is within its INFERENCE_COST_LIMIT_MICRO_USD. The operator holds maxAmount on your organization's balance, then charges the tokens the call actually used at these rates: 80% to the recipient organization, 20% platform fee.