How to connect Openai to Pydantic AI in 2 mins: No API key needed

You can route tickets, tag reviews and score drafts with OpenAI's Decisions API from Pydantic AI, and use OpenAI's chat, image and speech models with your own OpenAI key. Composio lets you use OpenAI inside Pydantic AI.

OpenaiInstant · No API key

Pydantic AI runs Openai through Composio, and the cost comes out of your free $2.

  • A team and urgency for a support ticket$0.0001
  • A rules check on a chat transcript$0.0003
  • A checklist score for a 10-page document$0.0007

$2 ≈ 20000 tickets or 6600 transcripts

Composio Instant

What you can do with your free $2

What your free $2 gets you with Openai
When you ask Pydantic AI forPydantic AI uses this toolCostWhat $2 gets you
A team and urgency for a support ticketCreate Decision$0.0001 per ticketAbout 20,000 tickets
A rules check on a chat transcriptCreate Decision$0.0003 per transcriptAbout 6,600 transcripts
A checklist score for a 10-page documentCreate Decision$0.0007 per documentAbout 2,800 documents

You pay Openai's price for each call with 0% markup, plus the regular Composio tool call charge. There's no Openai subscription, and you only pay for what you use.

1 of 128 Openai tools work without a key. For Add Upload Part, Cancel batch, Cancel evaluation run, Cancel Response, Cancel Run, Cancel upload and 121 more, connect your own Openai key. Read how Instant works.

How it works

How to connect Openai to Pydantic AI

Composio adds Openai to Pydantic AI as an Instant toolkit. You connect Composio to Pydantic AI once, and then Pydantic AI can use Openai right away. There are two ways to do this:

  • Bring your own key

    You bring your own Openai API key, set it up, and use it.

  • Use the Composio wallet

    Instant

    Composio runs each call on its own Openai account, so you don't have to set anything up at Openai, and your first $2 is free.

You do the setup one time and it takes about a minute. If you build Openai into your own product, turn on Instant toolkits in your project settings so your agent can call Openai for each of your users without a Openai API key, and read Instant tools in the Composio docs for the setup steps and code examples.

Get started

Start to use Openai in Pydantic AI in 3 steps

  1. Turn on Instant

    Open your Composio wallet and turn on Instant. Your free $2 shows up there.

  2. Add Composio to Pydantic AI

    Follow the setup below. You only do this once.

  3. Ask Pydantic AI for something

    Try a Openai prompt. The cost comes out of your $2.

Setup

Step-by-step Guide

Step by step09 STEPS
1

Prerequisites

Before starting, make sure you have:
  • Python 3.9 or higher
  • A Composio account with an active API key
  • Basic familiarity with Python and async programming
2

Getting API Keys for OpenAI and Composio

OpenAI API Key
  • Go to the OpenAI dashboard and create an API key. You'll need credits to use the models, or you can connect to another model provider.
  • Keep the API key safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Navigate to your API settings and generate a new API key.
  • Store this key securely as you'll need it for authentication.
3

Install dependencies

bash
pip install composio pydantic-ai python-dotenv

Install the required libraries.

What's happening:

  • composio connects your agent to external SaaS tools like Openai
  • pydantic-ai lets you create structured AI agents with tool support
  • python-dotenv loads your environment variables securely from a .env file
4

Set up environment variables

bash
COMPOSIO_API_KEY=your_composio_api_key_here
USER_ID=your_user_id_here
OPENAI_API_KEY=your_openai_api_key

Create a .env file in your project root.

What's happening:

  • COMPOSIO_API_KEY authenticates your agent to Composio's API
  • USER_ID associates your session with your account for secure tool access
  • OPENAI_API_KEY to access OpenAI LLMs
5

Import dependencies

python
import asyncio
import os
from dotenv import load_dotenv
from composio import Composio
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStreamableHTTP

load_dotenv()
What's happening:
  • We load environment variables and import required modules
  • Composio manages connections to Openai
  • MCPServerStreamableHTTP connects to the Openai MCP server endpoint
  • Agent from Pydantic AI lets you define and run the AI assistant
6

Create a Tool Router Session

python
async def main():
    api_key = os.getenv("COMPOSIO_API_KEY")
    user_id = os.getenv("USER_ID")
    if not api_key or not user_id:
        raise RuntimeError("Set COMPOSIO_API_KEY and USER_ID in your environment")

    # Create a Composio Tool Router session for Openai
    composio = Composio(api_key=api_key)
    session = composio.create(
        user_id=user_id,
        toolkits=["openai"],
    )
    url = session.mcp.url
    if not url:
        raise ValueError("Composio session did not return an MCP URL")
What's happening:
  • We're creating a Tool Router session that gives your agent access to Openai tools
  • The create method takes the user ID and specifies which toolkits should be available
  • The returned session.mcp.url is the MCP server URL that your agent will use
7

Initialize the Pydantic AI Agent

python
# Attach the MCP server to a Pydantic AI Agent
openai_mcp = MCPServerStreamableHTTP(url, headers={"x-api-key": COMPOSIO_API_KEY})
agent = Agent(
    "openai:gpt-5",
    toolsets=[openai_mcp],
    instructions=(
        "You are a Openai assistant. Use Openai tools to help users "
        "with their requests. Ask clarifying questions when needed."
    ),
)
What's happening:
  • The MCP client connects to the Openai endpoint
  • The agent uses GPT-5 to interpret user commands and perform Openai operations
  • The instructions field defines the agent's role and behavior
8

Build the chat interface

python
# Simple REPL with message history
history = []
print("Chat started! Type 'exit' or 'quit' to end.\n")
print("Try asking the agent to help you with Openai.\n")

while True:
    user_input = input("You: ").strip()
    if user_input.lower() in {"exit", "quit", "bye"}:
        print("\nGoodbye!")
        break
    if not user_input:
        continue

    print("\nAgent is thinking...\n", flush=True)

    async with agent.run_stream(user_input, message_history=history) as stream_result:
        collected_text = ""
        async for chunk in stream_result.stream_output():
            text_piece = None
            if isinstance(chunk, str):
                text_piece = chunk
            elif hasattr(chunk, "delta") and isinstance(chunk.delta, str):
                text_piece = chunk.delta
            elif hasattr(chunk, "text"):
                text_piece = chunk.text
            if text_piece:
                collected_text += text_piece
        result = stream_result

    print(f"Agent: {collected_text}\n")
    history = result.all_messages()
What's happening:
  • The agent reads input from the terminal and streams its response
  • Openai API calls happen automatically under the hood
  • The model keeps conversation history to maintain context across turns
9

Run the application

python
if __name__ == "__main__":
    asyncio.run(main())
What's happening:
  • The asyncio loop launches the agent and keeps it running until you exit

Complete Code

Here's the complete code to get you started with Openai and Pydantic AI:

python
import asyncio
import os
from dotenv import load_dotenv
from composio import Composio
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStreamableHTTP

load_dotenv()

async def main():
    api_key = os.getenv("COMPOSIO_API_KEY")
    user_id = os.getenv("USER_ID")
    if not api_key or not user_id:
        raise RuntimeError("Set COMPOSIO_API_KEY and USER_ID in your environment")

    # Create a Composio Tool Router session for Openai
    composio = Composio(api_key=api_key)
    session = composio.create(
        user_id=user_id,
        toolkits=["openai"],
    )
    url = session.mcp.url
    if not url:
        raise ValueError("Composio session did not return an MCP URL")

    # Attach the MCP server to a Pydantic AI Agent
    openai_mcp = MCPServerStreamableHTTP(url, headers={"x-api-key": COMPOSIO_API_KEY})
    agent = Agent(
        "openai:gpt-5",
        toolsets=[openai_mcp],
        instructions=(
            "You are a Openai assistant. Use Openai tools to help users "
            "with their requests. Ask clarifying questions when needed."
        ),
    )

    # Simple REPL with message history
    history = []
    print("Chat started! Type 'exit' or 'quit' to end.\n")
    print("Try asking the agent to help you with Openai.\n")

    while True:
        user_input = input("You: ").strip()
        if user_input.lower() in {"exit", "quit", "bye"}:
            print("\nGoodbye!")
            break
        if not user_input:
            continue

        print("\nAgent is thinking...\n", flush=True)

        async with agent.run_stream(user_input, message_history=history) as stream_result:
            collected_text = ""
            async for chunk in stream_result.stream_output():
                text_piece = None
                if isinstance(chunk, str):
                    text_piece = chunk
                elif hasattr(chunk, "delta") and isinstance(chunk.delta, str):
                    text_piece = chunk.delta
                elif hasattr(chunk, "text"):
                    text_piece = chunk.text
                if text_piece:
                    collected_text += text_piece
            result = stream_result

        print(f"Agent: {collected_text}\n")
        history = result.all_messages()

if __name__ == "__main__":
    asyncio.run(main())
Try it

Ask Pydantic AI for something with Openai

Start a new chat and try this prompt:

Here are 20 support tickets. For each one, pick the team that should handle it (billing, technical, shipping or other) and rate urgency as low, medium or high. Give me the results as a table: [paste tickets].

Pydantic AI runs it on Instant and shows you the result. It doesn't ask you for a Openai key, and the cost comes out of your $2. You can see each call in your wallet.

Optional: connect your own Openai key

If you want Add Upload Part, Cancel batch, Cancel evaluation run, Cancel Response, Cancel Run, Cancel upload and 121 more, you need your own key. Ask Pydantic AI to connect your Openai account, and it gives you a Composio link:

Connect my Openai account using Composio.

Open the link, paste your Openai API key and click Connect Account. You can get a key from OpenAI API keys page. After that, Composio uses your key first and doesn't charge Instant for those calls.

Starter prompts

Use your first $2: copy a prompt into Pydantic AI

Each prompt runs on Instant, and the cost next to it is about what it takes from your $2.

  • Route support tickets to the right team

    Less than $0.01

    Sorts each ticket into billing, technical, shipping or other and rates how urgent it is.

    Here are 20 support tickets. For each one, pick the team that should handle it (billing, technical, shipping or other) and rate urgency as low, medium or high. Give me the results as a table: [paste tickets].

  • Tag product reviews by issue

    Less than $0.01

    Checks each review for refunds, delivery problems and defects, and scores how positive it is.

    For each of these 50 product reviews, check whether it mentions a refund request, a delivery problem or a product defect, and score how positive it is from 1 to 5. Give me a table and the totals: [paste reviews].

  • Score a draft against your checklist

    Less than $0.01

    Rates a draft on each point of your checklist, so you know what to fix before you publish.

    Score this blog draft on clarity, structure and fit with our tone notes (poor, fair, good or great), and check whether it has a clear call to action and a source for each statistic. Tone notes: [paste notes]. Draft: [paste draft].

  • Pick the passages that answer a question

    Less than $0.01

    Checks which passages really answer a question, so your agent only uses the relevant ones.

    My question is "[question]". For each of these 20 passages from my docs, give me the probability that it answers the question, and list the ones above 70%: [paste passages].

  • Check a support chat against your rules

    Less than $0.01

    Checks a chat transcript for rule breaks, like promising refunds or skipping identity checks.

    Check this support chat transcript against our rules: did the agent verify the customer's identity before sharing account details, promise a refund without approval, or share another customer's data? Give me a probability for each: [paste transcript].

What it can do

What Pydantic AI can do with Openai

Works without a key

  • A team and urgency for a support ticket
  • A rules check on a chat transcript
  • A checklist score for a 10-page document

Needs your own Openai key

  • Add Upload Part
  • Cancel batch
  • Cancel evaluation run
  • Cancel Response
  • Cancel Run
  • Cancel upload
  • Compact Response
  • Complete Upload
  • and 119 more
Tools and prices

Supported tools (128)

Openai tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Create DecisionEvaluate evidence with typed predicate, choice, and score questions.Yes$0.10 per 1M input tokens ($0.20 long context)
Add Upload PartTool to add a part (chunk of bytes) to an Upload object.Needs your own keyBilled to your own Openai key
Cancel batchTool to cancel an in-progress batch.Needs your own keyBilled to your own Openai key
Cancel evaluation runTool to cancel an ongoing evaluation run.Needs your own keyBilled to your own Openai key
Cancel ResponseTool to cancel a background model response by its ID.Needs your own keyBilled to your own Openai key
Cancel RunRequest cancellation of an in-progress assistant run by thread and run ID, for example when the run is no longer needed.Needs your own keyBilled to your own Openai key
Cancel uploadTool to cancel an upload.Needs your own keyBilled to your own Openai key
Compact ResponseTool to compact a conversation or response to reduce token usage.Needs your own keyBilled to your own Openai key
Complete UploadComplete a multipart Upload and create its usable File object.Needs your own keyBilled to your own Openai key
Create Audio TranscriptionTranscribes audio files to text via the OpenAI Audio Transcriptions API, optionally returning timestamps.Needs your own keyBilled to your own Openai key
Create Audio TranslationTool to translate audio files to English text via OpenAI Audio Translations API.Needs your own keyBilled to your own Openai key
Create BatchTool to create and execute a batch from an uploaded file of requests.Needs your own keyBilled to your own Openai key
Create Chat CompletionCreates a chat completion from OpenAI models for conversational AI, text generation, function calling, vision or audio tasks, and structured JSON outputs.Needs your own keyBilled to your own Openai key
Create Completion (Legacy)Generate single-turn text completions using OpenAI's legacy Completions API with an available compatible model.Needs your own keyBilled to your own Openai key
Create ContainerTool to create a new container with configurable memory, expiration, file access, and network policies.Needs your own keyBilled to your own Openai key
Create Container FileTool to create a file in a container.Needs your own keyBilled to your own Openai key
Create ConversationTool to create a new conversation for multi-turn interactions.Needs your own keyBilled to your own Openai key
Create Conversation ItemsTool to create items in a conversation with the given ID.Needs your own keyBilled to your own Openai key
Create EmbeddingsTool to generate text embeddings via the OpenAI embeddings endpoint.Needs your own keyBilled to your own Openai key
Create EvalTool to create an evaluation structure for testing a model's performance.Needs your own keyBilled to your own Openai key
Show all 128 tools
More Openai tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Create Evaluation RunCreates an evaluation run for testing with a specified data source and model configuration.Needs your own keyBilled to your own Openai key
Create fine-tuning jobCreates a fine-tuning job from an uploaded training dataset and returns job details and status.Needs your own keyBilled to your own Openai key
Generate ImageTool to generate an image via the OpenAI Images API and return hosted image asset URL and metadata.Needs your own keyBilled to your own Openai key
Edit ImageTool to create edited or extended images via OpenAI Images Edit API.Needs your own keyBilled to your own Openai key
Create Image VariationCreate alternative versions of an existing square PNG image using the legacy image variations operation, with options for count, size, and response format.Needs your own keyBilled to your own Openai key
Create MessageCreate a message in an Assistants conversation thread.Needs your own keyBilled to your own Openai key
Create ModerationTool to classify text and/or image inputs for potentially harmful content via the OpenAI Moderation API.Needs your own keyBilled to your own Openai key
Create Realtime CallCreates a Realtime API call over WebRTC and returns the SDP answer needed to complete the peer connection.Needs your own keyBilled to your own Openai key
Create Realtime Client SecretTool to create an ephemeral client secret for authenticating Realtime API connections.Needs your own keyBilled to your own Openai key
Create Realtime SessionTool to create an ephemeral API token for client-side Realtime API applications.Needs your own keyBilled to your own Openai key
Create Realtime Transcription SessionTool to create an ephemeral API token for realtime transcriptions via the Realtime API.Needs your own keyBilled to your own Openai key
Create ResponseCreates a model response via the Responses API for text or image analysis and structured JSON output.Needs your own keyBilled to your own Openai key
Create RunCreate an assistant run on an existing thread to execute the assistant and generate responses, optionally adding messages and setting run options.Needs your own keyBilled to your own Openai key
Create SkillTool to create a skill from uploaded files.Needs your own keyBilled to your own Openai key
Create Speech (TTS)Tool to generate text-to-speech audio using OpenAI's Audio API.Needs your own keyBilled to your own Openai key
Create ThreadCreate an Assistants API conversation thread with optional starter messages and metadata.Needs your own keyBilled to your own Openai key
Create Thread And RunCreate an Assistants thread and run in one request to start a conversation and execute an assistant.Needs your own keyBilled to your own Openai key
Create UploadTool to create an intermediate Upload object for large file uploads.Needs your own keyBilled to your own Openai key
Create Vector StoreTool to create a new vector store.Needs your own keyBilled to your own Openai key
Create Vector Store FileTool to create a vector store file by attaching a File to a vector store.Needs your own keyBilled to your own Openai key
Create vector store file batchTool to create a vector store file batch.Needs your own keyBilled to your own Openai key
Create VideoCreate an asynchronous video generation job from a text prompt using the OpenAI Videos API; the job ID and status were used to track generation.Needs your own keyBilled to your own Openai key
Create Video RemixSubmit a remix job for an existing generated video using a new prompt.Needs your own keyBilled to your own Openai key
Delete assistantDelete a specific Assistants API assistant by ID.Needs your own keyBilled to your own Openai key
Delete chat completionTool to delete a stored chat completion by its ID.Needs your own keyBilled to your own Openai key
Delete containerTool to delete a specific container by its ID.Needs your own keyBilled to your own Openai key
Delete container fileTool to delete a file from a container.Needs your own keyBilled to your own Openai key
Delete conversationTool to delete a conversation by its ID.Needs your own keyBilled to your own Openai key
Delete conversation itemTool to delete an item from a conversation with the given IDs.Needs your own keyBilled to your own Openai key
Delete evaluationTool to delete a specific evaluation by its ID.Needs your own keyBilled to your own Openai key
Delete evaluation runDeletes a specific evaluation run.Needs your own keyBilled to your own Openai key
Delete fileDeletes a file by its ID.Needs your own keyBilled to your own Openai key
Delete messageDelete a specific message from an Assistants conversation thread using the thread and message IDs.Needs your own keyBilled to your own Openai key
Delete responseTool to delete a model response with the given ID.Needs your own keyBilled to your own Openai key
Delete skillTool to delete a specific skill by its ID.Needs your own keyBilled to your own Openai key
Delete threadDelete an Assistants API conversation thread by its ID.Needs your own keyBilled to your own Openai key
Delete Vector StoreTool to delete a vector store.Needs your own keyBilled to your own Openai key
Delete Vector Store FileTool to delete a vector store file.Needs your own keyBilled to your own Openai key
Delete videoDelete a video by ID from OpenAI's Videos API, returning a deletion result.Needs your own keyBilled to your own Openai key
Download fileTool to download the contents of a specified file by its ID.Needs your own keyBilled to your own Openai key
Download Video ContentDownload a generated video's MP4 content or its thumbnail or spritesheet by video ID.Needs your own keyBilled to your own Openai key
Get Chat CompletionTool to retrieve a stored chat completion.Needs your own keyBilled to your own Openai key
Get Chat Completion MessagesTool to retrieve messages from a stored chat completion.Needs your own keyBilled to your own Openai key
Get ChatKit threadTool to retrieve a ChatKit thread by its ID.Needs your own keyBilled to your own Openai key
Get Conversation ItemTool to retrieve a single item from a conversation.Needs your own keyBilled to your own Openai key
Get EvalTool to retrieve an evaluation by ID.Needs your own keyBilled to your own Openai key
Get Evaluation RunTool to retrieve an evaluation run by ID to check status and results.Needs your own keyBilled to your own Openai key
Get Eval Run Output ItemTool to retrieve a specific output item from an evaluation run by its ID.Needs your own keyBilled to your own Openai key
Get eval run output itemsTool to get a list of output items for an evaluation run.Needs your own keyBilled to your own Openai key
Get Evaluation RunsTool to get a paginated list of runs for an evaluation.Needs your own keyBilled to your own Openai key
Get Input Token CountsTool to calculate input token counts for OpenAI API requests.Needs your own keyBilled to your own Openai key
Get MessageRetrieve a specific message from an Assistants thread by thread and message IDs to inspect its content and details.Needs your own keyBilled to your own Openai key
Get ResponseTool to retrieve a model response by ID.Needs your own keyBilled to your own Openai key
Get Run StepRetrieve a specific Assistants run step by thread, run, and step ID to inspect execution progress, tool calls, or message creation.Needs your own keyBilled to your own Openai key
Get Vector StoreTool to retrieve a vector store by its ID.Needs your own keyBilled to your own Openai key
Get Vector Store FileTool to retrieve a file from a vector store.Needs your own keyBilled to your own Openai key
Get Vector Store File BatchRetrieve a file batch by its vector store and batch IDs to check the status and file counts of a batch processing operation.Needs your own keyBilled to your own Openai key
Get VideoRetrieve a video generation job by ID to inspect its status, progress, and details.Needs your own keyBilled to your own Openai key
List AssistantsList Assistants API assistants to discover an assistant ID from returned names or metadata.Needs your own keyBilled to your own Openai key
List BatchesTool to list your organization's batches.Needs your own keyBilled to your own Openai key
List Chat CompletionsTool to list stored chat completions that were created with the `store` parameter set to true.Needs your own keyBilled to your own Openai key
List ChatKit thread itemsList items from a ChatKit thread, including messages, tool calls, and tasks.Needs your own keyBilled to your own Openai key
List container filesList files in a specific container.Needs your own keyBilled to your own Openai key
List ContainersList a page of containers, optionally filtering by name.Needs your own keyBilled to your own Openai key
List Conversation ItemsList a page of items in a conversation by ID for review or processing.Needs your own keyBilled to your own Openai key
List enginesTool to list available engines and their basic information.Needs your own keyBilled to your own Openai key
List EvalsTool to list evaluations for a project.Needs your own keyBilled to your own Openai key
List filesLists files in the authenticated organization/project context.Needs your own keyBilled to your own Openai key
List Files in Vector Store BatchTool to list vector store files in a batch.Needs your own keyBilled to your own Openai key
List fine-tunesLists fine-tuning jobs for the authenticated context, with cursor pagination.Needs your own keyBilled to your own Openai key
List fine-tuning job eventsTool to get status updates for a fine-tuning job.Needs your own keyBilled to your own Openai key
List fine-tuning job checkpointsTool to list checkpoints for a fine-tuning job.Needs your own keyBilled to your own Openai key
List Input ItemsTool to retrieve input items for a given response from the OpenAI Responses API.Needs your own keyBilled to your own Openai key
List MessagesList messages in an Assistants thread, including outputs generated by a run.Needs your own keyBilled to your own Openai key
List modelsLists models available to the current account or organization, with model identifiers and ownership metadata.Needs your own keyBilled to your own Openai key
List RunsList a page of Assistants runs belonging to a thread to inspect their status or execution history.Needs your own keyBilled to your own Openai key
List Run StepsList steps in an Assistants API run to inspect execution progress, tool calls, and message creation events.Needs your own keyBilled to your own Openai key
List SkillsList skills with pagination and timestamp ordering, returning their IDs, names, and descriptions.Needs your own keyBilled to your own Openai key
List ChatKit ThreadsTool to list ChatKit threads with pagination and filtering.Needs your own keyBilled to your own Openai key
List Vector Store FilesTool to list files in a vector store.Needs your own keyBilled to your own Openai key
List Vector StoresTool to list vector stores to discover available vector stores by name or metadata.Needs your own keyBilled to your own Openai key
List VideosList video generation jobs and their statuses, with pagination and timestamp ordering, to review multiple tasks.Needs your own keyBilled to your own Openai key
Modify AssistantModify an existing Assistants API assistant's configuration, such as its model, instructions, tools, or metadata.Needs your own keyBilled to your own Openai key
Modify MessageModify metadata on a specific message in an Assistants conversation thread, identified by thread and message IDs.Needs your own keyBilled to your own Openai key
Modify RunUpdate metadata on a specific Assistants run identified by its thread and run IDs.Needs your own keyBilled to your own Openai key
Modify threadUpdate metadata on an existing Assistants API thread identified by its thread ID.Needs your own keyBilled to your own Openai key
Modify Vector StoreTool to modify an existing vector store.Needs your own keyBilled to your own Openai key
Retrieve assistantRetrieve a specific assistant by ID to inspect its configuration and metadata.Needs your own keyBilled to your own Openai key
Retrieve BatchTool to retrieve a batch by ID to check its status, progress, and results.Needs your own keyBilled to your own Openai key
Retrieve containerTool to retrieve details of a specific container by its ID.Needs your own keyBilled to your own Openai key
Retrieve container fileTool to retrieve metadata for a specific file in a container.Needs your own keyBilled to your own Openai key
Retrieve container file contentTool to retrieve the content of a file within a container.Needs your own keyBilled to your own Openai key
Retrieve engineRetrieve a legacy OpenAI engine by ID to inspect its availability and metadata.Needs your own keyBilled to your own Openai key
Retrieve fileTool to retrieve information about a specific file.Needs your own keyBilled to your own Openai key
Retrieve fine-tuning jobTool to retrieve information about a fine-tuning job.Needs your own keyBilled to your own Openai key
Retrieve modelTool to retrieve details of a specific model, confirming its metadata (ownership, created date) and verifying access under your org — a model appearing in OPENAI_LIST_MODELS does not guarantee access.Needs your own keyBilled to your own Openai key
Retrieve runRetrieve an Assistants run by thread and run ID to check its status, errors, and usage, such as when polling for completion before reading thread messages.Needs your own keyBilled to your own Openai key
Retrieve threadRetrieve an Assistants API thread by ID to inspect its metadata; message bodies are obtained separately.Needs your own keyBilled to your own Openai key
Retrieve Vector Store File ContentTool to retrieve the parsed contents of a vector store file.Needs your own keyBilled to your own Openai key
Run graderTool to run a grader to evaluate model performance on a given sample.Needs your own keyBilled to your own Openai key
Search Vector StoreTool to search a vector store for relevant chunks based on a query and file attributes filter.Needs your own keyBilled to your own Openai key
Submit Tool Outputs to RunSubmit all tool call outputs together to continue an Assistants API run whose required action is submit_tool_outputs.Needs your own keyBilled to your own Openai key
Update Chat CompletionTool to update metadata for a stored chat completion.Needs your own keyBilled to your own Openai key
Update ConversationTool to update a conversation's metadata.Needs your own keyBilled to your own Openai key
Update EvalUpdates an evaluation's name or metadata without changing its data source configuration or testing criteria.Needs your own keyBilled to your own Openai key
Update Vector Store File AttributesTool to update custom attributes on a vector store file.Needs your own keyBilled to your own Openai key
Upload fileUpload file bytes to OpenAI for a specified purpose, such as fine-tuning, and return the uploaded file's details.Needs your own keyBilled to your own Openai key
Validate grader configurationTool to validate a grader configuration for fine-tuning jobs.Needs your own keyBilled to your own Openai key
Pricing

How you pay for Openai

  • Your first $2 is freeIt's added to your Composio wallet when you turn on Instant.
  • You pay for each callYou pay Openai's price with 0% markup, plus the regular Composio tool call charge.
  • Your own key comes firstIf you connect your own Openai key, Composio uses it and doesn't charge Instant for those calls.
  • You control the costYou can ask your agent to check with you before each paid call, and you can turn Instant off at any time.
  • You can see each callYour wallet shows each call and what it cost.
  • When your balance runs outYou can add funds to your wallet on a Pro plan or connect your own key.
Help

Troubleshooting

  1. 1. Pydantic AI asks me for a Openai API key

    You may have asked for something that needs your own key, like Add Upload Part, Cancel batch, Cancel evaluation run, Cancel Response, Cancel Run, Cancel upload and 121 more. Those tools don't run on Instant. For everything else, check that Instant is turned on in your Composio wallet, then ask again.

  2. 2. I can't see my free $2

    Open your wallet in the Composio dashboard and check that Instant is turned on. If the $2 still isn't there, email support@composio.dev from the address you signed up with.

  3. 3. A Openai call failed with a balance error

    Your balance is empty. Add funds to your wallet on a Pro plan, or connect your own Openai key, then try again.

FAQ

Frequently asked questions

Start with Openai.It takes 30 seconds.

New accounts get a one-time $2 starter credit for Instant calls.Run Openai from your agent with no Openai key.

Get $2 starter credit