Two powerful APIs for AI generation. Understand the differences and choose the right one for your use case.
Stateful, agentic workflows
Stateless, simple requests
| Feature | Responses API | Chat Completions |
|---|---|---|
| State Management | ✓ Built-in conversation state | ✗ Stateless, manage yourself |
| Tool Use | ✓ Native, multi-turn | ✓ Function calling |
| File Handling | ✓ Built-in file attachments | ✗ Base64 encoding only |
| Streaming | ✓ Server-Sent Events | ✓ Server-Sent Events |
| Context Caching | ✓ Automatic | ✓ Manual |
| Web Search | ✓ Built-in tool | ✗ Not available |
| Code Interpreter | ✓ Built-in | ✗ Use Assistants API |
| Computer Use | ✓ Supported | ✗ Not available |
| OpenAI Compatible | ✗ New format | ✓ Drop-in replacement |
# Stateful conversation
response = client.responses.create(
model="mythic-4",
input="Analyze this data",
tools=[{"type": "code_interpreter"}],
attachments=[
{"file_id": file.id}
]
)
# Continue conversation
response2 = client.responses.create(
model="mythic-4",
input="Now create a chart",
previous_response_id=response.id
)
# Stateless, pass full history
messages = [
{"role": "system", "content": "..."},
{"role": "user", "content": "Hello"}
]
response = client.chat.completions.create(
model="mythic-4",
messages=messages
)
# Continue - append manually
messages.append(response.choices[0].message)
messages.append({"role": "user", ...})
For new projects, we recommend starting with the Responses API. It's more powerful, handles state for you, and includes built-in tools. Use Chat Completions if you need OpenAI compatibility or have existing integrations.
Explore the full documentation for each API.