POST https://api.f5ai.ru/v2/chat/completions
X-Auth-Token: YOUR_API_KEY
Content-Type: application/json
{
"model": "gpt-4.1-mini",
"messages": [
{ "role": "user", "content": "Какое время в Москве?" }
],
"tools": [],
"instructions": "Ты очень полезный ассистент!",
"max_tokens": 1000,
"temperature": 0.6
}
{
"created": 1750756702,
"model": "gpt-4.1-mini",
"message": {
"role": "assistant",
"content": "Сейчас я не могу получить текущее время, но могу подсказать, как это сделать."
},
"tools_calls": [],
"usage": {
"prompt_tokens": 32,
"completion_tokens": 66,
"total_tokens": 98
},
"finish_reason": "COMPLETE"
}
{
"type": "function",
"name": "get_current_weather",
"description": "Get current weather in a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location", "unit"]
}
}