Three APIs for different needs
💬
Chat Completions
The most widely used API. Stateless, simple, and supports function calling, streaming, and vision. Best for most use cases.
🔧
Responses API
The newest API with built in web search, code interpreter, and file search. Designed as the unified future interface.
🤖
Assistants API
Persistent threads, server side state management, and multi tool orchestration. Best for complex assistant applications.
Step 1: Define your tools
Describe functions the model can call with their parameters and descriptions
Step 2: Send a request
Include your function definitions alongside the conversation messages
Step 3: Model decides
The model evaluates whether to call a function and generates the call arguments
Step 4: Execute and return
Your code runs the function and sends the result back to the model for the final response
Which API should you use?
For new projects, start with the Responses API if you need built in tools, or Chat Completions for maximum simplicity and ecosystem compatibility. Use the Assistants API only if you need OpenAI to manage persistent conversation state and file storage on your behalf.