Three APIs for different needs
Chat CompletionsThe most widely used API. Stateless, simple, and supports function calling, streaming, and vision. Best for most use cases.
Responses APIThe newest API with built in web search, code interpreter, and file search. Designed as the unified future interface.
Assistants APIPersistent threads, server side state management, and multi tool orchestration. Best for complex assistant applications.
1
Define your tools
Describe functions the model can call with their parameters and descriptions
2
Send a request
Include your function definitions alongside the conversation messages
3
Model decides
The model evaluates whether to call a function and generates the call arguments
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.