Skip to main content
Your Truffle exposes an OpenAI-compatible inference API at /if2/v1/*. You can use it via the CLI or call the HTTP endpoints directly.
For the interactive CLI experience (truffile infer), see the CLI guide. This page covers the raw HTTP endpoints.

List Models

Or via the CLI:

Chat Completions

Request body

Streaming

Set "stream": true and optionally "stream_options": {"include_usage": true} to get token usage in the final event. The response is an SSE stream of data: {...} lines, terminated by data: [DONE]. Each event contains a choices[0].delta object with incremental content, reasoning, and/or tool_calls.

Image input

Pass images as part of a message’s content array:
Supported image types: image/jpeg, image/png, image/bmp.

MCP Testing with the CLI

truffile infer doubles as an MCP test harness. Start your MCP server locally, then:
See the CLI guide for full details.