Обнаружил сервис sambanova для получения токенов на популярные LLM модели, такие как DeepSeek, liama и тд.

При регистрации аккаунта дают $5 и api ключ. Можно использовать модель на выбор. Пример запроса
async def get_sambanova_response(chat_id: int) -> str:
"""Отправка запроса к SambaNova API и получение ответа"""
headers = {
"Authorization": f"Bearer {SAMBANOVA_API_KEY}",
"Content-Type": "application/json",
}
payload = {
"model": "Llama-4-Maverick-17B-128E-Instruct",
"messages": [
{"role": "system", "content": "You are a helpful AI assistant. Provide clear and concise responses without using any markdown formatting."},
*chat_history[chat_id] # Включение всей истории чата
],
"max_tokens": 500,
"temperature": 0.7
}
response = requests.post(SAMBANOVA_API_URL, headers=headers, json=payload)
# Проверка статуса ответа
if response.status_code == 200:
data = response.json()
return data["choices"][0]["message"]["content"]
else:
raise Exception(f"SambaNova API error: {response.status_code} - {response.text}")
