How to get started with ClearRun chat
Chat sends your question to a model, scores the answer, and returns both in one reply. Each successful call is signed and comes with a receipt you can look up later. A turn costs at most 4 credits. A verified free account can create one developer key. Like every ClearRun score, it does not check facts.
Last updated
Send a message
curl -s https://api.clearrun.net/api/chat \
-H "Authorization: Bearer $CLEARRUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "message": "Is coffee bad for your heart?" }'
message is required. It can be up to 32,000 characters.
To continue a conversation, send back the sessionId from the last reply.
What you get back
responseText: the model's answer.verdict: the score for that answer, a short summary, a verdict id, and ClearRun's signature (signature,signatureKeyId,signatureAlg).receipt: ClearRun's record of this call. Keep the verdict id to look it up later. See How to verify a ClearRun receipt.
The SDK returns the same fields:
import { createKernelClient } from '@clearrun/sdk';
const client = createKernelClient();
const chat = await client.chat({ message: 'What is the capital of France?' });
console.log(chat.responseText, chat.verdict.score, chat.verdict.verdictId);
A chat turn costs at most 4 credits. See the pricing page.
In an MCP client, the same call is the clearrun_chat tool. See How to use the ClearRun MCP server.