Run a chat completion on Synap
synap_chat_completionSend a conversation to a model on Synap, Linkrra's OpenAI-compatible inference API, and get the model's reply. Use this when you need text generated, code written or a question answered by one of the open models Synap serves. This is the only tool here that costs money: it bills prompt and completion tokens to the Synap API key supplied as the Authorization: Bearer header on the MCP connection. With no key it returns an error and nothing is spent; a key with no balance returns insufficient_credits. Call synap_estimate_cost first if the price matters. Returns the standard OpenAI chat.completion JSON (choices[0].message.content holds the reply, usage holds token counts). The call is not streamed and keeps no memory between calls — send the full message history each time.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model id exactly as returned by synap_list_models, e.g. "qwen/qwen3-coder-30b-a3b-instruct". Use "synap-v1" to let Synap pick the cheapest model that can handle the request. | |
| messages | Yes | The conversation so far, oldest first. The last message is normally the user turn to answer. | |
| max_tokens | No | Upper limit on tokens generated in the reply. Omit to use the model default; lower it to cap cost. | |
| temperature | No | Sampling randomness, 0 to 2. Lower is more deterministic. Omit to use the model default. |