Agent Tool Integration
DeepSeek API supports function calling (tool use), enabling your model to invoke external tools and build powerful agent workflows.
Function Calling Example
Define tools with JSON Schema and let the model decide when and how to use them.
{
"model": "deepseek-chat",
"messages": [{"role": "user", "content": "What's the weather in Beijing?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather info for a city",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"}
},
"required": ["city"]
}
}
}]
}OpenAI Compatible
DeepSeek's function calling is fully compatible with the OpenAI tools API format. Migrate existing OpenAI agent code with minimal changes.
Best Practices
Use clear function descriptions, keep parameter schemas simple, and test with deepseek-chat for best tool calling performance.
Explore the Rich Ecosystem
Major Agent frameworks and tools have seamlessly integrated with the DeepSeek engine. View the details below.
View All Integrations →