Takeaways from migrating our image classifier from GPT-5.5 to OpenAI's Decisions API
Earlier this month, we realized that one of the models we were using to classify media sent by users to our agents was costing us even more than our hard reasoning models. We were using GPT-5.5 to pick which scenario an image matched before passing it to the agent. Think of it as a gateway that decides which instructions the main model gets for that media. It was 52% of our whole OpenAI bill.
We realized that this was:
- Wasteful. Most of the media users sent never needed special instructions, yet every image went through GPT-5.5 first
- Expensive. This model cost us more than the reasoning model itself, especially for handling an average of 120k images per month
- High latency. An average of 3.5 seconds
When OpenAI released its Decisions API (its take on decision models like TypeSafe's Jev, which make fast, structured decisions for software instead of generating conversational text), we took the initiative to use it as a gateway to decide whether the media should be passed to the model first, avoiding an expensive call. After doing some evaluations, here are the takeaways and implementation details from this migration.
The approach
The Decisions API lets you categorize or classify an input, like an image and a message, into answers you define. According to OpenAI [1], it is “up to 10x faster than GPT‑6 Luna through the Responses API”, and it only charges for input tokens.
It comes in three types:
| Type | Use it when | Example |
|---|---|---|
predicate | One condition decides whether to act, and you set the cutoff on its probability | "Is the customer asking to talk to a human?" |
choice | You need exactly one label from a list with no order | "Which issue does this screenshot show: payment error, order status, promo card, or none?" |
score | You need a position on an ordered scale, like severity | "How frustrated is the customer: calm, annoyed, or angry?" |
At Semantiks, we let the customers set up scenarios for the media that their clients might send. This could be for limiting the agent from processing certain images, invoices, types of files, certain content, among others.
For this reason, since these scenarios don't follow any order, choice was a great fit, especially because the Decisions API accepts images and runs on GPT-6 Luna, which has a 1,050,000-token context window. It allowed us to pass a "none" option whenever the conditions weren't met.
Besides these two criteria, we moved forward with the Decisions API for these additional reasons:
- It decides before the expensive call happens. It met the scope before passing the criteria to the model, avoiding an expensive call
- It supports our data policies: Zero Data Retention and Private Safety Processing
- It met our latency goal: under 1 second (0.73 s on average in production)
Had we needed to rate media on an ordered scale, like how severe an issue is, we would have moved forward with score. But since this was more of a gateway, a single pick from the list, which still comes with a confidence, was all we needed.
Implementation
We used LangChain's middleware hook to run the decision between the human input message and the LLM node, and called the Decisions API directly inside it.
Think of a scenario where we have to decide whether an image is an invoice, a withdrawal screen, or a user profile page. For these choices, given certain conditions, the LangChain snippet would look something like this:
from langchain_core.messages import HumanMessage
from langchain_openai.decisions import Choice, OpenAIDecisions
decisions = OpenAIDecisions(model="gpt-6-luna")
message = HumanMessage(content=[
{"type": "image", "base64": image_b64, "mime_type": "image/jpeg"},
{"type": "text", "text": "Why can't I withdraw my money?"},
])
response = decisions.invoke({
"input": message,
"questions": {
"scenario": Choice(
instructions="Pick the media scenario this image matches.",
choices={
"invoice": "An invoice or billing document",
"withdrawal": "Withdraw-money screen with the amount and payout method",
"user_profile": "User profile or account details page",
"none": "No scenario matches",
},
),
},
})
answer = response.choices["scenario"]
print(answer.choice, answer.confidence) # withdrawal 0.9
Additionally, LangChain's ready-made wrapper makes it super easy to set up. Plain text and images go through untouched, and anything richer, like a whole conversation or a JSON object, gets serialized for you while base64 images stay in place. Keep in mind it's still in beta.
Monitoring and evals
When migrating, we compared performance, latency, and how accurately each model matched the scenarios. In production, this classifier handles more than 120,000 images a month across our customers' scenarios. For the comparison, we replayed 50 real image turns from production on both models, with the same scenarios. The Decisions API picked the same scenario as GPT-5.5 in 100% of them, but 90% were "none", so only 10% were real matches.
| GPT-5.5 | Decisions API | |
|---|---|---|
| Time per decision | 3.5 s | 0.73 s |
| Cost per decision | $0.037 | $0.00077 |
| Monthly cost | $4,397 | ≈ $92 |
We used Datadog's Agent Observability to trace our agents and track the average latency of these models. Here we can see a comparison of the previous model against the Decisions API in our services:
Takeaways
- Use a decision model when you need to filter whether a request should be passed to a more expensive model. Our image classifier was 52% of our OpenAI bill, and moving it to the Decisions API made each decision about 48x cheaper.
- Decision models are faster and less expensive: 0.73 s instead of 3.5 s per decision, and with OpenAI's Decisions API you only pay for input tokens.
- Use them to block domain-specific content you wouldn't want your customers to send, or wrong data you wouldn't want to process, before it ever reaches your main model.
- Pick the simplest answer type that does the job. Score is for ordered levels; for a gateway, a single choice was enough.
Sources
- OpenAI: Build more responsive apps with the Decisions API
- LangChain: OpenAI Decisions integration
Work with us
If you're interested in learning more about how we at Semantiks help our customers control what their agents process, like which images, files and content reach the model, please reach out to eduardo@semantiks.ai or book a meeting here! We'd be happy to hear about your use cases.