How to use OpenAI decision API with Claude Code

by HarshNov 30, 20268 min read
Instant toolsClaudeAI Use Case

Imagine you ask Claude Code to build you a full-stack application with multiple components. Claude goes in, thinks a little and comes back; you are not satisfied, so you revise the plan and do it 3 times in a row.

Then you look at your credit consumption: 12-15% gone on the decisions alone.

In fact, decision-making has been the bottleneck for years, until TypeSafe recently introduced JEV, a decision-1 model focused on making decisions at lightning speed and at a fraction of the cost.

OpenAI also launched its Decisions API for decision-making, but it's aimed at developers, not the common user like business people (hr, manager, CEO, CTO, CXO) and us.

Worry not; this blog will show you how to use Composio or Composio Instant to solve this problem step by step. Let’s begin

What is a Decision API

Imagine you have 100 emails in your inbox, and you want your agent to figure out which ones need an immediate response.

A traditional LLM can do this, but asking it to reason and generate a response for every email takes time and consumes tokens.

A Decision API solves this by taking in the context, a question and a predefined set of answers. For instance, OpenAI's Decisions API supports three types of decisions:

  • Predicate (how likely something is true),

  • Choice (which option to pick), and

  • Score (how something ranks against defined criteria).

decision API flow

What makes this interesting is that the agent can offload these smaller decisions to a Decision API and focus on executing the actual task.

This makes workflows faster and more cost-efficient, especially when you have hundreds of decisions to make.

Also, as the decisions require a strict schema and are usually text-based, the cost of using this model is also very low:

Now that we have a better understanding of decisions api, let’s look at a few prerequisites

Pre-requires

Before starting, we need a few things set up:

  • Claude Code: The agent we will be using for this demo

  • Composio Account: One can sign up /log in at Composio

To use the OpenAI Decisions API, you will need an API key. We will look into how to get that next.

How To Get OpenAI API Keys

To get the key, follow the steps:

  • Step 1: Visit https://developers.openai.com/ and click the API Dashboard.

    OpenAI Developers homepage with the API Dashboard button highlighted
  • Step 2: On the next page, Log in / Sign up and navigate to the API Dashboard.

    OpenAI API Platform sign-in page
  • Step 3: On the API Dashboard page, navigate to API keys in the sidebar and open it.

    OpenAI API dashboard with API keys highlighted in the sidebar
  • Step 4: Then click on “Create a new secret key” and fill in the details:

    OpenAI Create new secret key dialog
    • Name: any name; project name preferred

    • Project: I keep it as the default; suggested too

    • Expiration: Most important; set this to 30 days.

    • Permission: All is preferred, but if you want read-only support, choose that; restricted is the best of both worlds (all & read-only)

Click “Create secret key”, and you'll get a long string. Copy it; we will use it in the next step.

Note: You can even start by directly logging in at : https://platform.openai.com and follow from step 3

Now that we have our key, it's time to use the decisions api in Claude Code

Using OpenAI Decision API with Composio Instant

You can use Composio with Claude without a separate OpenAI API key with Composio Instant

First, connect Claude Code to Composio; the steps are straightforward.

  • Go to the Claude app. Switch to Claude Code

    Claude app switched to Claude Code with Plugins highlighted
  • Open the Plugins Section → click Add → select Custom Connector

    Claude Code Plugins page with Add custom connector in the Add menu
  • Fill in the fields:

    Add custom connector dialog with the Composio MCP URL
  • Name: Composio

  • URL: connect.composio.dev

Hit Complete → complete the OAuth & you are done. (I already have one, so it's stating that, not an error.)

However, to use Composio Instant, you need to enable it in the settings. Follow the instructions to do so:

Note: Composio Instant uses zero markup fees, which means you only pay for what you use, composio don’t add up their own. You can learn more at Composio Instant Pricing page.

  • Open the Composio Dashboard.

    Composio dashboard home page
  • Head to Settings → General

    Composio Settings, General page
  • Under Configuration, enable Composio Instant

    Composio Settings with the Instant toggle highlighted

Now you have Instant enabled. Ensure you fund your wallet once by clicking on the wallet shown in the dashboard (1st image)

Once that is done, head back to the Claude code and prompt

Using the Decisions API (Composio Instant), tell me which came first: the hen or the egg.

You will see a response like this.


Claude Code loading the OPENAI_CREATE_DECISION tool through the Composio Instant account

As you can see, you got egg as a response.

In case you are curious, the question was run through OPENAI_CREATE_DECISIONS tools, present in Composio’s OpenAI toolkit. As for schema handling for decision-one models, Composio handled everything.

I enjoyed using it this way too and tried a few of the steps; take it as inspiration or build your own once we look at another approach as well

Using OpenAI Decisions API in Claude Code with Composio

You can connect composio to Claude Code by following the Composio Integration with Claude Code guide.

Once it's connected, prompt Claude Code:

connect my composio accout to openai.

You will get a link; click it, and you will be prompted to enter the OpenAI API key.


Composio form asking for an OpenAI API key

Paste the copied key and click Connect Account, and you're done.

Now you can ask questions about decisions you are confused about and get them resolved.

Two Examples I Tried

Here are two examples I tried, along with the prompt and result.

Forgotten Promise Tracker

I pulled everything I wrote in the last 5 days: sent Gmail, GitHub comments and PR reviews, Google Docs and comments, then used the decision api to classify it and create a sheet in Google Sheets.

The prompt I used

Use Composio to run a "forgotten promises" tracker on my last 5 days of activity.

<p>IMPORTANT: For every OpenAI Decisions API call, use Composio's OPENAI_CREATE_DECISION tool through the Composio instant account. Do not connect or ask for my own OpenAI account or API key. If the instant account isn't available, stop and tell me instead of using another method.</p>
<ol>
<li><p>Collect (Composio): Fetch everything I wrote in the last 5 days:</p>
<ul>
<li>My sent Gmail emails</li>
<li>My GitHub issue comments and PR reviews</li>
</ul>
</li>
<li><p>Detect (Composio instant account → OPENAI_CREATE_DECISION, model gpt-6-luna): For each item, ask in one call:</p>
<ul>
<li>predicate: "The author commits to doing something specific."</li>
<li>choice "recipient": manager / client / teammate / community</li>
<li>choice "deadline": explicit date / vague (e.g. "soon") / none</li>
<li>score "stakes": Trivial / Minor / Important / Relationship-damaging
Keep only items where the commitment probability is above 0.8.</li>
</ul>
</li>
<li><p>Verify (Composio, plus Composio instant account → OPENAI_CREATE_DECISION): For each commitment, fetch what happened afterwards (later replies in the same Gmail thread, linked or merged GitHub PRs, edits to the Google Doc since). Then ask:</p>
<ul>
<li>predicate: "This later activity fulfils the commitment."
Mark it open if the probability is below 0.5.</li>
</ul>
</li>
<li><p>Deliver (Composio): Create a Google Sheet called "Open Promises" with these columns: Promise (short quote), Source app, Link, Recipient type, Deadline, Stakes, Days since made, Fulfilment probability. Sort by Stakes, then by Days since made.</p>
</li>
</ol>
<p>Before running, estimate the number of items and the instant-account Decisions API cost, and tell me if it's over $0.50 along with any tools if not conneccted.</p>
<p>When done, give me a 3-line summary: total promises found, how many are open, and the oldest high-stakes one and link to the google doc you made.</p>

I let this run for 1 minute and got the results:

Claude Code summary of the forgotten promises tracker

And it also generated the Google Sheet for me:

Open Promises Google Sheet created by Claude Code

Note: If you are not connected to the tools, you will be prompted to do so, ensure you connect.

Now let’s head to the 2nd one I tried

Candidate Recruiter

HR has to go through 1000+ submissions for every hire; you can now automate this. That’s what I did.

I fetched candidate submissions from GitHub, checked and verified them against the coding standards in Google Docs, mapped them to the decisions one needs to take using the Decisions API, stored those decisions in Google Sheets based on the assigned points, and drafted an email in Gmail.

Prompt I used:

Use Composio to read the candidate submission from the GitHub repo DevloperHS/assignment-submission and my "Recruiter Standards" Google Doc. <p></p>
<p>Turn each standard into a Decisions API question (coding must-haves as predicates, system design and architecture as Poor/Fair/Good/Strong scores) and evaluate the code with OPENAI_CREATE_DECISION on the Composio instant account (gpt-6-luna, never my own OpenAI key). Pass if all must-haves are above 0.8 and all scores are Good or better; fail if any must-have is below 0.3; otherwise, mark "Human review". </p>
<p>Log the result for each standard in a "Candidate Reviews" Google Sheet, and draft (don't send) a next-round invite or rejection email in Gmail.</p>
<p>At the end, output a very brief summary of what happened (2 lines), the link to the updated doc, and the associated cost.</p>
Claude Code summary of the candidate review with a link to the Candidate Reviews sheet

As you can see, it provided all the links and a brief summary of the decision. Files it generated.

Candidate Reviews sheet, Recruiter Standards doc and draft decision email

What I liked most was that it left the final decision to me. I could either accept the review or hold.

Claude Code asking whether to keep the rejection draft or switch to a human-review hold

You can try even more ideas that relate to your daily life, but these are the things I would keep in mind before doing so

Conclusion

Systems like Decision API make the decision-making process faster than ever. But they lack the flexibility when it comes to using multiple apps.

Composio solves this by offering an instant route, handling the required schema and making the process significantly faster while channelling the response across multiple contexts with context intact, as evident from the examples.

However, the agent can’t always be trusted, and the final decision should always rest with a human; that should be the core design philosophy for decision-one models like those from Typesafe, OpenAI, Microsoft, Google and others.

Regardless of all this, decision-making is becoming increasingly important for agents and humans; decision APIs are here to help, so what are you waiting for? Connect your Composio account and start making decisions.


Get started

Your agents can
do more

Connect your agents to 2,000+ apps. Start for free, no credit card needed.

Are you an AI agent? See setup options
H
AuthorHarsh

Share