Use the Vinci API's tool-calling feature to build custom automation that chains multiple API calls and tool executions. This pattern lets you define tools once and let Vinci orchestrate them across multiple steps.
-
Define your tools. Create an OpenAI-compatible
toolsarray with JSON schema definitions of what your tools do. Each tool has a name, description, and required/optional parameters. For example, a "get_weather" tool might accept a location string and return temperature. -
Make the first request. Send your user's request with the
toolsarray to the Vinci API. Vinci analyzes the request and decides which tools to call, if any. The response includestool_callsthat specify the tool name and arguments. -
Execute the tool calls. Your code performs the actions: query a database, call an external API, run a script. Gather the results for each tool call.
-
Send results back. Create
{ "role": "tool", "tool_call_id": "...", "content": "..." }messages for each result and append them to your messages array along with Vinci's priortool_calls. Send the updated messages back to Vinci. -
Continue multi-step workflows. Vinci analyzes the results and may call more tools or return a final answer. Repeat steps 3–4 until Vinci returns a response without
tool_calls. -
Handle streaming if needed. Tool calling works with streaming enabled. Chunks include
tool_callsdeltas so your UI can show tool decisions as they arrive.
Multi-turn tool use stays within your 1,000,000-token context window. Usage is billed against your shared credit balance at the rate for the class serving the request. Published API pricing per 1 million tokens is:
| Class | Input | Output |
|---|---|---|
| Vinci Mezzo | $0.10 | $0.21 |
| Vinci Forte (default) | $1.07 | $3.45 |
| Vinci Fortissimo | $3.45 | $17.25 |
Mezzo cached input is $0.02 per 1 million tokens.
Mezzo is fast and light for everyday chat. For code and file tasks and this kind of tool workflow, Forte works best. Fortissimo is the deepest class, for the hardest work.