Build a response
- Provide input. Send text, or include images, documents, or audio.
- Add context and tools. Retrieve context from vector stores or graph stores. Use function calling, MCP tools, or code execution when the model needs to act.
- Choose the output. Receive text, enable image generation, or request audio output. Check the feature guide for its model requirements and request fields.
- Manage the interaction. Stream output, continue a conversation, or run a long request in the background.
Inputs, resources, and tools
Start with Files to upload content and obtain file IDs for document inputs and vector stores. Inputs belong to a request. Resources such as files, vector stores, and sandbox sessions have their own creation and management APIs and can be reused across requests. For retrieval, upload and index your files before searching the store. The retrieval guides show how to obtain context that you can pass to a response. Graph retrieval changes how a vector store finds connected evidence. Tools let the model request actions as part of generating a response. Function calling lets your application execute those actions; MCP connects tool servers. Shell handles broader workspace tasks, while code interpreter focuses on writing and running code. Both use the same sandbox platform; see Code execution.Choose a standalone API when appropriate
Realtime voice is a standalone API with its own session workflow. Start there when building a live voice interaction. For document-to-JSON extraction with reusable schemas, use the standalone Extract API.