IBM Granite Chat ($0.02)
ibm_granite_chatSend role/content messages to IBM Granite models and get assistant replies with token usage; supports open-ended chat and free-form text generation without an IBM Cloud account.
Instructions
Chat completion powered by IBM Granite foundation models (default: ibm/granite-3-8b-instruct). Send a conversation as role/content message pairs and receive the assistant reply with token usage. Use this for open-ended conversation or free-form text generation; for code tasks call ibm_granite_code, and for structured JSON extraction call ibm_granite_analyze. No IBM Cloud account required — pay $0.02 USDC per call via x402.
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": "ibm_granite_chat"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Override the Granite model id (e.g. ibm/granite-3-2b-instruct). Defaults to ibm/granite-3-8b-instruct. | |
| messages | Yes | Conversation history. Must include at least one user message. | |
| temperature | No | Sampling temperature (0 = deterministic). Defaults to 0.7. | |
| max_new_tokens | No | Maximum tokens to generate. Defaults to 1024. |