Function calling
Send OpenAI tools and get one tool call back: classification picks the tool, extraction fills the arguments.
Send tools on POST /v1/chat/completions and decision-machine-1 returns one tool call.
No API key is required during the launch period.
The model does not reason about your tools. It runs two typed decisions:
Both steps read the user text only. The API joins user messages and discards system, developer, assistant and tool roles.
What comes back
The response is an OpenAI chat completion with finish_reason: "tool_calls" and content: null.
The API returns exactly one tool call, ever. Ids are call_ plus 24 hex characters.
arguments is a JSON string, as in the OpenAI API. Parse it before you use it.
A property with nothing to find in the text comes back null, like reason above. Handle nulls in your tool handler.
The OpenAI SDKs
Point the official OpenAI client at https://api.milliseconds.ai/v1. Any api_key string works.
tool_choice rules
auto and required behave the same way, because the model always returns a tool call on this path.
A classification result that names no known tool falls back to tools[0].
tool_choice: "none" without a response_format.json_schema returns 400:
Forcing one tool
A named tool_choice skips the pick and runs extraction only. It overrides what the text is about.
Tools with no parameters
A tool without parameters, or with no properties, makes no extraction call. arguments is the literal "{}".
This call took 0.07 s, because no model ran.
Write descriptions that describe the case
The tool pick is a classification over your descriptions. A description of the tool’s mechanics classifies badly. Describe the user situation that should trigger the tool.
The same rule applies to parameters: give each property a description that says what to look for in the text.
The writing rules for statements and labels apply here without change.
Limits of this surface
tools wins over response_format when you send both. The tools path runs first.
- One tool call per response. Parallel tool calls do not exist.
- No probability and no confidence. The classification scores stay inside the facade.
- No conversation. The API discards a follow-up
toolmessage, like every non-user role. - The parameters schema goes through the same extraction engine, so the schema support matrix applies.
usage.prompt_tokensreports the request’s input tokens. See Pricing.
Measured latency: 1.16 s for two tools (one classification call plus one extraction call), 0.43 s for a forced tool.
Fewer tools and a forced tool_choice both cut a call.
Call classify and extract directly when you want the label probabilities, the scores for every tool, or a batch of texts in one request. The migration table maps each chat usage to a capability.
Next
- Intent routing — the same routing decision with probabilities you can threshold.
- Structured extraction —
response_format.json_schemawhen you want data, not a tool. - Streaming and differences — what
stream: truereturns and what the facade ignores.